netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [net-next-2.6 PATCH 2/3] bonding: add Speed/Duplex information to /proc/net/bonding/bond
@ 2010-09-30 16:19 Krzysztof Piotr Oledzki
  2010-10-06 21:24 ` David Miller
  0 siblings, 1 reply; 4+ messages in thread
From: Krzysztof Piotr Oledzki @ 2010-09-30 16:19 UTC (permalink / raw)
  To: fubar, bonding-devel, netdev

>From b340edd6763b52a2d0f1e0ae256748a21bd19005 Mon Sep 17 00:00:00 2001
From: Krzysztof Piotr Oledzki <ole@ans.pl>
Date: Thu, 30 Sep 2010 17:54:15 +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>
---
 drivers/net/bonding/bond_main.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

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);
 
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [net-next-2.6 PATCH 2/3] bonding: add Speed/Duplex information to /proc/net/bonding/bond
  2010-09-30 16:19 [net-next-2.6 PATCH 2/3] bonding: add Speed/Duplex information to /proc/net/bonding/bond Krzysztof Piotr Oledzki
@ 2010-10-06 21:24 ` David Miller
  2010-10-06 21:32   ` Krzysztof Olędzki
  0 siblings, 1 reply; 4+ messages in thread
From: David Miller @ 2010-10-06 21:24 UTC (permalink / raw)
  To: ole; +Cc: fubar, bonding-devel, netdev

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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [net-next-2.6 PATCH 2/3] bonding: add Speed/Duplex information to /proc/net/bonding/bond
  2010-10-06 21:24 ` David Miller
@ 2010-10-06 21:32   ` Krzysztof Olędzki
  2010-10-07  1:44     ` David Miller
  0 siblings, 1 reply; 4+ messages in thread
From: Krzysztof Olędzki @ 2010-10-06 21:32 UTC (permalink / raw)
  To: David Miller; +Cc: fubar, bonding-devel, netdev

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [net-next-2.6 PATCH 2/3] bonding: add Speed/Duplex information to /proc/net/bonding/bond
  2010-10-06 21:32   ` Krzysztof Olędzki
@ 2010-10-07  1:44     ` David Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2010-10-07  1:44 UTC (permalink / raw)
  To: ole; +Cc: fubar, bonding-devel, netdev

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.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-10-07  1:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-30 16:19 [net-next-2.6 PATCH 2/3] bonding: add Speed/Duplex information to /proc/net/bonding/bond Krzysztof Piotr Oledzki
2010-10-06 21:24 ` David Miller
2010-10-06 21:32   ` Krzysztof Olędzki
2010-10-07  1:44     ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).