[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <75261fc6-d793-031d-0a8e-bd864469ae27@cumulusnetworks.com>
Date: Thu, 9 Mar 2017 20:58:46 -0700
From: David Ahern <dsa@...ulusnetworks.com>
To: fgao@...ai8.com, davem@...emloft.net, kuznet@....inr.ac.ru,
jmorris@...ei.org, kaber@...sh.net, netdev@...r.kernel.org,
gfree.wind@...il.com
Subject: Re: [PATCH v3 net-next 1/2] net: Avoid unnessary loop when master_idx
is invalid in inet_select_addr
On 3/9/17 7:52 PM, fgao@...ai8.com wrote:
> From: Gao Feng <fgao@...ai8.com>
>
> When master_idx is invalid, it is zero. It is unnecessary to iterate
> all netdevs. Because l3mdev_master_ifindex_rcu(dev) != master_idx must
> be true.
> Now put this loop into the condition block when master_idx is valid.
you are significantly changing how this loop works, not just the
master_idx == 0 case. Basically, if dev does not have an address, you
are not going to look at the other interfaces.
The
if (l3mdev_master_ifindex_rcu(dev) != master_idx)
is actually relevant.
If dev is enslaved to an L3 device, only consider devices in that
domain. Conversely, if dev is NOT enslaved to an L3 device, do NOT
consider devices that are enslaved to one. Both of those are equally
important.
Powered by blists - more mailing lists