linux/drivers/net
Michael Kelley 6941f67ad3 hv_netvsc: Calculate correct ring size when PAGE_SIZE is not 4 Kbytes
Current code in netvsc_drv_init() incorrectly assumes that PAGE_SIZE
is 4 Kbytes, which is wrong on ARM64 with 16K or 64K page size. As a
result, the default VMBus ring buffer size on ARM64 with 64K page size
is 8 Mbytes instead of the expected 512 Kbytes. While this doesn't break
anything, a typical VM with 8 vCPUs and 8 netvsc channels wastes 120
Mbytes (8 channels * 2 ring buffers/channel * 7.5 Mbytes/ring buffer).

Unfortunately, the module parameter specifying the ring buffer size
is in units of 4 Kbyte pages. Ideally, it should be in units that
are independent of PAGE_SIZE, but backwards compatibility prevents
changing that now.

Fix this by having netvsc_drv_init() hardcode 4096 instead of using
PAGE_SIZE when calculating the ring buffer size in bytes. Also
use the VMBUS_RING_SIZE macro to ensure proper alignment when running
with page size larger than 4K.

Cc: <stable@vger.kernel.org> # 5.15.x
Fixes: 7aff79e297 ("Drivers: hv: Enable Hyper-V code to be built on ARM64")
Signed-off-by: Michael Kelley <mhklinux@outlook.com>
Link: https://lore.kernel.org/r/20240122162028.348885-1-mhklinux@outlook.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2024-01-23 17:19:42 -08:00
..
arcnet arcnet: restoring support for multiple Sohard Arcnet cards 2023-12-04 18:01:20 -08:00
bonding
caif
can USB: core: Use device_driver directly in struct usb_driver and usb_device_driver 2024-01-04 16:06:32 +01:00
dsa net: dsa: vsc73xx: Add null pointer check to vsc73xx_gpio_probe 2024-01-16 17:48:27 -08:00
ethernet idpf: distinguish vports by the dev_port attribute 2024-01-21 18:11:09 +00:00
fddi
fjes net: fjes: Convert to platform remove callback returning void 2023-12-05 19:51:09 -08:00
hamradio
hippi
hyperv hv_netvsc: Calculate correct ring size when PAGE_SIZE is not 4 Kbytes 2024-01-23 17:19:42 -08:00
ieee802154
ipa net: ipa: Convert to platform remove callback returning void 2023-12-05 19:51:09 -08:00
ipvlan ipvlan: Remove usage of the deprecated ida_simple_xx() API 2024-01-07 22:32:48 +00:00
mctp
mdio net: mdio: mux-bcm-iproc: Use alignment helpers and SZ_4K 2024-01-03 16:40:59 -08:00
netdevsim net: netdevsim: don't try to destroy PHC on VFs 2024-01-17 10:56:44 +00:00
pcs net: pcs: rzn1-miic: Convert to platform remove callback returning void 2023-12-05 19:51:09 -08:00
phy net: micrel: Fix PTP frame parsing for lan8814 2024-01-22 11:02:23 +00:00
plip
ppp ppp: Fix spelling typo in comment in ppp_async_encode() 2024-01-02 16:26:09 -08:00
pse-pd
slip net: fill in MODULE_DESCRIPTION()s for SLIP 2024-01-11 16:16:08 -08:00
team team: Fix use-after-free when an option instance allocation fails 2023-12-08 10:45:49 -08:00
thunderbolt
usb USB / Thunderbolt changes for 6.8-rc1 2024-01-18 11:43:55 -08:00
vmxnet3 net: ethtool: pass a pointer to parameters to get/set_rxfh ethtool ops 2023-12-13 22:07:16 -08:00
vxlan vxlan: mdb: Add MDB bulk deletion support 2023-12-20 11:27:21 +00:00
wan net: fill in MODULE_DESCRIPTION()s for ds26522 module 2024-01-11 16:16:08 -08:00
wireguard
wireless wireless fixes for v6.8-rc2 2024-01-23 08:38:13 -08:00
wwan net: wwan: qcom_bam_dmux: Convert to platform remove callback returning void 2023-12-05 19:54:44 -08:00
xen-netback
Kconfig virtio-net: support rx netdim 2023-12-13 12:49:05 +00:00
LICENSE.SRC
Makefile
Space.c
amt.c amt: do not use overwrapped cb area 2024-01-11 16:55:17 -08:00
bareudp.c
dummy.c
eql.c
geneve.c geneve: use DEV_STATS_INC() 2024-01-05 19:07:18 -08:00
gtp.c
ifb.c
loopback.c
macsec.c Revert "net: macsec: use skb_ensure_writable_head_tail to expand the skb" 2024-01-23 17:17:04 -08:00
macvlan.c macvlan: implement .parse_protocol hook function in macvlan_hard_header_ops 2023-12-05 13:41:48 +01:00
macvtap.c
mdio.c
mhi_net.c
mii.c
net_failover.c
netconsole.c
netkit.c
nlmon.c
ntb_netdev.c
rionet.c
sb1000.c
sungem_phy.c
tap.c
tun.c tun: add missing rx stats accounting in tun_xdp_act 2024-01-22 10:58:04 +00:00
veth.c netdev 2023-12-18 16:46:08 -08:00
virtio_net.c virtio_net: Fix "‘%d’ directive writing between 1 and 11 bytes into a region of size 10" warnings 2024-01-11 16:54:34 -08:00
vrf.c
vsockmon.c
xen-netfront.c