bonding: show slave priority in proc info
Subsystems (3)
PATCH 1/1 bonding: show slave priority in proc info
The slave priority is currently not shown in the proc filesystem, which prevents users from retrieving this information via proc. This patch fixes the issue by printing the slave priority in the proc filesystem, making it accessible to users.
--- drivers/net/bonding/bond_procfs.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/bonding/bond_procfs.c +1 -0
@@ -210,6 +210,7 @@ static void bond_info_show_slave(struct seq_file *seq,seq_printf (seq,"Permanent HW addr: %*phC\n" , slave->dev->addr_len, slave->perm_hwaddr);seq_printf (seq,"Slave queue ID: %d\n" ,READ_ONCE (slave->queue_id)); +seq_printf (seq,"Slave prio: %d\n" ,READ_ONCE (slave->prio));if (BOND_MODE (bond) ==BOND_MODE_8023AD ) {const struct port *port = &SLAVE_AD_INFO (slave)->port;
Signature · 1 line
2.46.0
Quoted 25 lines · Hangbin Liu
The slave priority is currently not shown in the proc filesystem, which prevents users from retrieving this information via proc. This patch fixes the issue by printing the slave priority in the proc filesystem, making it accessible to users.
Fixes 0a2ff7cc8ad4 ("Bonding: add per-port priority for failover re-selection")Signed-off-by Hangbin Liu <[email protected]>--- drivers/net/bonding/bond_procfs.c | 1 + 1 file changed, 1 insertion(+)drivers/net/bonding/bond_procfs.c +1
-1@@ -210,6 +210,7 @@ static void bond_info_show_slave(struct seq_file *seq,seq_printf (seq,"Permanent HW addr: %*phC\n" , slave->dev->addr_len, slave->perm_hwaddr);seq_printf (seq,"Slave queue ID: %d\n" ,READ_ONCE (slave->queue_id)); +seq_printf (seq,"Slave prio: %d\n" ,READ_ONCE (slave->prio));if (BOND_MODE (bond) ==BOND_MODE_8023AD ) {const struct port *port = &SLAVE_AD_INFO (slave)->port; --
Quoted 2 lines
2.46.0
proc interface is deprecated in favor of rtnl.
slave->prio is correctly reported in IFLA_BOND_SLAVE_PRIO attribute.
No further kernel change is needed.
Hi Eric,
Quoted 31 lines · Eric Dumazet
Quoted 25 lines · Hangbin Liu
The slave priority is currently not shown in the proc filesystem, which prevents users from retrieving this information via proc. This patch fixes the issue by printing the slave priority in the proc filesystem, making it accessible to users.
Fixes 0a2ff7cc8ad4 ("Bonding: add per-port priority for failover re-selection")Signed-off-by Hangbin Liu <[email protected]>--- drivers/net/bonding/bond_procfs.c | 1 + 1 file changed, 1 insertion(+)drivers/net/bonding/bond_procfs.c +1
-1@@ -210,6 +210,7 @@ static void bond_info_show_slave(struct seq_file *seq,seq_printf (seq,"Permanent HW addr: %*phC\n" , slave->dev->addr_len, slave->perm_hwaddr);seq_printf (seq,"Slave queue ID: %d\n" ,READ_ONCE (slave->queue_id)); +seq_printf (seq,"Slave prio: %d\n" ,READ_ONCE (slave->prio));if (BOND_MODE (bond) ==BOND_MODE_8023AD ) {const struct port *port = &SLAVE_AD_INFO (slave)->port; --Quoted 2 lines
2.46.0
proc interface is deprecated in favor of rtnl.
Quoted 3 lines
slave->priois correctly reported inIFLA_BOND_SLAVE_PRIOattribute.No further kernel change is needed.
Thanks for the reply. Some users said they still prefer to use /proc to get the bonding info as it's easier compared with get info via rtnl(ip link). I'm OK to drop this patch.
Thanks
Hangbin