hv_netvsc: Fix unwanted rx_table reset
authorHaiyang Zhang <haiyangz@microsoft.com>
Fri, 20 Dec 2019 02:28:10 +0000 (18:28 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 12 Jan 2020 11:17:23 +0000 (12:17 +0100)
commit24fc85b5f5b6dec6f54a19c0295bac477125c88c
tree9e1c1a845c4d882a63411dd40807de768fe5829a
parentfc95d2b0d4ee599147e1897ed6e5168bacb0ada0
hv_netvsc: Fix unwanted rx_table reset

[ Upstream commit b0689faa8efc5a3391402d7ae93bd373b7248e51 ]

In existing code, the receive indirection table, rx_table, is in
struct rndis_device, which will be reset when changing MTU, ringparam,
etc. User configured receive indirection table values will be lost.

To fix this, move rx_table to struct net_device_context, and check
netif_is_rxfh_configured(), so rx_table will be set to default only
if no user configured value.

Fixes: ff4a44199012 ("netvsc: allow get/set of RSS indirection table")
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/hyperv/hyperv_net.h
drivers/net/hyperv/netvsc_drv.c
drivers/net/hyperv/rndis_filter.c