mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-24 14:07:52 -04:00
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>
This commit is contained in:
parent
dfff202be5
commit
e7d2b51016
5 changed files with 28 additions and 38 deletions
|
@ -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))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue