Netdev List
 help / color / mirror / Atom feed
* [PATCH net-next 0/3] tun: trim per-packet work on the write path
@ 2026-11-12 15:06 Antonio Quartulli
  2026-11-12 15:06 ` [PATCH net-next 1/3] tun: don't probe the transport header of packets written by userspace Antonio Quartulli
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Antonio Quartulli @ 2026-11-12 15:06 UTC (permalink / raw)
  To: willemdebruijn.kernel, jasowangio
  Cc: Antonio Quartulli, andrew+netdev, davem, edumazet, kuba, pabeni,
	ast, daniel, hawk, john.fastabend, sdf, netdev, bpf

Profiling a link-bonding daemon on an embedded router (Cortex-A7), which
injects every packet with a write() to a tun device, showed tun doing
per-packet work its packets do not need:

1. a flow dissector run, only to set the transport header
2. a BH-disabled RCU section, only to check for an XDP program, which
   only TAP devices can have
3. the parsing of an all-zero virtio-net header without IFF_VNET_HDR

Per 1400-byte packet written and dropped at the raw table, instruction
counts (qemu -icount) drop by 6.5% for 1 (Cortex-A7), 2.3% for 2 and
1.6% for 3 (x86). The tun selftests pass.

Antonio Quartulli (3):
  tun: don't probe the transport header of packets written by userspace
  tun: don't disable BHs for the XDP program check of every packet
  tun: skip the virtio-net header parsing without IFF_VNET_HDR

 drivers/net/tun.c | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

-- 
2.56.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-11-12 15:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-12 15:06 [PATCH net-next 0/3] tun: trim per-packet work on the write path Antonio Quartulli
2026-11-12 15:06 ` [PATCH net-next 1/3] tun: don't probe the transport header of packets written by userspace Antonio Quartulli
2026-11-12 15:06 ` [PATCH net-next 2/3] tun: don't disable BHs for the XDP program check of every packet Antonio Quartulli
2026-11-12 15:06 ` [PATCH net-next 3/3] tun: skip the virtio-net header parsing without IFF_VNET_HDR Antonio Quartulli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox