hv_netvsc: Fix ethtool change hash key error
Hyper-V hosts require us to disable RSS before changing RSS key,
otherwise the changing request will fail. This patch fixes the
coding error.
Fixes: ff4a441990
("netvsc: allow get/set of RSS indirection table")
Reported-by: Wei Hu <weh@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Reviewed-by: Michael Kelley <mikelley@microsoft.com>
[sl: fix up subject line]
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
bfeffd1552
commit
b4a10c7504
|
@ -774,8 +774,8 @@ rndis_filter_set_offload_params(struct net_device *ndev,
|
|||
return ret;
|
||||
}
|
||||
|
||||
int rndis_filter_set_rss_param(struct rndis_device *rdev,
|
||||
const u8 *rss_key)
|
||||
static int rndis_set_rss_param_msg(struct rndis_device *rdev,
|
||||
const u8 *rss_key, u16 flag)
|
||||
{
|
||||
struct net_device *ndev = rdev->ndev;
|
||||
struct rndis_request *request;
|
||||
|
@ -804,7 +804,7 @@ int rndis_filter_set_rss_param(struct rndis_device *rdev,
|
|||
rssp->hdr.type = NDIS_OBJECT_TYPE_RSS_PARAMETERS;
|
||||
rssp->hdr.rev = NDIS_RECEIVE_SCALE_PARAMETERS_REVISION_2;
|
||||
rssp->hdr.size = sizeof(struct ndis_recv_scale_param);
|
||||
rssp->flag = 0;
|
||||
rssp->flag = flag;
|
||||
rssp->hashinfo = NDIS_HASH_FUNC_TOEPLITZ | NDIS_HASH_IPV4 |
|
||||
NDIS_HASH_TCP_IPV4 | NDIS_HASH_IPV6 |
|
||||
NDIS_HASH_TCP_IPV6;
|
||||
|
@ -829,9 +829,12 @@ int rndis_filter_set_rss_param(struct rndis_device *rdev,
|
|||
|
||||
wait_for_completion(&request->wait_event);
|
||||
set_complete = &request->response_msg.msg.set_complete;
|
||||
if (set_complete->status == RNDIS_STATUS_SUCCESS)
|
||||
memcpy(rdev->rss_key, rss_key, NETVSC_HASH_KEYLEN);
|
||||
else {
|
||||
if (set_complete->status == RNDIS_STATUS_SUCCESS) {
|
||||
if (!(flag & NDIS_RSS_PARAM_FLAG_DISABLE_RSS) &&
|
||||
!(flag & NDIS_RSS_PARAM_FLAG_HASH_KEY_UNCHANGED))
|
||||
memcpy(rdev->rss_key, rss_key, NETVSC_HASH_KEYLEN);
|
||||
|
||||
} else {
|
||||
netdev_err(ndev, "Fail to set RSS parameters:0x%x\n",
|
||||
set_complete->status);
|
||||
ret = -EINVAL;
|
||||
|
@ -842,6 +845,16 @@ int rndis_filter_set_rss_param(struct rndis_device *rdev,
|
|||
return ret;
|
||||
}
|
||||
|
||||
int rndis_filter_set_rss_param(struct rndis_device *rdev,
|
||||
const u8 *rss_key)
|
||||
{
|
||||
/* Disable RSS before change */
|
||||
rndis_set_rss_param_msg(rdev, rss_key,
|
||||
NDIS_RSS_PARAM_FLAG_DISABLE_RSS);
|
||||
|
||||
return rndis_set_rss_param_msg(rdev, rss_key, 0);
|
||||
}
|
||||
|
||||
static int rndis_filter_query_device_link_status(struct rndis_device *dev,
|
||||
struct netvsc_device *net_device)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue