xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/4] shrink struct ubuf_info
@ 2022-09-23 16:39 Pavel Begunkov
  2022-09-23 16:39 ` [PATCH net-next 1/4] net: introduce struct ubuf_info_msgzc Pavel Begunkov
                   ` (5 more replies)
  0 siblings, 6 replies; 15+ messages in thread
From: Pavel Begunkov @ 2022-09-23 16:39 UTC (permalink / raw)
  To: netdev
  Cc: David S . Miller, Jakub Kicinski, linux-kernel, xen-devel,
	Wei Liu, Paul Durrant, kvm, virtualization, Michael S . Tsirkin,
	Jason Wang, Pavel Begunkov

struct ubuf_info is large but not all fields are needed for all
cases. We have limited space in io_uring for it and large ubuf_info
prevents some struct embedding, even though we use only a subset
of the fields. It's also not very clean trying to use this typeless
extra space.

Shrink struct ubuf_info to only necessary fields used in generic paths,
namely ->callback, ->refcnt and ->flags, which take only 16 bytes. And
make MSG_ZEROCOPY and some other users to embed it into a larger struct
ubuf_info_msgzc mimicking the former ubuf_info.

Note, xen/vhost may also have some cleaning on top by creating
new structs containing ubuf_info but with proper types.

Pavel Begunkov (4):
  net: introduce struct ubuf_info_msgzc
  xen/netback: use struct ubuf_info_msgzc
  vhost/net: use struct ubuf_info_msgzc
  net: shrink struct ubuf_info

 drivers/net/xen-netback/common.h    |  2 +-
 drivers/net/xen-netback/interface.c |  4 +--
 drivers/net/xen-netback/netback.c   |  7 +++---
 drivers/vhost/net.c                 | 15 ++++++------
 include/linux/skbuff.h              | 11 +++++++--
 net/core/skbuff.c                   | 38 ++++++++++++++++-------------
 net/ipv4/ip_output.c                |  2 +-
 net/ipv4/tcp.c                      |  2 +-
 net/ipv6/ip6_output.c               |  2 +-
 9 files changed, 48 insertions(+), 35 deletions(-)

-- 
2.37.2



^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2022-09-29  2:20 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-23 16:39 [PATCH net-next 0/4] shrink struct ubuf_info Pavel Begunkov
2022-09-23 16:39 ` [PATCH net-next 1/4] net: introduce struct ubuf_info_msgzc Pavel Begunkov
2022-09-23 16:39 ` [PATCH net-next 2/4] xen/netback: use " Pavel Begunkov
2022-09-23 16:39 ` [PATCH net-next 3/4] vhost/net: " Pavel Begunkov
2022-09-23 16:39 ` [PATCH net-next 4/4] net: shrink struct ubuf_info Pavel Begunkov
2022-09-27 13:49 ` [PATCH net-next 0/4] " Paolo Abeni
2022-09-27 14:28   ` Pavel Begunkov
2022-09-27 17:16     ` Pavel Begunkov
2022-09-27 17:56       ` Paolo Abeni
2022-09-27 18:48         ` Pavel Begunkov
2022-09-27 19:59           ` Paolo Abeni
2022-09-27 20:17             ` Pavel Begunkov
2022-09-27 20:23               ` Paolo Abeni
2022-09-27 21:02                 ` Pavel Begunkov
2022-09-29  2:20 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).