diff options
| author | Eric Dumazet <edumazet@google.com> | 2026-01-09 23:38:36 +0300 |
|---|---|---|
| committer | Jakub Kicinski <kuba@kernel.org> | 2026-01-13 06:30:57 +0300 |
| commit | 0391ab577c6e2ed7a0d8cb3e7a1da58497b6ff4f (patch) | |
| tree | 7bd42716776da17a5cac9457e0098a2166f0bed2 /include/linux/folio_queue.h | |
| parent | d7161b07904797563023cc48822c86d3c41abf2c (diff) | |
| download | linux-0391ab577c6e2ed7a0d8cb3e7a1da58497b6ff4f.tar.xz | |
net: add skbuff_clear() helper
clang is unable to inline the memset() calls in net/core/skbuff.c
when initializing allocated sk_buff.
memset(skb, 0, offsetof(struct sk_buff, tail));
This is unfortunate, because:
1) calling external memset_orig() helper adds a call/ret and
typical setup cost.
2) offsetof(struct sk_buff, tail) == 0xb8 = 0x80 + 0x38
On x86_64, memset_orig() performs two 64 bytes clear,
then has to loop 7 times to clear the final 56 bytes.
skbuff_clear() makes sure the minimal and optimal code
is generated.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Link: https://patch.msgid.link/20260109203836.1667441-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include/linux/folio_queue.h')
0 files changed, 0 insertions, 0 deletions
