[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAAVpQUA8j8OZJ8bvQkjVpX6HkAQW88wxvHnAMG_rrPzLqm+UGw@mail.gmail.com>
Date: Thu, 26 Jun 2025 17:56:04 -0700
From: Kuniyuki Iwashima <kuniyu@...gle.com>
To: Eric Dumazet <edumazet@...gle.com>
Cc: Kuniyuki Iwashima <kuni1840@...il.com>, "David S. Miller" <davem@...emloft.net>,
David Ahern <dsahern@...nel.org>, Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Simon Horman <horms@...nel.org>, netdev@...r.kernel.org
Subject: Re: [PATCH v2 net-next 01/15] ipv6: ndisc: Remove __in6_dev_get() in pndisc_{constructor,destructor}().
On Thu, Jun 26, 2025 at 7:26 AM Eric Dumazet <edumazet@...gle.com> wrote:
>
> On Tue, Jun 24, 2025 at 1:26 PM Kuniyuki Iwashima <kuni1840@...il.com> wrote:
> >
> > From: Kuniyuki Iwashima <kuniyu@...gle.com>
> >
> > ipv6_dev_mc_{inc,dec}() has the same check.
> >
> > Let's remove __in6_dev_get() from pndisc_constructor() and
> > pndisc_destructor().
> >
> > Signed-off-by: Kuniyuki Iwashima <kuniyu@...gle.com>
> > ---
> > net/ipv6/ndisc.c | 10 ++++++----
> > 1 file changed, 6 insertions(+), 4 deletions(-)
> >
> > diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
> > index ecb5c4b8518f..beb1814a1ac2 100644
> > --- a/net/ipv6/ndisc.c
> > +++ b/net/ipv6/ndisc.c
> > @@ -377,11 +377,12 @@ static int ndisc_constructor(struct neighbour *neigh)
> > static int pndisc_constructor(struct pneigh_entry *n)
> > {
> > struct in6_addr *addr = (struct in6_addr *)&n->key;
> > - struct in6_addr maddr;
> > struct net_device *dev = n->dev;
> > + struct in6_addr maddr;
> >
> > - if (!dev || !__in6_dev_get(dev))
> > + if (!dev)
> > return -EINVAL;
> > +
> > addrconf_addr_solict_mult(addr, &maddr);
> > ipv6_dev_mc_inc(dev, &maddr);
>
> return ipv6_dev_mc_inc(dev, &maddr); ?
>
> > return 0;
> > @@ -390,11 +391,12 @@ static int pndisc_constructor(struct pneigh_entry *n)
> > static void pndisc_destructor(struct pneigh_entry *n)
> > {
> > struct in6_addr *addr = (struct in6_addr *)&n->key;
> > - struct in6_addr maddr;
> > struct net_device *dev = n->dev;
> > + struct in6_addr maddr;
> >
> > - if (!dev || !__in6_dev_get(dev))
> > + if (!dev)
> > return;
> > +
> > addrconf_addr_solict_mult(addr, &maddr);
> > ipv6_dev_mc_dec(dev, &maddr);
>
> return ipv6_dev_mc_dec(dev, &maddr);
Somehow I separated this change for the following neigh conversion
series but will squash it to this patch.
Thanks!
>
> > }
> > --
>
> If not needed (because of a future patch ?), this should be mentioned
> in the changelog.
>
> > 2.49.0
> >
Powered by blists - more mailing lists