linux_dsm_epyc7002/drivers/net/bonding
Andy Gospodarek bb5b052f75 bond: add support to read speed and duplex via ethtool
This patch adds support for the get_settings ethtool op to the bonding
driver.  This was motivated by users who wanted to get the speed of the
bond and compare that against throughput to understand utilization.
The behavior before this patch was added was problematic when computing
line utilization after trying to get link-speed and throughput via SNMP.

Output from ethtool looks like this for a round-robin bond:

Settings for bond0:
	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: 11000Mb/s
	Duplex: Full
	Port: Other
	PHYAD: 0
	Transceiver: internal
	Auto-negotiation: off
	MDI-X: Unknown
	Link detected: yes

I tested this and verified it works as expected.  A test was also done
on a version backported to an older kernel and it worked well there.

v2: Switch to using ethtool_cmd_speed_set to set speed, added check to
SLAVE_IS_OK for each slave in bond, dropped mode-specific calculations
as they were not needed, and set port type to 'Other.'

v3: Fix useless assignment and checkpatch warning.

Signed-off-by: Andy Gospodarek <andy@greyhouse.net>
Reviewed-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-04-19 16:39:50 -04:00
..
bond_3ad.c bonding: Fix initialize after use for 3ad machine state spinlock 2013-02-19 00:51:08 -05:00
bond_3ad.h bonding: remove packet cloning in recv_probe() 2012-06-12 18:51:09 -07:00
bond_alb.c net: vlan: add protocol argument to packet tagging functions 2013-04-19 14:46:06 -04:00
bond_alb.h bonding: delete migrated IP addresses from the rlb hash table 2012-11-30 12:07:27 -05:00
bond_debugfs.c bonding: delete migrated IP addresses from the rlb hash table 2012-11-30 12:07:27 -05:00
bond_main.c bond: add support to read speed and duplex via ethtool 2013-04-19 16:39:50 -04:00
bond_procfs.c bonding: show all the link status of slaves 2012-06-17 16:23:54 -07:00
bond_sysfs.c bonding: fix disabling of arp_interval and miimon 2013-03-29 15:02:49 -04:00
bonding.h bond: have random dev address by default instead of zeroes 2013-01-30 15:34:00 -05:00
Makefile bonding, ipv4, ipv6, vlan: Handle NETDEV_BONDING_FAILOVER like NETDEV_NOTIFY_PEERS 2011-04-17 23:36:03 -07:00