From: Jakub Kicinski <kuba@kernel.org>
To: <edward.cree@amd.com>
Cc: <linux-net-drivers@amd.com>, <davem@davemloft.net>,
<pabeni@redhat.com>, <edumazet@google.com>,
Edward Cree <ecree.xilinx@gmail.com>, <netdev@vger.kernel.org>,
<habetsm.xilinx@gmail.com>, <sudheer.mogilappagari@intel.com>
Subject: Re: [RFC PATCH v2 net-next 3/7] net: ethtool: record custom RSS contexts in the IDR
Date: Wed, 12 Apr 2023 18:49:27 -0700 [thread overview]
Message-ID: <20230412184927.63800565@kernel.org> (raw)
In-Reply-To: <5ac2860f8936b95cf873b6dcfd624c530a83ff2d.1681236653.git.ecree.xilinx@gmail.com>
On Tue, 11 Apr 2023 19:26:11 +0100 edward.cree@amd.com wrote:
> if (rxfh.rss_context)
> ret = ops->set_rxfh_context(dev, indir, hkey, rxfh.hfunc,
> &rxfh.rss_context, delete);
> @@ -1350,6 +1377,40 @@ static noinline_for_stack int ethtool_set_rxfh(struct net_device *dev,
> else if (rxfh.indir_size != ETH_RXFH_INDIR_NO_CHANGE)
> dev->priv_flags |= IFF_RXFH_CONFIGURED;
> }
This is probably transient but I think we're potentially leaking @ctx
in a goto out hiding inside the context here, and...
> + /* Update rss_ctx tracking */
> + if (create) {
> + /* Ideally this should happen before calling the driver,
> + * so that we can fail more cleanly; but we don't have the
> + * context ID until the driver picks it, so we have to
> + * wait until after.
> + */
> + if (WARN_ON(idr_find(&dev->ethtool->rss_ctx, rxfh.rss_context)))
> + /* context ID reused, our tracking is screwed */
> + goto out;
here.
next prev parent reply other threads:[~2023-04-13 1:50 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-11 18:26 [RFC PATCH v2 net-next 0/7] ethtool: track custom RSS contexts in the core edward.cree
2023-04-11 18:26 ` [RFC PATCH v2 net-next 1/7] net: move ethtool-related netdev state into its own struct edward.cree
2023-04-11 20:37 ` Andrew Lunn
2023-04-13 1:36 ` Jakub Kicinski
2023-04-11 18:26 ` [RFC PATCH v2 net-next 2/7] net: ethtool: attach an IDR of custom RSS contexts to a netdevice edward.cree
2023-04-11 20:36 ` Andrew Lunn
2023-04-12 15:52 ` Edward Cree
2023-04-13 1:39 ` Jakub Kicinski
2023-04-11 18:26 ` [RFC PATCH v2 net-next 3/7] net: ethtool: record custom RSS contexts in the IDR edward.cree
2023-04-13 1:49 ` Jakub Kicinski [this message]
2023-06-09 20:01 ` Edward Cree
2023-04-11 18:26 ` [RFC PATCH v2 net-next 4/7] net: ethtool: let the core choose RSS context IDs edward.cree
2023-04-13 1:53 ` Jakub Kicinski
2023-04-11 18:26 ` [RFC PATCH v2 net-next 5/7] net: ethtool: add an extack parameter to new rxfh_context APIs edward.cree
2023-04-11 18:26 ` [RFC PATCH v2 net-next 6/7] net: ethtool: add a mutex protecting RSS contexts edward.cree
2023-04-11 20:40 ` Andrew Lunn
2023-04-12 16:16 ` Edward Cree
2023-04-12 17:15 ` Andrew Lunn
2023-04-12 17:42 ` Edward Cree
2023-04-13 2:06 ` Jakub Kicinski
2023-04-13 21:52 ` Edward Cree
2023-04-13 21:58 ` Andrew Lunn
2023-04-14 20:20 ` Edward Cree
2023-04-11 18:26 ` [RFC PATCH v2 net-next 7/7] sfc: use new rxfh_context API edward.cree
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=20230412184927.63800565@kernel.org \
--to=kuba@kernel.org \
--cc=davem@davemloft.net \
--cc=ecree.xilinx@gmail.com \
--cc=edumazet@google.com \
--cc=edward.cree@amd.com \
--cc=habetsm.xilinx@gmail.com \
--cc=linux-net-drivers@amd.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sudheer.mogilappagari@intel.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).