From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jiri Pirko Subject: Re: [PATCH net-next] net: link_watch: mark bonding link events urgent Date: Mon, 22 Jan 2018 09:13:26 +0100 Message-ID: <20180122081326.GA2012@nanopsycho> References: <1516601273-7883-1-git-send-email-roopa@cumulusnetworks.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: davem@davemloft.net, netdev@vger.kernel.org, nikolay@cumulusnetworks.com, dsa@cumulusnetworks.com To: Roopa Prabhu Return-path: Received: from mail-wr0-f194.google.com ([209.85.128.194]:32958 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750993AbeAVIN2 (ORCPT ); Mon, 22 Jan 2018 03:13:28 -0500 Received: by mail-wr0-f194.google.com with SMTP id p6so7592758wrd.0 for ; Mon, 22 Jan 2018 00:13:28 -0800 (PST) Content-Disposition: inline In-Reply-To: <1516601273-7883-1-git-send-email-roopa@cumulusnetworks.com> Sender: netdev-owner@vger.kernel.org List-ID: Mon, Jan 22, 2018 at 07:07:53AM CET, roopa@cumulusnetworks.com wrote: >From: Roopa Prabhu > >It takes 1sec for bond link down notification to hit user-space >when all slaves of the bond go down. 1sec is too long for >protocol daemons in user-space relying on bond link notification >to failover/recover (eg: multichassis lag implementations in user-space). >Since the link event code already marks team device port link events > urgent, this patch does the same for bonding link events. > >Signed-off-by: Roopa Prabhu >--- > net/core/link_watch.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/net/core/link_watch.c b/net/core/link_watch.c >index 9828616..63bb2ad 100644 >--- a/net/core/link_watch.c >+++ b/net/core/link_watch.c >@@ -92,7 +92,7 @@ static bool linkwatch_urgent_event(struct net_device *dev) > if (dev->ifindex != dev_get_iflink(dev)) > return true; > >- if (dev->priv_flags & IFF_TEAM_PORT) >+ if (dev->priv_flags & (IFF_TEAM_PORT | IFF_BONDING)) Don't you want to do that for bonding slaves? IFF_BONDING is set for both master and slave. netif_is_bond_slave() helper checks that. In fact netif_is_team_port() should be used here instead of checking IFF_TEAM_PORT directly. And then you can use netif_is_lag_port() to check them both. > return true; > > return netif_carrier_ok(dev) && qdisc_tx_changing(dev); >-- >2.1.4 >