]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
net: avoid one loop iteration in __skb_splice_bits
authorPengtao He <hept.hept.hept@gmail.com>
Tue, 19 Aug 2025 02:15:51 +0000 (10:15 +0800)
committerJakub Kicinski <kuba@kernel.org>
Thu, 21 Aug 2025 02:24:17 +0000 (19:24 -0700)
commit8f2c72f2252cf228879de0224d5055470fc20c06
treefc688f19c90fbd0f6aba0f0fc2ca1175fccd7f6b
parentc3199adbe4ffffc7b6536715e0290d1919a45cd9
net: avoid one loop iteration in __skb_splice_bits

If *len is equal to 0 at the beginning of __splice_segment
it returns true directly. But when decreasing *len from
a positive number to 0 in __splice_segment, it returns false.
The __skb_splice_bits needs to call __splice_segment again.

Recheck *len if it changes, return true in time.
Reduce unnecessary calls to __splice_segment.

Signed-off-by: Pengtao He <hept.hept.hept@gmail.com>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Link: https://patch.msgid.link/20250819021551.8361-1-hept.hept.hept@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/core/skbuff.c