Comment 1 for bug 1627084

Revision history for this message
Jeff Lane  (bladernr) wrote : Re: ethernet/multi_iperf3_nic_device* tests not detecting NIC speed on some systems

 Note that this is how the network script determines the max speed:
def max_speed(self):
        # Parse ethtool data for max speed since /sys/class/net/DEV/speed only
        # reports link speed.

        # Search for things that look like 100baseSX,
        # 40000baseNX, 10000baseT
        try:
            ethinfo = check_output(['ethtool', self.interface],
                                   universal_newlines=True,
                                   stderr=STDOUT).split(' ')
        except FileNotFoundError:
            logging.warning('ethtool not found! Unable to get max speed')
            ethinfo = None
        except CalledProcessError as e:
            logging.error('ethtool returned an error!')
            logging.error(e.output)
            ethinfo = None
        finally:
            expression = '(\\d+)(base)([A-Z]+)'
            regex = re.compile(expression)
            speeds = [0]
            if ethinfo:
                for i in ethinfo:
                    hit = regex.search(i)
                    if hit:
                        speeds.append(int(hit.group(1)))
            return max(speeds)

Also, on those systems, ethtool is not showing the advertised speeds:

Settings for enP2p1s0f2:
 Supported ports: [ ]
 Supported link modes: Not reported
 Supported pause frame use: No
 Supports auto-negotiation: No
 Advertised link modes: Not reported
 Advertised pause frame use: No
 Advertised auto-negotiation: No
 Speed: 10000Mb/s
 Duplex: Full
 Port: FIBRE
 PHYAD: 0
 Transceiver: external
 Auto-negotiation: off
 Current message level: 0x00000000 (0)

 Link detected: yes

and compare to this from an x86 system:

Settings for enP2p1s0f0:
 Supported ports: [ TP ]
 Supported link modes: 1000baseT/Full
                         10000baseT/Full
 Supported pause frame use: Symmetric
 Supports auto-negotiation: Yes
 Advertised link modes: 1000baseT/Full
                         10000baseT/Full
 Advertised pause frame use: No
 Advertised auto-negotiation: Yes
 Speed: 10000Mb/s
 Duplex: Full
 Port: Twisted Pair
 PHYAD: 0
 Transceiver: external
 Auto-negotiation: on
 MDI-X: Unknown
 Current message level: 0x0000000f (15)
          drv probe link timer
 Link detected: yes

So the bug is actually in the output of ethtool, in that there is no evidence of the supported modes in ethtool output.