Netdev List
 help / color / mirror / Atom feed
* [PATCH net v3 0/2] net: do not run out of frags in alloc_skb_with_frags()
@ 2026-11-16 11:56 Haishuang Yan
  2026-11-16 11:56 ` [PATCH net v3 1/2] " Haishuang Yan
  2026-11-16 11:56 ` [PATCH net v3 2/2] net: add a KUnit test for the alloc_skb_with_frags() tail split Haishuang Yan
  0 siblings, 2 replies; 5+ messages in thread
From: Haishuang Yan @ 2026-11-16 11:56 UTC (permalink / raw)
  To: netdev
  Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Simon Horman, Mina Almasry, Daniel Borkmann, Willem de Bruijn,
	Willem de Bruijn, Michael S. Tsirkin, Jason Wang,
	Eugenio Pérez, Narcisa Vasile, linux-kernel

alloc_skb_with_frags() can fail with -ENOBUFS for a data_len that passed
its size check. Patch 1 fixes it, patch 2 adds a KUnit test.

The issues were found with the help of an AI coding assistant.

Changes in v3:
- Patch 1: check the frags left only after a failed allocation, with a
  shift (Eric).
- Patch 1: say that the allocation still fails if the retry fails.
- Patch 2: skip only if MAX_SKB_FRAGS - 1 order-3 pages can't be held
  at once; one page was nearly always available (netdev AI review).
- Shorter changelogs (Eric).

v2: https://lore.kernel.org/netdev/20261110162418.28322-1-yanhaishuang@cmss.chinamobile.com/


Haishuang Yan (2):
  net: do not run out of frags in alloc_skb_with_frags()
  net: add a KUnit test for the alloc_skb_with_frags() tail split

 net/core/net_test.c | 51 +++++++++++++++++++++++++++++++++++++++++++++
 net/core/skbuff.c   | 33 ++++++++++++++++++++++++-----
 2 files changed, 79 insertions(+), 5 deletions(-)


base-commit: a45dbf182137275f44ad7c8bc8acd23f7af6b2cf
-- 
2.43.0




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

end of thread, other threads:[~2026-11-19 14:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-16 11:56 [PATCH net v3 0/2] net: do not run out of frags in alloc_skb_with_frags() Haishuang Yan
2026-11-16 11:56 ` [PATCH net v3 1/2] " Haishuang Yan
2026-11-19 14:56   ` netdev-bot+sashiko
2026-11-16 11:56 ` [PATCH net v3 2/2] net: add a KUnit test for the alloc_skb_with_frags() tail split Haishuang Yan
2026-11-19 14:56   ` netdev-bot+sashiko

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