mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-04 16:15:11 +00:00
net: introduce struct ubuf_info_msgzc
We're going to split struct ubuf_info and leave there only mandatory fields. Users are free to extend it. Add struct ubuf_info_msgzc, which will be an extended version for MSG_ZEROCOPY and some other users. It duplicates of struct ubuf_info for now and will be removed in a couple of patches. 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
929a6cdfae
commit
6eaab4dfdd
1 changed files with 21 additions and 0 deletions
|
@ -554,7 +554,28 @@ struct ubuf_info {
|
||||||
} mmp;
|
} mmp;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct ubuf_info_msgzc {
|
||||||
|
struct ubuf_info ubuf;
|
||||||
|
|
||||||
|
union {
|
||||||
|
struct {
|
||||||
|
unsigned long desc;
|
||||||
|
void *ctx;
|
||||||
|
};
|
||||||
|
struct {
|
||||||
|
u32 id;
|
||||||
|
u16 len;
|
||||||
|
u16 zerocopy:1;
|
||||||
|
u32 bytelen;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
struct mmpin mmp;
|
||||||
|
};
|
||||||
|
|
||||||
#define skb_uarg(SKB) ((struct ubuf_info *)(skb_shinfo(SKB)->destructor_arg))
|
#define skb_uarg(SKB) ((struct ubuf_info *)(skb_shinfo(SKB)->destructor_arg))
|
||||||
|
#define uarg_to_msgzc(ubuf_ptr) container_of((ubuf_ptr), struct ubuf_info_msgzc, \
|
||||||
|
ubuf)
|
||||||
|
|
||||||
int mm_account_pinned_pages(struct mmpin *mmp, size_t size);
|
int mm_account_pinned_pages(struct mmpin *mmp, size_t size);
|
||||||
void mm_unaccount_pinned_pages(struct mmpin *mmp);
|
void mm_unaccount_pinned_pages(struct mmpin *mmp);
|
||||||
|
|
Loading…
Reference in a new issue