[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YzFiXabip3LRy5e2@corigine.com>
Date: Mon, 26 Sep 2022 10:27:09 +0200
From: Simon Horman <simon.horman@...igine.com>
To: Juhee Kang <claudiajkang@...il.com>
Cc: netdev@...r.kernel.org, kuba@...nel.org, davem@...emloft.net,
edumazet@...gle.com, pabeni@...hat.com, skhan@...uxfoundation.org
Subject: Re: [PATCH net-next 1/3] net: use netdev_unregistering instead of
open code
On Mon, Sep 26, 2022 at 05:25:01PM +0900, Juhee Kang wrote:
> On Mon, Sep 26, 2022 at 5:19 PM Simon Horman <simon.horman@...igine.com> wrote:
> >
> > On Mon, Sep 26, 2022 at 05:05:08PM +0900, Juhee Kang wrote:
> > > Hi Simon,
> >
> > ...
> >
> > > > > diff --git a/net/core/dev.c b/net/core/dev.c
> > > > > index d66c73c1c734..f3f9394f0b5a 100644
> > > > > --- a/net/core/dev.c
> > > > > +++ b/net/core/dev.c
> > > > > @@ -2886,8 +2886,7 @@ int netif_set_real_num_tx_queues(struct net_device *dev, unsigned int txq)
> > > > > if (txq < 1 || txq > dev->num_tx_queues)
> > > > > return -EINVAL;
> > > > >
> > > > > - if (dev->reg_state == NETREG_REGISTERED ||
> > > > > - dev->reg_state == NETREG_UNREGISTERING) {
> > > > > + if (dev->reg_state == NETREG_REGISTERED || netdev_unregistering(dev)) {
> > > > > ASSERT_RTNL();
> > > > >
> > > > > rc = netdev_queue_update_kobjects(dev, dev->real_num_tx_queues,
> > > >
> > > > Is there any value in adding a netdev_registered() helper?
> > > >
> > >
> > > The open code which is reg_state == NETREG_REGISTERED used 37 times on
> > > some codes related to the network. I think that the
> > > netdev_registered() helper is valuable.
> >
> > Thanks, FWIIW, that seems likely to me too.
>
> Thanks!
> Apart from this patch, is it okay to send a patch that adds the
> netdev_registered helper function later?
In my opinion that would be good: let's fix one thing at a time.
Powered by blists - more mailing lists