All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Eric Dumazet <edumazet@google.com>
Cc: Eric Dumazet <eric.dumazet@gmail.com>,
	"David S . Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, netdev <netdev@vger.kernel.org>
Subject: Re: [PATCH net-next 11/13] netlink: add net device refcount tracker to struct ethnl_req_info
Date: Tue, 04 Jan 2022 17:23:51 +0100	[thread overview]
Message-ID: <e2f0315e65052b7ff798e61100a02f624a609afb.camel@sipsolutions.net> (raw)
In-Reply-To: <CANn89iLYo8XQbKGxT=pKQepe8FeELx0pnpMWjKS8n93uHwNJ5Q@mail.gmail.com>

On Tue, 2022-01-04 at 08:22 -0800, Eric Dumazet wrote:
> On Tue, Jan 4, 2022 at 8:07 AM Johannes Berg <johannes@sipsolutions.net> wrote:
> > 
> > Hi Eric,
> > 
> > > > > @@ -624,6 +625,7 @@ static void ethnl_default_notify(struct net_device *dev, unsigned int cmd,
> > > > >       }
> > > > > 
> > > > >       req_info->dev = dev;
> > > > > +     netdev_tracker_alloc(dev, &req_info->dev_tracker, GFP_KERNEL);
> > > > >       req_info->flags |= ETHTOOL_FLAG_COMPACT_BITSETS;
> > > > > 
> > > > 
> > > > I may have missed a follow-up patch (did a search on netdev now, but
> > > > ...), but I'm hitting warnings from this and I'm not sure it's right?
> > > > 
> > > > This req_info is just allocated briefly and freed again, and I'm not
> > > > even sure there's a dev_get/dev_put involved here, I didn't see any?
> > > 
> > > We had a fix.
> > > 
> > > commit 34ac17ecbf575eb079094d44f1bd30c66897aa21
> > > Author: Eric Dumazet <edumazet@google.com>
> > > Date:   Tue Dec 14 00:42:30 2021 -0800
> > > 
> > >     ethtool: use ethnl_parse_header_dev_put()
> > > 
> > 
> > Hmm. I have this in my tree, and I don't think it affected
> > ethnl_default_notify() anyway?
> 
> Strange, syzbot have not reported anything there.

:)

Not sure - I'm hitting it in one of the wireless bridging tests.

> 
> ethnl_parse_header_dev_get() needs to take a ref, but
> indeed ethnl_default_notify() does its own allocation/freeing.

Right.

> diff --git a/net/ethtool/netlink.c b/net/ethtool/netlink.c
> index ea23659fab28..5fe8f4ae2ceb 100644
> --- a/net/ethtool/netlink.c
> +++ b/net/ethtool/netlink.c
> @@ -627,7 +627,6 @@ static void ethnl_default_notify(struct net_device
> *dev, unsigned int cmd,
>         }
> 
>         req_info->dev = dev;
> -       netdev_tracker_alloc(dev, &req_info->dev_tracker, GFP_KERNEL);

So I had already tested both this and explicitly doing
netdev_tracker_free() when req_info is freed, both work fine.

Tested-by: Johannes Berg <johannes@sipsolutions.net>

Just wasn't sure it was correct or I was missing something. :)

johannes

  reply	other threads:[~2022-01-04 16:23 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-07  1:30 [PATCH net-next 00/13] net: second round of netdevice refcount tracking Eric Dumazet
2021-12-07  1:30 ` [PATCH net-next 01/13] net: eql: add net device refcount tracker Eric Dumazet
2021-12-07  1:30 ` [PATCH net-next 02/13] vlan: " Eric Dumazet
2021-12-07  1:30 ` [PATCH net-next 03/13] net: bridge: " Eric Dumazet
2021-12-07  1:30 ` [PATCH net-next 04/13] net: watchdog: " Eric Dumazet
2021-12-07  1:30 ` [PATCH net-next 05/13] net: switchdev: " Eric Dumazet
2021-12-07  1:30 ` [PATCH net-next 06/13] inet: add net device refcount tracker to struct fib_nh_common Eric Dumazet
2021-12-07  1:30 ` [PATCH net-next 07/13] ax25: add net device refcount tracker Eric Dumazet
2021-12-07  1:30 ` [PATCH net-next 08/13] llc: " Eric Dumazet
2021-12-07  1:30 ` [PATCH net-next 09/13] pktgen " Eric Dumazet
2021-12-07  1:30 ` [PATCH net-next 10/13] net/smc: add net device tracker to struct smc_pnetentry Eric Dumazet
2021-12-09  8:05   ` Karsten Graul
2021-12-07  1:30 ` [PATCH net-next 11/13] netlink: add net device refcount tracker to struct ethnl_req_info Eric Dumazet
2022-01-04 15:29   ` Johannes Berg
2022-01-04 15:44     ` Eric Dumazet
2022-01-04 16:07       ` Johannes Berg
2022-01-04 16:22         ` Eric Dumazet
2022-01-04 16:23           ` Johannes Berg [this message]
2022-01-05 16:57             ` Jakub Kicinski
2022-01-05 16:58               ` Eric Dumazet
2021-12-07  1:30 ` [PATCH net-next 12/13] openvswitch: add net device refcount tracker to struct vport Eric Dumazet
2021-12-07  1:30 ` [PATCH net-next 13/13] net: sched: act_mirred: add net device refcount tracker Eric Dumazet
2021-12-08  5:20 ` [PATCH net-next 00/13] net: second round of netdevice refcount tracking patchwork-bot+netdevbpf

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=e2f0315e65052b7ff798e61100a02f624a609afb.camel@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=eric.dumazet@gmail.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.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.