Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added net_device_stats to push IO stats on the device #165

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hschauhan
Copy link

The xmm7360 module works great. But it seems dead on the UI
because there are not stats available on the device. The system
monitor etc can see the device but can't show the current statistics
like speed, packets etc.

This patch fixes that and addds net_device_stats to the driver
and keeps track of the packets and number of bytes Tx/Rx'ed.

Signed-off-by: Himanshu Chauhan [email protected]

@hschauhan
Copy link
Author

Any comment on this?

@nursoda
Copy link
Contributor

nursoda commented Feb 26, 2022

Please be patient, the maintainer does work on this, but it may take some weeks until he looks into it.
Thanks for the PR though. I'd like to test it but don't know how to verify it does work for me. Please add instructions.

@hschauhan
Copy link
Author

There are multiple ways to test it.

  1. open system monitor on your distro. Under the resources tab, you can see network IO graph. Without this patch, it shouldn't print anything (if xmm7360 is the only interface up).
  2. In gnome, you can install extensions to show network activity.

@nursoda
Copy link
Contributor

nursoda commented Feb 26, 2022

It compiles fine and I can connect. However I don't see network activity in my KDE System Monitor (network tab) when using wwan0 while I see activity when using LAN or WiFi. This was my setup while testing (doing updates (pacman -Suy) loading quite some packages via wwan0):

$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: enp2s0f0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 54:05:db:f5:4b:77 brd ff:ff:ff:ff:ff:ff
3: wlp3s0: <BROADCAST,MULTICAST> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
    link/ether fa:3c:fa:06:d0:86 brd ff:ff:ff:ff:ff:ff permaddr 18:26:49:ee:fc:14
7: wwan0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN group default qlen 1000
    link/none 
    inet 10.67.244.88/0 scope global wwan0
       valid_lft forever preferred_lft forever
    inet6 2a02:3033:a:f708:7915:fb92:3fc3:bdc0/64 scope global dynamic mngtmpaddr stable-privacy 
       valid_lft forever preferred_lft forever
    inet6 fe80::aaca:875d:797e:84e2/64 scope link stable-privacy 
       valid_lft forever preferred_lft forever
$ route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         0.0.0.0         0.0.0.0         U     1000   0        0 wwan0

@hschauhan
Copy link
Author

It compiles fine and I can connect. However I don't see network activity in my KDE System Monitor (network tab) when using wwan0 while I see activity when using LAN or WiFi. This was my setup while testing (doing updates (pacman -Suy) loading quite some packages via wwan0):

$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: enp2s0f0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 54:05:db:f5:4b:77 brd ff:ff:ff:ff:ff:ff
3: wlp3s0: <BROADCAST,MULTICAST> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
    link/ether fa:3c:fa:06:d0:86 brd ff:ff:ff:ff:ff:ff permaddr 18:26:49:ee:fc:14
7: wwan0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN group default qlen 1000
    link/none 
    inet 10.67.244.88/0 scope global wwan0
       valid_lft forever preferred_lft forever
    inet6 2a02:3033:a:f708:7915:fb92:3fc3:bdc0/64 scope global dynamic mngtmpaddr stable-privacy 
       valid_lft forever preferred_lft forever
    inet6 fe80::aaca:875d:797e:84e2/64 scope link stable-privacy 
       valid_lft forever preferred_lft forever
$ route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         0.0.0.0         0.0.0.0         U     1000   0        0 wwan0

check the statistics with ip -s link

@nursoda
Copy link
Contributor

nursoda commented Mar 1, 2022

Thanks. Again, I deactivated WiFi and LAN and started WWAN. Then, I see this with ip -s -h l, so your PR seems fine:

8: wwan0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN mode DEFAULT group default qlen 1000
    link/none 
    RX:  bytes packets errors dropped  missed   mcast           
         8.45M   8.75k      0       0       0       0 
    TX:  bytes packets errors dropped carrier collsns           
          719k   5.30k      0       0       0       0 

While watching these time these counters climb up, I don't see network activity in KDE 5.24.2's System Monitor.

@hschauhan
Copy link
Author

Any updates on this?

@nursoda
Copy link
Contributor

nursoda commented Apr 3, 2022

What updates do you expect?

I said that your PR looks good if it's target is to provide stats via ip command. I have no knowledge about why it doesn't show in KDE System Monitor and cannot help you.

Or did you just want to bump the owner ;)

Copy link
Contributor

@nursoda nursoda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does compile and run fine, provides stats to ip, doesn't provide stats to KDE System Monitor.

@kolAflash
Copy link

Works great for me!

@abrasive can this become merged?

The xmm7360 module works great. But it seems dead on the UI
because there are not stats available on the device. The system
monitor etc can see the device but can't show the current statistics
like speed, packets etc.

This patch fixes that and addds net_device_stats to the driver
and keeps track of the packets and number of bytes Tx/Rx'ed.

Signed-off-by: Himanshu Chauhan <[email protected]>
@tgxn
Copy link
Contributor

tgxn commented Jul 17, 2023

@kolAflash @hschauhan @nursoda sorry for not looking at this stuff sooner - this patch is still good to merge? I haven't got hardware to test this on ATM.

@nursoda
Copy link
Contributor

nursoda commented Aug 26, 2023

Is this patch is still good to merge? I haven't got hardware to test this on ATM.

Yes, go ahead. I just re-tested. It still compiles without issues and works as good (and with the same glitches) as before. On my T14s using Arch current (Kernel 6.4.12), after loading a webpage with only wwan0 enabled, I get stats in ip:

$ ip stats show dev wwan0
30: wwan0: group offload subgroup hw_stats_info
    l3_stats off used off
30: wwan0: group afstats subgroup mpls
30: wwan0: group offload subgroup l3_stats off used off
30: wwan0: group offload subgroup cpu_hit

30: wwan0: group link
    RX:  bytes packets errors dropped  missed   mcast           
       1619316    2711      0       0       0       0 
    TX:  bytes packets errors dropped carrier collsns           
       2625293    3166      0       0       0       0 
30: wwan0: group xstats_slave subgroup bond suite 802.3ad
30: wwan0: group xstats_slave subgroup bridge suite mcast
30: wwan0: group xstats_slave subgroup bridge suite stp
30: wwan0: group xstats subgroup bond suite 802.3ad
30: wwan0: group xstats subgroup bridge suite mcast
30: wwan0: group xstats subgroup bridge suite stp

I still get no stats in KDE (plasma-systemmonitor, ksystemstatssystem), and cannot enable it through KDE/Networkmanager.

@hschauhan
Copy link
Author

Unfortunately, I too don't have this machine now. But the patch worked well when I had the machine.

Copy link
Contributor

@nursoda nursoda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stefansaraev
Copy link

thank you very much. this is what I was looking for. patches/comiles cleanly and works great.

and big thanks to all who contributed here ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants