diff options
-rw-r--r-- | mpm/python/usrp_mpm/sys_utils/net.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/mpm/python/usrp_mpm/sys_utils/net.py b/mpm/python/usrp_mpm/sys_utils/net.py index 42eb9de62..a9be7b87d 100644 --- a/mpm/python/usrp_mpm/sys_utils/net.py +++ b/mpm/python/usrp_mpm/sys_utils/net.py @@ -87,6 +87,13 @@ def get_link_speed(ifname): if device.sys_name == ifname][0] speed = net_sysfs.attributes.asint('speed') + # FIXME: This sysfs call occasionally returns -1 as the speed if the connection is at all + # flaky. Returning 10 Gbs rather than 1 Gbs in this case mitigates negative side + # effects in the driver when this occurs on 10GbE ports without breaking mpm + # compatability. + if (speed < 0): + return 10000 + # TODO: 1Gige driver returns a bad value (less than 1000). Remove the conditional once the # driver is fixed return speed if speed >= 10000 else 1000 |