network script looks at link speed, but doesn't check for max advertised speed

Bug #1336320 reported by Jeff Lane 
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Checkbox Provider - Base
Fix Released
Medium
Jeff Lane 

Bug Description

the network script looks at /sys/class/net/DEVICE/speed to get the value for max_speed which is used to compare iperf results for success or failure.

However, the speed item is not the device max speed, but rather the link speed currently connected:

https://www.kernel.org/doc/Documentation/ABI/testing/sysfs-class-net
What: /sys/class/net/<iface>/speed
Date: October 2009
KernelVersion: 2.6.33
Contact: <email address hidden>
Description:
  Indicates the interface latest or current speed value. Value is
  an integer representing the link speed in Mbits/sec.

  Note: this attribute is only valid for interfaces that implement
  the ethtool get_settings method (mostly Ethernet ).

It would be useful if the test would also get the advertised max speed from the device and report if max_speed is < advertised_max_speed.

Related branches

Jeff Lane  (bladernr)
Changed in plainbox-provider-checkbox:
assignee: nobody → Jeff Lane (bladernr)
status: New → Confirmed
importance: Undecided → Medium
Jeff Lane  (bladernr)
Changed in plainbox-provider-checkbox:
status: Confirmed → In Progress
Revision history for this message
Jeff Lane  (bladernr) wrote :

Now it errors and exits if the device max is not the same as the detected link speed. This should catch instances where a device is run on a lower-speed network than it should be (e.g. 10G on 1G networks)

$ sudo ./network test -i eth0 -t iperf --target 192.168.0.10
DEBUG:root:Shutting down interface:virbr0
DEBUG:root:Shutting down interface:vboxnet0
DEBUG:root:Shutting down interface:wlan0
ERROR:root:Detected link speed (100) is lower than detected max speed (1000)
ERROR:root:Please check your device configuration and try again
DEBUG:root:Restoring interface:virbr0
DEBUG:root:Restoring interface:vboxnet0
DEBUG:root:Restoring interface:wlan0

Revision history for this message
Jeff Lane  (bladernr) wrote :

sudo ./network test -i eth0 -t iperf --target 192.168.0.10
DEBUG:root:Shutting down interface:virbr0
DEBUG:root:Shutting down interface:vboxnet0
DEBUG:root:Shutting down interface:wlan0
ERROR:root:Detected link speed (100) is lower than detected max speed (1000)
ERROR:root:Please check your device configuration and try again
DEBUG:root:Restoring interface:virbr0
DEBUG:root:Restoring interface:vboxnet0
DEBUG:root:Restoring interface:wlan0
bladernr@klaatu:~/development/1336320-network-get-real-max-speed/providers/plainbox-provider-checkbox/bin$ sudo ethtool -s eth0 speed 1000 duplex full
bladernr@klaatu:~/development/1336320-network-get-real-max-speed/providers/plainbox-provider-checkbox/bin$ sudo ./network test -i eth0 -t iperf --target 192.168.0.10
DEBUG:root:Shutting down interface:virbr0
DEBUG:root:Shutting down interface:vboxnet0
DEBUG:root:Shutting down interface:wlan0
DEBUG:root:timeout 180 iperf -c transit -n 1024M
------------------------------------------------------------
Client connecting to transit, TCP port 5001
TCP window size: 85.0 KByte (default)
------------------------------------------------------------
[ 3] local 192.168.0.100 port 36949 connected with 192.168.0.10 port 5001
[ ID] Interval Transfer Bandwidth
[ 3] 0.0- 9.2 sec 1.00 GBytes 932 Mbits/sec

Transfer speed: 932 Mb/s
93.20% of theoretical max 1000Mb/s

DEBUG:root:Passed benchmark
DEBUG:root:Restoring interface:virbr0
DEBUG:root:Restoring interface:vboxnet0
DEBUG:root:Restoring interface:wlan0

Revision history for this message
Jeff Lane  (bladernr) wrote :

sudo ./network test -i wlan0 -t iperf --target 192.168.0.10
DEBUG:root:Shutting down interface:virbr0
DEBUG:root:Shutting down interface:eth0
WARNING:root:No max speed detected, assuming Wireless deviceand continuing with test.
DEBUG:root:timeout 180 iperf -c transit -n 1024M
WARNING:root:iperf timed out - this should be OK
------------------------------------------------------------
Client connecting to transit, TCP port 5001
TCP window size: 85.0 KByte (default)
------------------------------------------------------------
[ 3] local 192.168.0.101 port 35363 connected with 192.168.0.10 port 5001
[ ID] Interval Transfer Bandwidth
[ 3] 0.0-180.0 sec 458 MBytes 21.3 Mbits/sec

ERROR:root:Max Speed was not reported properly. Run ethtool and verify that the card is properly reporting its capabilities.
ERROR:root:float division by zero

Transfer speed: 21.3 Mb/s
WARNING:root:Unable to obtain maximum speed, so I can't decide if it passed the required threshold.Considering the test as passed, but pleasereview the results manually and decide ifperformance is acceptable
DEBUG:root:Restoring interface:virbr0
DEBUG:root:Restoring interface:eth0

Jeff Lane  (bladernr)
Changed in plainbox-provider-checkbox:
status: In Progress → Fix Committed
Changed in plainbox-provider-checkbox:
milestone: none → 0.7
Changed in plainbox-provider-checkbox:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.