Linux-HyperV List
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Aditya Garg" <gargaditya@linux.microsoft.com>,
	linux-hyperv@vger.kernel.org
Subject: Re: [PATCH net v2] net: hv_netvsc: Preserve RSS indirection table across device recreation
Date: Fri, 04 Dec 2026 07:11:43 +0000	[thread overview]
Message-ID: <sashiko-outbox-249300@kernel.org> (raw)
In-Reply-To: <20261203071129.396360-1-gargaditya@linux.microsoft.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] net: hv_netvsc: zeroing rx_table and rss_key in
  netvsc_attach() breaks RSS
--

commit 9294af50c8f8757092c38dc965ae71d9b53d00c2
Author: Aditya Garg <gargaditya@linux.microsoft.com>

net: hv_netvsc: Preserve RSS indirection table across device recreation

This commit saves and restores user-configured RSS indirection tables
across RNDIS device recreation, notifies ethtool via
ethtool_rxfh_indir_lost() when a custom table cannot be restored, and
cleans up saved device info if detach fails during suspend.

> diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
> index 1d43c73fd73f1..4df17d7baa30c 100644
> --- a/drivers/net/hyperv/netvsc_drv.c
> +++ b/drivers/net/hyperv/netvsc_drv.c

[ ... ]

> @@ -1036,6 +1054,19 @@ static int netvsc_attach(struct net_device *ndev,
>  		if (ret) {
>  			nvdev->max_chn = 1;
>  			nvdev->num_chn = 1;
> +		} else {
> +			ret = rndis_filter_set_rss_param(nvdev->extension, dev_info->rss_key);
> +		}
> +
> +		if (ret) {
> +			netdev_err(ndev,
> +				   "unable to restore RSS parameters (ret %d).\n",
> +				   ret);
> +			/* Do not report the saved parameters as restored. */
> +			memset(ndev_ctx->rx_table, 0,
> +			       ndev_ctx->rx_table_sz * sizeof(*ndev_ctx->rx_table));
> +			memset(nvdev->extension->rss_key, 0, NETVSC_HASH_KEYLEN);
> +			rss_failed = true;
>  		}
>  	}

[Severity: Medium]
Can zeroing ndev_ctx->rx_table and nvdev->extension->rss_key here cause
later RSS updates or device recreations to silently collapse all RX
traffic onto a single queue?

rndis_set_rss_param_msg() always sends both ndc->rx_table and rss_key
to the host.  Since ethtool_rxfh_indir_lost() only signals a lost table,
a table-only netvsc_set_rxfh() reuses the zeroed rndis_dev->rss_key and
programs an all-zero Toeplitz key that steers all packets to rx_table[0].

Similarly, if rndis_filter_set_rss_param() fails after
rndis_set_subchannel() enabled multiple queues, a key-only
netvsc_set_rxfh() update programs the zeroed ndc->rx_table.  Later
recreations also copy the zeroed rss_key via netvsc_devinfo_get().

Tracking the unapplied RSS state separately, or falling back to
netvsc_hash_key and ethtool_rxfh_indir_default() when programming
omitted parameters or recreating the device, would keep netlink retries
working without programming all-zero RSS parameters.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261203071129.396360-1-gargaditya@linux.microsoft.com?part=1

      reply	other threads:[~2026-12-04  7:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-03  7:11 [PATCH net v2] net: hv_netvsc: Preserve RSS indirection table across device recreation Aditya Garg
2026-12-04  7:11 ` sashiko-bot [this message]

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=sashiko-outbox-249300@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=gargaditya@linux.microsoft.com \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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