diff mbox series

[net] bonding: show slave priority in proc info

Message ID 20240923072843.46809-1-liuhangbin@gmail.com (mailing list archive)
State Rejected
Delegated to: Netdev Maintainers
Headers show
Series [net] bonding: show slave priority in proc info | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag present in non-next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 16 this patch: 16
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 7 of 8 maintainers
netdev/build_clang success Errors and warnings before: 16 this patch: 16
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 16 this patch: 16
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 7 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-09-26--21-00 (tests: 768)

Commit Message

Hangbin Liu Sept. 23, 2024, 7:28 a.m. UTC
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(+)

Comments

Eric Dumazet Sept. 23, 2024, 7:45 a.m. UTC | #1
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.
Hangbin Liu Sept. 24, 2024, 12:37 a.m. UTC | #2
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
diff mbox series

Patch

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;