diff options
author | Pavel Begunkov <asml.silence@gmail.com> | 2022-09-23 17:39:04 +0100 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2022-09-28 18:51:25 -0700 |
commit | e7d2b510165fff6bedc9cca88c071ad846850c74 (patch) | |
tree | b14a20279c36ca9fac082210cf5419e057075337 /include/linux/skbuff.h | |
parent | dfff202be5ea884498beb9f60492053144dd4b3f (diff) | |
download | lwn-e7d2b510165fff6bedc9cca88c071ad846850c74.tar.gz lwn-e7d2b510165fff6bedc9cca88c071ad846850c74.zip |
net: shrink struct ubuf_info
We can benefit from a smaller struct ubuf_info, so leave only mandatory
fields and let users to decide how they want to extend it. Convert
MSG_ZEROCOPY to struct ubuf_info_msgzc and remove duplicated fields.
This reduces the size from 48 bytes to just 16.
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Acked-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include/linux/skbuff.h')
-rw-r--r-- | include/linux/skbuff.h | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index fd7dcb977fdf..920eb6413fee 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -533,25 +533,8 @@ enum { struct ubuf_info { void (*callback)(struct sk_buff *, struct ubuf_info *, bool zerocopy_success); - union { - struct { - unsigned long desc; - void *ctx; - }; - struct { - u32 id; - u16 len; - u16 zerocopy:1; - u32 bytelen; - }; - }; refcount_t refcnt; u8 flags; - - struct mmpin { - struct user_struct *user; - unsigned int num_pg; - } mmp; }; struct ubuf_info_msgzc { @@ -570,7 +553,10 @@ struct ubuf_info_msgzc { }; }; - struct mmpin mmp; + struct mmpin { + struct user_struct *user; + unsigned int num_pg; + } mmp; }; #define skb_uarg(SKB) ((struct ubuf_info *)(skb_shinfo(SKB)->destructor_arg)) |