linux/drivers
Rafał Miłecki 752e5fcc2e bgmac: reduce max frame size to support just MTU 1500
bgmac allocates new replacement buffer before handling each received
frame. Allocating & DMA-preparing 9724 B each time consumes a lot of CPU
time. Ideally bgmac should just respect currently set MTU but it isn't
the case right now. For now just revert back to the old limited frame
size.

This change bumps NAT masquerade speed by ~95%.

Since commit 8218f62c9c ("mm: page_frag: use initial zero offset for
page_frag_alloc_align()"), the bgmac driver fails to open its network
interface successfully and runs out of memory in the following call
stack:

bgmac_open
  -> bgmac_dma_init
    -> bgmac_dma_rx_skb_for_slot
      -> netdev_alloc_frag

BGMAC_RX_ALLOC_SIZE = 10048 and PAGE_FRAG_CACHE_MAX_SIZE = 32768.

Eventually we land into __page_frag_alloc_align() with the following
parameters across multiple successive calls:

__page_frag_alloc_align: fragsz=10048, align_mask=-1, size=32768, offset=0
__page_frag_alloc_align: fragsz=10048, align_mask=-1, size=32768, offset=10048
__page_frag_alloc_align: fragsz=10048, align_mask=-1, size=32768, offset=20096
__page_frag_alloc_align: fragsz=10048, align_mask=-1, size=32768, offset=30144

So in that case we do indeed have offset + fragsz (40192) > size (32768)
and so we would eventually return NULL. Reverting to the older 1500
bytes MTU allows the network driver to be usable again.

Fixes: 8c7da63978 ("bgmac: configure MTU and add support for frames beyond 8192 byte size")
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
[florian: expand commit message about recent commits]
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
Link: https://patch.msgid.link/20250127175159.1788246-1-florian.fainelli@broadcom.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-01-29 18:57:42 -08:00
..
accel
accessibility
acpi - Remove the less generic CPU matching infra around struct x86_cpu_desc and 2025-01-21 09:30:59 -08:00
amba
android
ata
atm
auxdisplay
base
bcma
block for-6.14/block-20250118 2025-01-20 19:38:46 -08:00
bluetooth Bluetooth: qca: Fix poor RF performance for WCN6855 2025-01-15 10:37:23 -05:00
bus
cache
cdrom for-6.14/block-20250118 2025-01-20 19:38:46 -08:00
cdx
char
clk
clocksource
comedi
connector
counter
cpufreq Kthreads affinity follow either of 4 existing different patterns: 2025-01-21 17:10:05 -08:00
cpuidle
crypto kernel-6.14-rc1.cred 2025-01-20 10:13:06 -08:00
cxl
dax
dca
devfreq
dio
dma - Remove the less generic CPU matching infra around struct x86_cpu_desc and 2025-01-21 09:30:59 -08:00
dma-buf
dpll
edac - The first part of a restructuring of AMD's representation of a northbridge 2025-01-21 09:38:52 -08:00
eisa
extcon
firewire
firmware chrome-platform-firmware: Updates for v6.14 2025-01-21 19:51:28 -08:00
fpga
fsi
gnss
gpio
gpu Rust changes for v6.14 2025-01-21 17:48:03 -08:00
greybus
hid
hsi
hte
hv
hwmon - The first part of a restructuring of AMD's representation of a northbridge 2025-01-21 09:38:52 -08:00
hwspinlock
hwtracing
i2c i2c: testunit: on errors, repeat NACK until STOP 2025-01-15 19:44:21 +01:00
i3c
idle
iio
infiniband
input
interconnect
iommu Updates for the interrupt subsystem: 2025-01-21 13:51:07 -08:00
ipack
irqchip Updates for the interrupt subsystem: 2025-01-21 13:51:07 -08:00
isdn
leds
macintosh powerpc updates for 6.14 2025-01-20 21:40:19 -08:00
mailbox
mcb
md for-6.14/block-20250118 2025-01-20 19:38:46 -08:00
media Kthreads affinity follow either of 4 existing different patterns: 2025-01-21 17:10:05 -08:00
memory
memstick
message
mfd
misc powerpc updates for 6.14 2025-01-20 21:40:19 -08:00
mmc for-6.14/block-20250118 2025-01-20 19:38:46 -08:00
most
mtd for-6.14/block-20250118 2025-01-20 19:38:46 -08:00
mux
net bgmac: reduce max frame size to support just MTU 1500 2025-01-29 18:57:42 -08:00
nfc nfc: mrvl: Don't use "proxy" headers 2025-01-18 17:10:05 -08:00
ntb
nubus
nvdimm
nvme for-6.14/io_uring-20250119 2025-01-20 20:27:33 -08:00
nvmem
of Devicetree fixes for 6.13, part 2: 2025-01-17 15:01:24 -08:00
opp
parisc
parport
pci Updates for the interrupt subsystem: 2025-01-21 13:51:07 -08:00
pcmcia
peci
perf arm64 updates for 6.14 2025-01-20 21:21:49 -08:00
phy
pinctrl
platform chrome-platform: Updates for v6.14 2025-01-21 19:48:29 -08:00
pmdomain pmdomain: imx8mp-blk-ctrl: add missing loop break condition 2025-01-16 16:10:32 +01:00
pnp
power
powercap
pps
ps3
ptp ptp: Properly handle compat ioctls 2025-01-28 12:01:26 +01:00
pwm
rapidio
ras
regulator
remoteproc
reset Reset controller fixes for v6.13 2025-01-15 14:58:22 +01:00
rpmsg
rtc
s390 s390 updates for 6.14 merge window 2025-01-20 21:14:49 -08:00
sbus
scsi powerpc updates for 6.14 2025-01-20 21:40:19 -08:00
sh
siox
slimbus
soc
soundwire
spi Kthreads affinity follow either of 4 existing different patterns: 2025-01-21 17:10:05 -08:00
spmi
ssb
staging Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2025-01-16 10:34:59 -08:00
target
tc
tee
thermal
thunderbolt
tty
ufs for-6.14/block-20250118 2025-01-20 19:38:46 -08:00
uio
usb Kthreads affinity follow either of 4 existing different patterns: 2025-01-21 17:10:05 -08:00
vdpa Networking changes for 6.14. 2025-01-22 08:28:57 -08:00
vfio
vhost
video
virt - A segmented Reverse Map table (RMP) is a across-nodes distributed 2025-01-21 09:00:31 -08:00
virtio
w1
watchdog Kthreads affinity follow either of 4 existing different patterns: 2025-01-21 17:10:05 -08:00
xen Updates for the interrupt subsystem: 2025-01-21 13:51:07 -08:00
zorro
Kconfig
Makefile