Message ID | 4ca4b878.KGc4gLtXHLSFlAdV%ole@ans.pl |
---|---|
State | Accepted, archived |
Delegated to: | David Miller |
Headers | show |
From: Krzysztof Piotr Oledzki <ole@ans.pl> Date: Thu, 30 Sep 2010 18:19:04 +0200 > Subject: bonding: add Speed/Duplex information to /proc/net/bonding/bond* > > Effect: > Slave Interface: eth5 > MII Status: up > Speed: 10000 Mbps > Duplex: full > Link Failure Count: 0 > Permanent HW addr: XX:XX:XX:XX:XX:XX > Slave queue ID: 0 > > Signed-off-by: Krzysztof Piotr Oledzki <ole@ans.pl> Changing the layout of a procfs file is pretty much always unsafe. Some useland program somewhere depends upon the current layout, and therefore very likely could break if we change the contents. We really can't apply a patch like this. A most portable and extensible interface (netlink, ethtool) should be used to provide this information to userspace. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On 2010-10-06 23:24, David Miller wrote: > From: Krzysztof Piotr Oledzki <ole@ans.pl> > Date: Thu, 30 Sep 2010 18:19:04 +0200 > >> Subject: bonding: add Speed/Duplex information to /proc/net/bonding/bond* >> >> Effect: >> Slave Interface: eth5 >> MII Status: up >> Speed: 10000 Mbps >> Duplex: full >> Link Failure Count: 0 >> Permanent HW addr: XX:XX:XX:XX:XX:XX >> Slave queue ID: 0 >> >> Signed-off-by: Krzysztof Piotr Oledzki <ole@ans.pl> > > Changing the layout of a procfs file is pretty much always unsafe. > > Some useland program somewhere depends upon the current layout, and > therefore very likely could break if we change the contents. > > We really can't apply a patch like this. A most portable and > extensible interface (netlink, ethtool) should be used to provide this > information to userspace. Sure, no problem. Please note however that this procfs file was recently changed ("Slave queue ID" was added) so if this is indeed a problem than we would already heard about this. Best regards, Krzysztof Olędzki -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
From: Krzysztof Olędzki <ole@ans.pl> Date: Wed, 06 Oct 2010 23:32:10 +0200 > Please note however that this procfs file was recently changed ("Slave > queue ID" was added) so if this is indeed a problem than we would > already heard about this. You make a good argument, therefore I have decided to apply your patch. Thanks. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index e409c14..61c8971 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -3315,6 +3315,8 @@ static void bond_info_show_slave(struct seq_file *seq, seq_printf(seq, "\nSlave Interface: %s\n", slave->dev->name); seq_printf(seq, "MII Status: %s\n", (slave->link == BOND_LINK_UP) ? "up" : "down"); + seq_printf(seq, "Speed: %d Mbps\n", slave->speed); + seq_printf(seq, "Duplex: %s\n", slave->duplex ? "full" : "half"); seq_printf(seq, "Link Failure Count: %u\n", slave->link_failure_count);