diff options
author | Alex Ng <alexng@microsoft.com> | 2017-09-20 21:17:35 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-09-22 01:17:16 +0300 |
commit | 0ab09befdbb7ca9b969d6206108629ddff43876e (patch) | |
tree | 1ba553b80649944a6def37747278778c3902e26a /drivers/net/hyperv/hyperv_net.h | |
parent | fe2502e49b58606580c77b3d84e42f946de182d8 (diff) | |
download | linux-0ab09befdbb7ca9b969d6206108629ddff43876e.tar.xz |
hv_netvsc: fix send buffer failure on MTU change
If MTU is changed the host would reject the send buffer change.
This problem is result of recent change to allow changing send
buffer size.
Every time we change the MTU, we store the previous net_device section
count before destroying the buffer, but we don’t store the previous
section size. When we reinitialize the buffer, its size is calculated
by multiplying the previous count and previous size. Since we
continuously increase the MTU, the host returns us a decreasing count
value while the section size is reinitialized to 1728 bytes every
time.
This eventually leads to a condition where the calculated buf_size is
so small that the host rejects it.
Fixes: 8b5327975ae1 ("netvsc: allow controlling send/recv buffer size")
Signed-off-by: Alex Ng <alexng@microsoft.com>
Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/hyperv/hyperv_net.h')
-rw-r--r-- | drivers/net/hyperv/hyperv_net.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/hyperv/hyperv_net.h b/drivers/net/hyperv/hyperv_net.h index d98cdfb1536b..5176be76ca7d 100644 --- a/drivers/net/hyperv/hyperv_net.h +++ b/drivers/net/hyperv/hyperv_net.h @@ -150,6 +150,8 @@ struct netvsc_device_info { u32 num_chn; u32 send_sections; u32 recv_sections; + u32 send_section_size; + u32 recv_section_size; }; enum rndis_device_state { |