netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Salam Noureddine <noureddine@arista.com>
Cc: "David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jiri Pirko <jiri@mellanox.com>,
	Alexei Starovoitov <ast@plumgrid.com>,
	Daniel Borkmann <daniel@iogearbox.net>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	Julian Anastasov <ja@ssi.bg>,
	Network Development <netdev@vger.kernel.org>
Subject: Re: [PATCH v2 net-next 4/4] net: fib: avoid calling fib_flush for each device when doing batch close and unregister
Date: Sun, 7 Feb 2016 13:24:47 +0300	[thread overview]
Message-ID: <56B71B6F.1010708@cogentembedded.com> (raw)
In-Reply-To: <CAO7SqHCj3Fq+CXz_y+4ou+JxSvyMgpyQNRjMfX=Zvow3knocpw@mail.gmail.com>

Hello.

On 2/7/2016 9:09 AM, Salam Noureddine wrote:

>>>
>>>          if (event == NETDEV_UNREGISTER) {
>>> -               fib_disable_ip(dev, event, true);
>>> +               if (fib_sync_down_dev(dev, event, true))
>>> +                       net->ipv4.needs_fib_flush = true;
>>>                  rt_flush_dev(dev);
>>>                  return NOTIFY_DONE;
>>>          }
>>>
>>> +       if (event == NETDEV_UNREGISTER_BATCH || event ==
>>> NETDEV_DOWN_BATCH) {
>>> +               if (net->ipv4.needs_fib_flush) {
>>> +                       fib_flush(net);
>>> +                       net->ipv4.needs_fib_flush = false;
>>> +               }
>>> +               rt_cache_flush(net);
>>> +               arp_ifdown_all();
>>> +               return NOTIFY_DONE;
>>> +       }
>>> +
>>
>>
>>     I'd convert to *switch* the above 2 *if*'s...

> I could do that.

    Please do it, in this patch.

> Thanks,
>
> Salam

MBR, Sergei

  reply	other threads:[~2016-02-07 10:24 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-04 23:35 [PATCH v2 net-next 0/4] batch calls to fib_flush and arp_ifdown Salam Noureddine
2016-02-04 23:35 ` [PATCH v2 net-next 1/4] net: add event_list to struct net and provide utility functions Salam Noureddine
2016-02-04 23:35 ` [PATCH v2 net-next 2/4] net: dev: add batching to net_device notifiers Salam Noureddine
2016-02-06 18:58   ` Julian Anastasov
2016-02-07  6:25     ` Salam Noureddine
2016-02-07 10:09       ` Julian Anastasov
2016-02-04 23:35 ` [PATCH v2 net-next 3/4] net: core: introduce neigh_ifdown_all for all down interfaces Salam Noureddine
2016-02-04 23:35 ` [PATCH v2 net-next 4/4] net: fib: avoid calling fib_flush for each device when doing batch close and unregister Salam Noureddine
2016-02-05 16:04   ` Sergei Shtylyov
2016-02-07  6:09     ` Salam Noureddine
2016-02-07 10:24       ` Sergei Shtylyov [this message]
2016-02-05 22:37 ` [PATCH v2 net-next 0/4] batch calls to fib_flush and arp_ifdown Salam Noureddine

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=56B71B6F.1010708@cogentembedded.com \
    --to=sergei.shtylyov@cogentembedded.com \
    --cc=ast@plumgrid.com \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=ebiederm@xmission.com \
    --cc=edumazet@google.com \
    --cc=ja@ssi.bg \
    --cc=jiri@mellanox.com \
    --cc=netdev@vger.kernel.org \
    --cc=noureddine@arista.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).