Skip to content

shrink struct ubuf_info

Pavel Begunkov kvm lkml netdev virtualization xen-devel 1 version Applied

Status from this message: This series was applied to netdev/net-next.git (master)

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 9 repliesApplied 4/4

Patches in v1 All 4 applied

#Subject and filesSizeRepliesApplied
1/4net: introduce struct ubuf_info_msgzcinclude/linux/skbuff.h+21 -00 repliesApplied
2/4xen/netback: use struct ubuf_info_msgzcdrivers/net/xen-netback/common.h drivers/net/xen-netback/interface.c drivers/net/xen-netback/netback.c+7 -60 repliesApplied
3/4vhost/net: use struct ubuf_info_msgzcdrivers/vhost/net.c+8 -70 repliesApplied
4/4net: shrink struct ubuf_infoinclude/linux/skbuff.h net/core/skbuff.c net/ipv4/ip_output.c +2 more+28 -380 repliesApplied

Reviews trailers per patch

None of the 4 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchPaolo Abeni
SeriesA-b
1/4
2/4
3/4
4/4

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH net-next 0/4] shrink struct ubuf_info

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(-)
Signature · 1 line
2.37.2