]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
net: netkit: declare NETMEM_TX_NO_DMA mode
authorBobby Eshleman <bobbyeshleman@meta.com>
Thu, 14 May 2026 17:22:29 +0000 (10:22 -0700)
committerJakub Kicinski <kuba@kernel.org>
Tue, 19 May 2026 01:49:06 +0000 (18:49 -0700)
commit6ce2bb048055ee599c0f35f1a90ff5db29ba5d65
treeca5dee141cb5c9eff9a8f9a07b1ff22278bc3bb9
parent7d3ab852dcd853692197a830d20052127754a087
net: netkit: declare NETMEM_TX_NO_DMA mode

Some virtual devices like netkit (or ifb) never DMA and never touch frag
contents, they just forward the skb to another device. They are unable
to forward unreadable skbs, however, because they fail to pass TX
validation checks on dev->netmem_tx. The existing two-state
NETMEM_TX_NONE / NETMEM_TX_DMA doesn't give the TX validator enough
information to differentiate devices that will attempt DMA on the
unreadable skb from those that will simply route it untouched.

Add a third mode to the enum so drivers can indicate 1) if they have
netmem TX support, and 2) if they do, whether they are DMA-capable:

NETMEM_TX_NO_DMA - pass-through, device never DMAs

Widen dev->netmem_tx from a 1-bit field to 2 bits to fit the new value,
and declare netkit as NETMEM_TX_NO_DMA. Devmem TX support over these
devices comes in a follow-up patch.

Acked-by: Stanislav Fomichev <sdf@fomichev.me>
Signed-off-by: Bobby Eshleman <bobbyeshleman@meta.com>
Link: https://patch.msgid.link/20260514-tcp-dm-netkit-v5-2-408c59b91e66@meta.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Documentation/networking/net_cachelines/net_device.rst
Documentation/networking/netmem.rst
Documentation/translations/zh_CN/networking/netmem.rst
drivers/net/netkit.c
include/linux/netdevice.h