* [PATCH net] bonding: show slave priority in proc info
@ 2024-09-23 7:28 Hangbin Liu
2024-09-23 7:45 ` Eric Dumazet
0 siblings, 1 reply; 3+ messages in thread
From: Hangbin Liu @ 2024-09-23 7:28 UTC (permalink / raw)
To: netdev
Cc: Jay Vosburgh, Andy Gospodarek, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Nikolay Aleksandrov, Simon Horman,
linux-kernel, 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 <liuhangbin@gmail.com>
---
drivers/net/bonding/bond_procfs.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/bonding/bond_procfs.c b/drivers/net/bonding/bond_procfs.c
index 7edf72ec816a..8b8580956edd 100644
--- a/drivers/net/bonding/bond_procfs.c
+++ b/drivers/net/bonding/bond_procfs.c
@@ -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;
--
2.46.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net] bonding: show slave priority in proc info
2024-09-23 7:28 [PATCH net] bonding: show slave priority in proc info Hangbin Liu
@ 2024-09-23 7:45 ` Eric Dumazet
2024-09-24 0:37 ` Hangbin Liu
0 siblings, 1 reply; 3+ messages in thread
From: Eric Dumazet @ 2024-09-23 7:45 UTC (permalink / raw)
To: Hangbin Liu
Cc: netdev, Jay Vosburgh, Andy Gospodarek, David S. Miller,
Jakub Kicinski, Paolo Abeni, Nikolay Aleksandrov, Simon Horman,
linux-kernel
On Mon, Sep 23, 2024 at 9:29 AM Hangbin Liu <liuhangbin@gmail.com> wrote:
>
> 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 <liuhangbin@gmail.com>
> ---
> drivers/net/bonding/bond_procfs.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/net/bonding/bond_procfs.c b/drivers/net/bonding/bond_procfs.c
> index 7edf72ec816a..8b8580956edd 100644
> --- a/drivers/net/bonding/bond_procfs.c
> +++ b/drivers/net/bonding/bond_procfs.c
> @@ -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;
> --
> 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.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net] bonding: show slave priority in proc info
2024-09-23 7:45 ` Eric Dumazet
@ 2024-09-24 0:37 ` Hangbin Liu
0 siblings, 0 replies; 3+ messages in thread
From: Hangbin Liu @ 2024-09-24 0:37 UTC (permalink / raw)
To: Eric Dumazet
Cc: netdev, Jay Vosburgh, Andy Gospodarek, David S. Miller,
Jakub Kicinski, Paolo Abeni, Nikolay Aleksandrov, Simon Horman,
linux-kernel
Hi Eric,
On Mon, Sep 23, 2024 at 09:45:23AM +0200, Eric Dumazet wrote:
> On Mon, Sep 23, 2024 at 9:29 AM Hangbin Liu <liuhangbin@gmail.com> wrote:
> >
> > 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 <liuhangbin@gmail.com>
> > ---
> > drivers/net/bonding/bond_procfs.c | 1 +
> > 1 file changed, 1 insertion(+)
> >
> > diff --git a/drivers/net/bonding/bond_procfs.c b/drivers/net/bonding/bond_procfs.c
> > index 7edf72ec816a..8b8580956edd 100644
> > --- a/drivers/net/bonding/bond_procfs.c
> > +++ b/drivers/net/bonding/bond_procfs.c
> > @@ -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;
> > --
> > 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.
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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-09-24 0:37 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-23 7:28 [PATCH net] bonding: show slave priority in proc info Hangbin Liu
2024-09-23 7:45 ` Eric Dumazet
2024-09-24 0:37 ` Hangbin Liu
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).