All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Horman <simon.horman@corigine.com>
To: Juhee Kang <claudiajkang@gmail.com>
Cc: netdev@vger.kernel.org, kuba@kernel.org, davem@davemloft.net,
	edumazet@google.com, pabeni@redhat.com,
	skhan@linuxfoundation.org
Subject: Re: [PATCH net-next 1/3] net: use netdev_unregistering instead of open code
Date: Mon, 26 Sep 2022 10:19:40 +0200	[thread overview]
Message-ID: <YzFgnIUFy49QX2b6@corigine.com> (raw)
In-Reply-To: <CAK+SQuRj=caHiyrtVySVoxRrhNttfg_cSbNFjG2PL7Fc0_ObGg@mail.gmail.com>

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.

  reply	other threads:[~2022-09-26  8:20 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-23 16:09 [PATCH net-next 1/3] net: use netdev_unregistering instead of open code Juhee Kang
2022-09-23 16:09 ` [PATCH net-next 2/3] ethtool: " Juhee Kang
2022-09-26  7:45   ` Simon Horman
2022-09-23 16:09 ` [PATCH net-next 3/3] nfp: abm: " Juhee Kang
2022-09-26  7:48   ` Simon Horman
2022-09-26  7:44 ` [PATCH net-next 1/3] net: " Simon Horman
2022-09-26  8:05   ` Juhee Kang
2022-09-26  8:19     ` Simon Horman [this message]
2022-09-26  8:25       ` Juhee Kang
2022-09-26  8:27         ` Simon Horman
2022-09-26  8:29           ` Juhee Kang
2022-09-26 17:04             ` Jakub Kicinski
2022-09-26 17:45               ` Jakub Kicinski
2022-09-28 14:57                 ` Juhee Kang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YzFgnIUFy49QX2b6@corigine.com \
    --to=simon.horman@corigine.com \
    --cc=claudiajkang@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=skhan@linuxfoundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.