linux/drivers
Alexander Lobakin aa1d3faf71 ice: Robustify cleaning/completing XDP Tx buffers
When queueing frames from a Page Pool for redirecting to a device backed
by the ice driver, `perf top` shows heavy load on page_alloc() and
page_frag_free(), despite that on a properly working system it must be
fully or at least almost zero-alloc. The problem is in fact a bit deeper
and raises from how ice cleans up completed Tx buffers.

The story so far: when cleaning/freeing the resources related to
a particular completed Tx frame (skbs, DMA mappings etc.), ice uses some
heuristics only without setting any type explicitly (except for dummy
Flow Director packets, which are marked via ice_tx_buf::tx_flags).
This kinda works, but only up to some point. For example, currently ice
assumes that each frame coming to __ice_xmit_xdp_ring(), is backed by
either plain order-0 page or plain page frag, while it may also be
backed by Page Pool or any other possible memory models introduced in
future. This means any &xdp_frame must be freed properly via
xdp_return_frame() family with no assumptions.

In order to do that, the whole heuristics must be replaced with setting
the Tx buffer/frame type explicitly, just how it's always been done via
an enum. Let us reuse 16 bits from ::tx_flags -- 1 bit-and instr won't
hurt much -- especially given that sometimes there was a check for
%ICE_TX_FLAGS_DUMMY_PKT, which is now turned from a flag to an enum
member. The rest of the changes is straightforward and most of it is
just a conversion to rely now on the type set in &ice_tx_buf rather than
to some secondary properties.
For now, no functional changes intended, the change only prepares the
ground for starting freeing XDP frames properly next step. And it must
be done atomically/synchronously to not break stuff.

Signed-off-by: Alexander Lobakin <alexandr.lobakin@intel.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Link: https://lore.kernel.org/bpf/20230210170618.1973430-5-alexandr.lobakin@intel.com
2023-02-13 19:13:12 +01:00
..
accel
accessibility
acpi
amba
android
ata ata: libata: Fix sata_down_spd_limit() when no link speed is reported 2023-02-02 20:26:45 +09:00
atm
auxdisplay
base
bcma
block block-6.2-2023-02-03 2023-02-03 11:35:42 -08:00
bluetooth
bus
cdrom
char
clk
clocksource
comedi
connector
counter
cpufreq
cpuidle
crypto
cxl
dax
dca
devfreq
dio
dma
dma-buf
edac
eisa
extcon
firewire
firmware Batch #3 of EFI fixes for v6.2 2023-02-03 10:25:41 -08:00
fpga
fsi
gnss
gpio
gpu drm fixes for 6.2-rc7 2023-02-03 10:09:55 -08:00
greybus
hid for-linus-2023020901 2023-02-09 09:09:13 -08:00
hsi
hte
hv HV: hv_balloon: fix memory leak with using debugfs_lookup() 2023-02-03 07:45:18 +01:00
hwmon
hwspinlock
hwtracing
i2c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2023-02-02 14:49:55 -08:00
i3c
idle
iio
infiniband mlx5-next-netdev-deadlock 2023-02-08 21:01:17 -08:00
input
interconnect
iommu
ipack
irqchip
isdn
leds
macintosh
mailbox
mcb
md
media
memory
memstick
message
mfd mfd: ocelot: add external ocelot switch control 2023-01-30 21:07:21 -08:00
misc
mmc
most
mtd
mux
net ice: Robustify cleaning/completing XDP Tx buffers 2023-02-13 19:13:12 +01:00
nfc
ntb
nubus
nvdimm
nvme Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2023-02-09 12:25:40 -08:00
nvmem
of Devicetree fixes for v6.2, part 2: 2023-02-07 14:17:12 -08:00
opp
parisc
parport
pci
pcmcia
peci
perf
phy
pinctrl
platform platform/x86: touchscreen_dmi: Add Chuwi Vi8 (CWI501) DMI match 2023-02-02 11:34:38 +01:00
pnp
power
powercap
pps
ps3
ptp
pwm
rapidio
ras
regulator
remoteproc
reset
rpmsg
rtc
s390
sbus
scsi Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2023-02-02 14:49:55 -08:00
sh
siox
slimbus
soc
soundwire
spi
spmi
ssb
staging
target
tc
tee
thermal
thunderbolt
tty vc_screen: move load of struct vc_data pointer in vcs_read() to avoid UAF 2023-01-31 15:51:52 +01:00
ufs
uio
usb usb: typec: ucsi: Don't attempt to resume the ports before they exist 2023-02-02 11:27:28 +01:00
vdpa
vfio
vhost Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2023-02-02 14:49:55 -08:00
video fbdev updates for kernel 6.2-rc7: 2023-02-05 11:43:00 -08:00
virt
virtio
vlynq
w1
watchdog
xen
zorro
Kconfig
Makefile