From: Jiri Pirko <jiri@resnulli.us>
To: Roopa Prabhu <roopa@cumulusnetworks.com>
Cc: David Miller <davem@davemloft.net>,
netdev@vger.kernel.org,
Nikolay Aleksandrov <nikolay@cumulusnetworks.com>,
David Ahern <dsa@cumulusnetworks.com>
Subject: Re: [PATCH net-next] net: link_watch: mark bonding link events urgent
Date: Mon, 22 Jan 2018 16:49:40 +0100 [thread overview]
Message-ID: <20180122154940.GC2012@nanopsycho> (raw)
In-Reply-To: <CAJieiUiwQrSbRpV5rfMPx+P3y+BkauWbsGMkS37b7S-LVEgg+w@mail.gmail.com>
Mon, Jan 22, 2018 at 04:14:17PM CET, roopa@cumulusnetworks.com wrote:
>On Mon, Jan 22, 2018 at 12:13 AM, Jiri Pirko <jiri@resnulli.us> wrote:
>> Mon, Jan 22, 2018 at 07:07:53AM CET, roopa@cumulusnetworks.com wrote:
>>>From: Roopa Prabhu <roopa@cumulusnetworks.com>
>>>
>>>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 <roopa@cumulusnetworks.com>
>>>---
>>> 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.
>
>
>IFF_BONDING Is set for both slaves and master (and thats what I need).
>In my case I consistently see link_watch throttle bond link down event
>...since it follows immediately after the the bond slave link down
>events
>(any optimizations in the bonding driver for link events are squashed
>at this point by link watch).
>so I do need to cover the bond master case. I think for the use-case I
>am talking about, team master device might also have the same
>problem....if somebody else in
>user-space is relying on the team master link down (though i do
>understand the sequence of events are a bit different there...where
>you set the master link down from user-space).
>
>thanks for the pointers to the helpers..., given above, are you ok if
>I move the check to netif_is_lag_port || netif_is_lag_master ?
Looks fine. Thanks.
prev parent reply other threads:[~2018-01-22 15:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-22 6:07 [PATCH net-next] net: link_watch: mark bonding link events urgent Roopa Prabhu
2018-01-22 8:13 ` Jiri Pirko
2018-01-22 15:14 ` Roopa Prabhu
2018-01-22 15:49 ` Jiri Pirko [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180122154940.GC2012@nanopsycho \
--to=jiri@resnulli.us \
--cc=davem@davemloft.net \
--cc=dsa@cumulusnetworks.com \
--cc=netdev@vger.kernel.org \
--cc=nikolay@cumulusnetworks.com \
--cc=roopa@cumulusnetworks.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).