From: Simon Horman <horms@kernel.org>
To: Jeroen de Borst <jeroendb@google.com>
Cc: netdev@vger.kernel.org, davem@davemloft.net, edumazet@google.com,
kuba@kernel.org, pabeni@redhat.com, pkaligineedi@google.com,
shailend@google.com, andrew+netdev@lunn.ch, willemb@google.com,
hramamurthy@google.com, ziweixiao@google.com,
linux-kernel@vger.kernel.org,
Jeroen de Borst <jeroend@google.com>
Subject: Re: [PATCH net-next v2] gve: Add RSS cache for non RSS device option scenario
Date: Wed, 5 Feb 2025 16:28:39 +0000 [thread overview]
Message-ID: <20250205162839.GH554665@kernel.org> (raw)
In-Reply-To: <20250204213121.14195-1-jeroendb@google.com>
On Tue, Feb 04, 2025 at 01:31:21PM -0800, Jeroen de Borst wrote:
> From: Ziwei Xiao <ziweixiao@google.com>
>
> Not all the devices have the capability for the driver to query for the
> registered RSS configuration. The driver can discover this by checking
> the relevant device option during setup. If it cannot, the driver needs
> to store the RSS config cache and directly return such cache when
> queried by the ethtool. RSS config is inited when driver probes. Also the
> default RSS config will be adjusted when there is RX queue count change.
>
> At this point, only keys of GVE_RSS_KEY_SIZE and indirection tables of
> GVE_RSS_INDIR_SIZE are supported.
>
> Signed-off-by: Ziwei Xiao <ziweixiao@google.com>
> Reviewed-by: Harshitha Ramamurthy <hramamurthy@google.com>
> Reviewed-by: Willem de Bruijn <willemb@google.com>
> Signed-off-by: Praveen Kaligineedi <pkaligineedi@google.com>
> Signed-off-by: Jeroen de Borst <jeroend@google.com>
> ---
> Changes in v2:
> - Change to initialize RSS config when the driver is up instead of
> doing that when the user setting the RSS.(Jakub Kicinski)
> - Use NL_SET_ERR_MSG_MOD to log errors when there is extack
> available.(Jakub Kicinski)
> - Use ethtool_rxfh_indir_default to set default RSS indir
> table.(Jakub Kicinski)
> - Adjust the default RSS config when there is RX queue count change to
> ensure the default RSS config is correct.
>
> drivers/net/ethernet/google/gve/gve.h | 16 +++-
> drivers/net/ethernet/google/gve/gve_adminq.c | 64 ++++++++++---
> drivers/net/ethernet/google/gve/gve_ethtool.c | 60 ++++++++++--
> drivers/net/ethernet/google/gve/gve_main.c | 92 ++++++++++++++++++-
> 4 files changed, 209 insertions(+), 23 deletions(-)
...
> diff --git a/drivers/net/ethernet/google/gve/gve_ethtool.c b/drivers/net/ethernet/google/gve/gve_ethtool.c
> index bdfc6e77b2af..efcafc607b2a 100644
> --- a/drivers/net/ethernet/google/gve/gve_ethtool.c
> +++ b/drivers/net/ethernet/google/gve/gve_ethtool.c
> @@ -482,6 +482,7 @@ static int gve_set_channels(struct net_device *netdev,
> struct ethtool_channels old_settings;
> int new_tx = cmd->tx_count;
> int new_rx = cmd->rx_count;
> + bool reset_rss;
>
> gve_get_channels(netdev, &old_settings);
>
> @@ -498,16 +499,14 @@ static int gve_set_channels(struct net_device *netdev,
> return -EINVAL;
> }
>
> - if (!netif_running(netdev)) {
> - priv->tx_cfg.num_queues = new_tx;
> - priv->rx_cfg.num_queues = new_rx;
> - return 0;
> - }
> + if (new_rx != priv->rx_cfg.num_queues &&
> + priv->cache_rss_config && !netif_is_rxfh_configured(netdev))
> + reset_rss = true;
Hi Jerome,
This is not a full review (which I was working on but ran out of time for now).
But, if the condition above is not met then reset_rss will be used
uninitialised below.
Flagged by W=1 build with clang-19.
>
> new_tx_cfg.num_queues = new_tx;
> new_rx_cfg.num_queues = new_rx;
>
> - return gve_adjust_queues(priv, new_rx_cfg, new_tx_cfg);
> + return gve_adjust_queues(priv, new_rx_cfg, new_tx_cfg, reset_rss);
> }
>
> static void gve_get_ringparam(struct net_device *netdev,
...
--
pw-bot: cr
next prev parent reply other threads:[~2025-02-05 16:28 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-04 21:31 [PATCH net-next v2] gve: Add RSS cache for non RSS device option scenario Jeroen de Borst
2025-02-05 16:28 ` Simon Horman [this message]
2025-02-06 6:26 ` Ziwei Xiao
2025-02-05 16:52 ` Kalesh Anakkur Purayil
2025-02-06 6:34 ` Ziwei Xiao
2025-02-06 10:39 ` kernel test robot
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=20250205162839.GH554665@kernel.org \
--to=horms@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hramamurthy@google.com \
--cc=jeroend@google.com \
--cc=jeroendb@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=pkaligineedi@google.com \
--cc=shailend@google.com \
--cc=willemb@google.com \
--cc=ziweixiao@google.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).