]> git.baikalelectronics.ru Git - kernel.git/commit
hv_netvsc: Fix send_table offset in case of a host bug
authorHaiyang Zhang <haiyangz@microsoft.com>
Thu, 21 Nov 2019 21:33:41 +0000 (13:33 -0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 22 Nov 2019 03:32:23 +0000 (19:32 -0800)
commitf631d3aefeea6dfbd4bb20bf692a8421fd34851a
tree544057c255e6c133eb3e8eace0db26bcbc465f9a
parent3e44a7b7d04c94ff87bf8416d7cd6a1b7ac40c17
hv_netvsc: Fix send_table offset in case of a host bug

If negotiated NVSP version <= NVSP_PROTOCOL_VERSION_6, the offset may
be wrong (too small) due to a host bug. This can cause missing the
end of the send indirection table, and add multiple zero entries from
leading zeros before the data region. This bug adds extra burden on
channel 0.

So fix the offset by computing it from the data structure sizes. This
will ensure netvsc driver runs normally on unfixed hosts, and future
fixed hosts.

Fixes: 4e1a3fac8d06 ("hyperv: Add support for virtual Receive Side Scaling (vRSS)")
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/hyperv/netvsc.c