bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 bpf-next 0/2] xsk: introduce generic almost-zerocopy xmit
@ 2021-03-31 12:26 Alexander Lobakin
  2021-03-31 12:28 ` [PATCH v2 bpf-next 1/2] xsk: speed-up generic full-copy xmit Alexander Lobakin
  2021-04-12 14:13 ` [PATCH v2 bpf-next 0/2] " Magnus Karlsson
  0 siblings, 2 replies; 6+ messages in thread
From: Alexander Lobakin @ 2021-03-31 12:26 UTC (permalink / raw)
  To: Alexei Starovoitov, Daniel Borkmann
  Cc: Xuan Zhuo, Björn Töpel, Magnus Karlsson,
	Jonathan Lemon, David S. Miller, Jakub Kicinski,
	Jesper Dangaard Brouer, John Fastabend, Andrii Nakryiko,
	Martin KaFai Lau, Song Liu, Yonghong Song, KP Singh,
	Alexander Lobakin, netdev, bpf, linux-kernel

This series is based on the exceptional generic zerocopy xmit logics
initially introduced by Xuan Zhuo. It extends it the way that it
could cover all the sane drivers, not only the ones that are capable
of xmitting skbs with no linear space.

The first patch is a random while-we-are-here improvement over
full-copy path, and the second is the main course. See the individual
commit messages for the details.

The original (full-zerocopy) path is still here and still generally
faster, but for now it seems like virtio_net will remain the only
user of it, at least for a considerable period of time.

From v1 [0]:
 - don't add a whole SMP_CACHE_BYTES because of only two bytes
   (NET_IP_ALIGN);
 - switch to zerocopy if the frame is 129 bytes or longer, not 128.
   128 still fit to kmalloc-512, while a zerocopy skb is always
   kmalloc-1024 -> can potentially be slower on this frame size.

[0] https://lore.kernel.org/netdev/20210330231528.546284-1-alobakin@pm.me

Alexander Lobakin (2):
  xsk: speed-up generic full-copy xmit
  xsk: introduce generic almost-zerocopy xmit

 net/xdp/xsk.c | 32 ++++++++++++++++++++++----------
 1 file changed, 22 insertions(+), 10 deletions(-)

--
Well, this is untested. I currently don't have an access to my setup
and is bound by moving to another country, but as I don't know for
sure at the moment when I'll get back to work on the kernel next time,
I found it worthy to publish this now -- if any further changes will
be required when I already will be out-of-sight, maybe someone could
carry on to make a another revision and so on (I'm still here for any
questions, comments, reviews and improvements till the end of this
week).
But this *should* work with all the sane drivers. If a particular
one won't handle this, it's likely ill. Any tests are highly
appreciated. Thanks!
--
2.31.1



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

end of thread, other threads:[~2021-04-18 12:05 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-31 12:26 [PATCH v2 bpf-next 0/2] xsk: introduce generic almost-zerocopy xmit Alexander Lobakin
2021-03-31 12:28 ` [PATCH v2 bpf-next 1/2] xsk: speed-up generic full-copy xmit Alexander Lobakin
2021-03-31 12:28   ` [PATCH v2 bpf-next 2/2] xsk: introduce generic almost-zerocopy xmit Alexander Lobakin
2021-04-12 14:13 ` [PATCH v2 bpf-next 0/2] " Magnus Karlsson
     [not found]   ` <1618278328.0085247-1-xuanzhuo@linux.alibaba.com>
2021-04-13  7:14     ` Magnus Karlsson
2021-04-18 12:04       ` Alexander Lobakin

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).