lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y5R6Qy+j6xlVgzUh@Laptop-X1>
Date:   Sat, 10 Dec 2022 20:23:31 +0800
From:   Hangbin Liu <liuhangbin@...il.com>
To:     Saeed Mahameed <saeed@...nel.org>
Cc:     netdev@...r.kernel.org, Jay Vosburgh <j.vosburgh@...il.com>,
        "David S . Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        Jonathan Toppins <jtoppins@...hat.com>,
        Paolo Abeni <pabeni@...hat.com>,
        Eric Dumazet <edumazet@...gle.com>, liali <liali@...hat.com>
Subject: Re: [PATCH net 2/3] bonding: do failover when high prio link up

On Fri, Dec 09, 2022 at 04:03:35PM -0800, Saeed Mahameed wrote:
> On 09 Dec 18:13, Hangbin Liu wrote:
> > Currently, when a high prio link enslaved, or when current link down,
> > the high prio port could be selected. But when high prio link up, the
> > new active slave reselection is not triggered. Fix it by checking link's
> > prio when getting up.
> > 
> > Reported-by: Liang Li <liali@...hat.com>
> > Fixes: 0a2ff7cc8ad4 ("Bonding: add per-port priority for failover re-selection")
> > Signed-off-by: Hangbin Liu <liuhangbin@...il.com>
> > ---
> > drivers/net/bonding/bond_main.c | 6 ++++--
> > 1 file changed, 4 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
> > index 2b6cc4dbb70e..dc6af790ff1e 100644
> > --- a/drivers/net/bonding/bond_main.c
> > +++ b/drivers/net/bonding/bond_main.c
> > @@ -2689,7 +2689,8 @@ static void bond_miimon_commit(struct bonding *bond)
> > 
> > 			bond_miimon_link_change(bond, slave, BOND_LINK_UP);
> > 
> > -			if (!rtnl_dereference(bond->curr_active_slave) || slave == primary)
> > +			if (!rtnl_dereference(bond->curr_active_slave) || slave == primary ||
> > +			    slave->prio > rtnl_dereference(bond->curr_active_slave)->prio)
> > 				goto do_failover;
> 
> I am not really familiar with this prio logic, seems to be new. Anyway, what
> if one of the next slaves has higher prio than this slave and the
> current active ? I see that the loop over all the slaves continues even
> after the failover,
> but why would you do all these failovers until you settle on the highest
> prio one ?

Thanks, this makes sense to me. I will fix it.

Hangbin
> 
> shouldn't you do something similar to bond_choose_primary_or_current()
> outside the loop, once you've updated all the slaves link states
> 
> Please let me know if I am wandering in the wrong directions
> Anyway, LGTM:
> 
> Reviewed-by: Saeed Mahameed <saeed@...nel.org>
> 
> 
> 
> 
> 
> 
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ