[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1459256383.6473.161.camel@edumazet-glaptop3.roam.corp.google.com>
Date: Tue, 29 Mar 2016 05:59:43 -0700
From: Eric Dumazet <eric.dumazet@...il.com>
To: Corcodel Marian <asd@...ian1000.go.ro>
Cc: netdev@...r.kernel.org, Francois Romieu <romieu@...zoreil.com>
Subject: Re: [PATCH 1/2 net-next v3.16]r8169: Disable set bit multicast
enable per multicast address.
On Sun, 2016-03-27 at 19:31 +0300, Corcodel Marian wrote:
> On Sat, 26 Mar 2016 10:18:46 -0700
> Eric Dumazet <eric.dumazet@...il.com> wrote:
>
> > On Sat, 2016-03-26 at 12:57 +0200, Corcodel Marian wrote:
> > > This patch correct set bit multicast enable only once per
> > > set_rx_mode invocation.
> > >
> > > Signed-off-by: Corcodel Marian <asd@...ian1000.go.ro>
> > > ---
> > > drivers/net/ethernet/realtek/r8169.c | 3 +--
> > > 1 file changed, 1 insertion(+), 2 deletions(-)
> > >
> > > diff --git a/drivers/net/ethernet/realtek/r8169.c
> > > b/drivers/net/ethernet/realtek/r8169.c index 7f6fb1f..f7b0dfb 100644
> > > --- a/drivers/net/ethernet/realtek/r8169.c
> > > +++ b/drivers/net/ethernet/realtek/r8169.c
> > > @@ -4619,12 +4619,11 @@ static void rtl_set_rx_mode(struct
> > > net_device *dev) } else {
> > > struct netdev_hw_addr *ha;
> > >
> > > - rx_mode = AcceptBroadcast | AcceptMyPhys;
> > > + rx_mode = AcceptBroadcast | AcceptMyPhys |
> > > AcceptMulticast; mc_filter[1] = mc_filter[0] = 0;
> > > netdev_for_each_mc_addr(ha, dev) {
> > > int bit_nr = ether_crc(ETH_ALEN, ha->addr)
> > > >> 26; mc_filter[bit_nr >> 5] |= 1 << (bit_nr & 31);
> > > - rx_mode |= AcceptMulticast;
> > > }
> > > }
> > >
> >
> > If the list is empty, why should we enable AcceptMulticast ?
> >
> >
> >
>
> I not experienced list empty, allways on my case exist bit_nr variable.
If dev->mc list is empty, the netdev_for_each_mc_addr(ha, dev) does
nothing at all.
In other words, netdev_mc_count(dev) can be 0
Current code is fine, and run in control (slow) path anyway.
Powered by blists - more mailing lists