Extend procfs status for bonded links to show "backup" and "inactive"flags

From: Jeroen van Bemmel
Date: Sat Jul 21 2012 - 12:34:32 EST


Hi,

bond_info_show_slave in /drivers/net/bonding/bond_procfs.c currently does not show all the information that is relevant to determine whether a given slave is used for network traffic or not. In certain active-backup setups, this means one can not easily tell what's happening.

An example patch to fix this:

diff --git a/drivers/net/bonding/bond_procfs.c b/drivers/net/bonding/bond_procfs.c
index 3cea38d..48ac2a4 100644
--- a/drivers/net/bonding/bond_procfs.c
+++ b/drivers/net/bonding/bond_procfs.c
@@ -169,6 +169,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", bond_slave_link_status(slave->link));
+ seq_printf(seq, "Bond Status: backup=%d inactive=%d\n",
+ slave->backup, slave->inactive );
if (slave->speed == SPEED_UNKNOWN)
seq_printf(seq, "Speed: %s\n", "Unknown");
else

Thanks,
Jeroen van Bemmel
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/