]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
hv_netvsc: Fix the TX/RX buffer default sizes
authorHaiyang Zhang <haiyangz@microsoft.com>
Mon, 11 Dec 2017 16:56:58 +0000 (08:56 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 24 Mar 2018 10:02:45 +0000 (11:02 +0100)
commitdf365ce541c4c3887b165ee5c071bf51cb1e8577
tree5c4841d3db63269339b292cb2cd91990bb3f0c55
parent8fbec85ecd008668a91f5331e6131c2fd05a937a
hv_netvsc: Fix the TX/RX buffer default sizes

[ Upstream commit 41f61db2cd24d5ad802386719cccde1479aa82a6 ]

The values were not computed correctly. There are no significant
visible impact, though.

The intended size of RX buffer is 16 MB, and the default slot size is 1728.
So, NETVSC_DEFAULT_RX should be 16*1024*1024 / 1728 = 9709.

The intended size of TX buffer is 1 MB, and the slot size is 6144.
So, NETVSC_DEFAULT_TX should be 1024*1024 / 6144 = 170.

The patch puts the formula directly into the macro, and moves them to
hyperv_net.h, together with related macros.

Fixes: 5023a6db73196 ("netvsc: increase default receive buffer size")
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/hyperv/hyperv_net.h
drivers/net/hyperv/netvsc_drv.c