Hi David, On Fri, Mar 10, 2017 at 11:58 AM, David Ahern <d...@cumulusnetworks.com> wrote: > On 3/9/17 7:52 PM, f...@ikuai8.com wrote: >> From: Gao Feng <f...@ikuai8.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.
Thanks. I didn't consider about the case that dev is enslaved to an l3 device you pointed. Regards Feng