From: Jakub Kicinski <jakub.kicinski@netronome.com>
To: Haiyang Zhang <haiyangz@microsoft.com>
Cc: sashal@kernel.org, linux-hyperv@vger.kernel.org,
netdev@vger.kernel.org, kys@microsoft.com,
sthemmin@microsoft.com, olaf@aepfle.de, vkuznets@redhat.com,
davem@davemloft.net, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2,net] hv_netvsc: Fix tx_table init in rndis_set_subchannel()
Date: Sat, 14 Dec 2019 11:30:25 -0800 [thread overview]
Message-ID: <20191214113025.363f21e2@cakuba.netronome.com> (raw)
In-Reply-To: <1576103187-2681-1-git-send-email-haiyangz@microsoft.com>
On Wed, 11 Dec 2019 14:26:27 -0800, Haiyang Zhang wrote:
> Host can provide send indirection table messages anytime after RSS is
> enabled by calling rndis_filter_set_rss_param(). So the host provided
> table values may be overwritten by the initialization in
> rndis_set_subchannel().
>
> To prevent this problem, move the tx_table initialization before calling
> rndis_filter_set_rss_param().
>
> Fixes: a6fb6aa3cfa9 ("hv_netvsc: Set tx_table to equal weight after subchannels open")
> Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Applied, but there are two more problems with this code:
- you should not reset the indirection table if it was configured by
the user to something other than the default (use the
netif_is_rxfh_configured() helper to check for that)
- you should use the ethtool_rxfh_indir_default() wrapper
Please fix the former problem in the net tree, and after net is merged
into linux/master and net-next in a week or two please follow up with
the fix for the latter for net-next.
> diff --git a/drivers/net/hyperv/rndis_filter.c b/drivers/net/hyperv/rndis_filter.c
> index 206b4e7..05bc5ec8 100644
> --- a/drivers/net/hyperv/rndis_filter.c
> +++ b/drivers/net/hyperv/rndis_filter.c
> @@ -1171,6 +1171,9 @@ int rndis_set_subchannel(struct net_device *ndev,
> wait_event(nvdev->subchan_open,
> atomic_read(&nvdev->open_chn) == nvdev->num_chn);
>
> + for (i = 0; i < VRSS_SEND_TAB_SIZE; i++)
> + ndev_ctx->tx_table[i] = i % nvdev->num_chn;
> +
> /* ignore failures from setting rss parameters, still have channels */
> if (dev_info)
> rndis_filter_set_rss_param(rdev, dev_info->rss_key);
> @@ -1180,9 +1183,6 @@ int rndis_set_subchannel(struct net_device *ndev,
> netif_set_real_num_tx_queues(ndev, nvdev->num_chn);
> netif_set_real_num_rx_queues(ndev, nvdev->num_chn);
>
> - for (i = 0; i < VRSS_SEND_TAB_SIZE; i++)
> - ndev_ctx->tx_table[i] = i % nvdev->num_chn;
> -
> return 0;
> }
>
next prev parent reply other threads:[~2019-12-14 19:30 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-11 22:26 [PATCH v2,net] hv_netvsc: Fix tx_table init in rndis_set_subchannel() Haiyang Zhang
2019-12-14 19:30 ` Jakub Kicinski [this message]
2019-12-15 16:38 ` Haiyang Zhang
2019-12-15 17:11 ` Stephen Hemminger
2019-12-15 18:52 ` Jakub Kicinski
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=20191214113025.363f21e2@cakuba.netronome.com \
--to=jakub.kicinski@netronome.com \
--cc=davem@davemloft.net \
--cc=haiyangz@microsoft.com \
--cc=kys@microsoft.com \
--cc=linux-hyperv@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=olaf@aepfle.de \
--cc=sashal@kernel.org \
--cc=sthemmin@microsoft.com \
--cc=vkuznets@redhat.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).