Thread (12 messages) flat view 12 messages, 3 authors, 2016-02-07

Re: [PATCH v2 net-next 4/4] net: fib: avoid calling fib_flush for each device when doing batch close and unregister

From: Sergei Shtylyov <hidden>
Date: 2016-02-07 10:24:51

Hello.

On 2/7/2016 9:09 AM, Salam Noureddine wrote:
quoted
quoted
         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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help