netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next v3 0/6] Device memory TCP TX
@ 2025-02-03 22:39 Mina Almasry
  2025-02-03 22:39 ` [PATCH net-next v3 1/6] net: add devmem TCP TX documentation Mina Almasry
                   ` (7 more replies)
  0 siblings, 8 replies; 39+ messages in thread
From: Mina Almasry @ 2025-02-03 22:39 UTC (permalink / raw)
  To: netdev, linux-kernel, linux-doc, kvm, virtualization,
	linux-kselftest
  Cc: Mina Almasry, Donald Hunter, Jakub Kicinski, David S. Miller,
	Eric Dumazet, Paolo Abeni, Simon Horman, Jonathan Corbet,
	Andrew Lunn, Neal Cardwell, David Ahern, Michael S. Tsirkin,
	Jason Wang, Xuan Zhuo, Eugenio Pérez, Stefan Hajnoczi,
	Stefano Garzarella, Shuah Khan, sdf, asml.silence, dw,
	Jamal Hadi Salim, Victor Nogueira, Pedro Tammela,
	Samiullah Khawaja

v3: https://patchwork.kernel.org/project/netdevbpf/list/?series=929401&state=*
===

Address minor comments from RFCv2 and fix a few build warnings and
ynl-regen issues. No major changes.

RFC v2: https://patchwork.kernel.org/project/netdevbpf/list/?series=920056&state=*
=======

RFC v2 addresses much of the feedback from RFC v1. I plan on sending
something close to this as net-next  reopens, sending it slightly early
to get feedback if any.

Major changes:
--------------

- much improved UAPI as suggested by Stan. We now interpret the iov_base
  of the passed in iov from userspace as the offset into the dmabuf to
  send from. This removes the need to set iov.iov_base = NULL which may
  be confusing to users, and enables us to send multiple iovs in the
  same sendmsg() call. ncdevmem and the docs show a sample use of that.

- Removed the duplicate dmabuf iov_iter in binding->iov_iter. I think
  this is good improvment as it was confusing to keep track of
  2 iterators for the same sendmsg, and mistracking both iterators
  caused a couple of bugs reported in the last iteration that are now
  resolved with this streamlining.

- Improved test coverage in ncdevmem. Now muliple sendmsg() are tested,
  and sending multiple iovs in the same sendmsg() is tested.

- Fixed issue where dmabuf unmapping was happening in invalid context
  (Stan).

====================================================================

The TX path had been dropped from the Device Memory TCP patch series
post RFCv1 [1], to make that series slightly easier to review. This
series rebases the implementation of the TX path on top of the
net_iov/netmem framework agreed upon and merged. The motivation for
the feature is thoroughly described in the docs & cover letter of the
original proposal, so I don't repeat the lengthy descriptions here, but
they are available in [1].

Sending this series as RFC as the winder closure is immenient. I plan on
reposting as non-RFC once the tree re-opens, addressing any feedback
I receive in the meantime.

Full outline on usage of the TX path is detailed in the documentation
added in the first patch.

Test example is available via the kselftest included in the series as well.

The series is relatively small, as the TX path for this feature largely
piggybacks on the existing MSG_ZEROCOPY implementation.

Patch Overview:
---------------

1. Documentation & tests to give high level overview of the feature
   being added.

2. Add netmem refcounting needed for the TX path.

3. Devmem TX netlink API.

4. Devmem TX net stack implementation.

Testing:
--------

Testing is very similar to devmem TCP RX path. The ncdevmem test used
for the RX path is now augemented with client functionality to test TX
path.

* Test Setup:

Kernel: net-next with this RFC and memory provider API cherry-picked
locally.

Hardware: Google Cloud A3 VMs.

NIC: GVE with header split & RSS & flow steering support.

Performance results are not included with this version, unfortunately.
I'm having issues running the dma-buf exporter driver against the
upstream kernel on my test setup. The issues are specific to that
dma-buf exporter and do not affect this patch series. I plan to follow
up this series with perf fixes if the tests point to issues once they're
up and running.

Special thanks to Stan who took a stab at rebasing the TX implementation
on top of the netmem/net_iov framework merged. Parts of his proposal [2]
that are reused as-is are forked off into their own patches to give full
credit.

[1] https://lore.kernel.org/netdev/20240909054318.1809580-1-almasrymina@google.com/
[2] https://lore.kernel.org/netdev/20240913150913.1280238-2-sdf@fomichev.me/T/#m066dd407fbed108828e2c40ae50e3f4376ef57fd

Cc: sdf@fomichev.me
Cc: asml.silence@gmail.com
Cc: dw@davidwei.uk
Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Cc: Victor Nogueira <victor@mojatatu.com>
Cc: Pedro Tammela <pctammela@mojatatu.com>
Cc: Samiullah Khawaja <skhawaja@google.com>


Mina Almasry (5):
  net: add devmem TCP TX documentation
  selftests: ncdevmem: Implement devmem TCP TX
  net: add get_netmem/put_netmem support
  net: devmem: Implement TX path
  net: devmem: make dmabuf unbinding scheduled work

Stanislav Fomichev (1):
  net: devmem: TCP tx netlink api

 Documentation/netlink/specs/netdev.yaml       |  12 +
 Documentation/networking/devmem.rst           | 144 ++++++++-
 include/linux/skbuff.h                        |  15 +-
 include/linux/skbuff_ref.h                    |   4 +-
 include/net/netmem.h                          |   3 +
 include/net/sock.h                            |   1 +
 include/uapi/linux/netdev.h                   |   1 +
 include/uapi/linux/uio.h                      |   6 +-
 net/core/datagram.c                           |  41 ++-
 net/core/devmem.c                             | 111 ++++++-
 net/core/devmem.h                             |  70 +++-
 net/core/netdev-genl-gen.c                    |  13 +
 net/core/netdev-genl-gen.h                    |   1 +
 net/core/netdev-genl.c                        |  66 +++-
 net/core/skbuff.c                             |  36 ++-
 net/core/sock.c                               |   8 +
 net/ipv4/tcp.c                                |  36 ++-
 net/vmw_vsock/virtio_transport_common.c       |   3 +-
 tools/include/uapi/linux/netdev.h             |   1 +
 .../selftests/drivers/net/hw/ncdevmem.c       | 300 +++++++++++++++++-
 20 files changed, 819 insertions(+), 53 deletions(-)

-- 
2.48.1.362.g079036d154-goog


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

end of thread, other threads:[~2025-02-20 14:34 UTC | newest]

Thread overview: 39+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-03 22:39 [PATCH net-next v3 0/6] Device memory TCP TX Mina Almasry
2025-02-03 22:39 ` [PATCH net-next v3 1/6] net: add devmem TCP TX documentation Mina Almasry
2025-02-03 22:39 ` [PATCH net-next v3 2/6] selftests: ncdevmem: Implement devmem TCP TX Mina Almasry
2025-02-04 12:29   ` Paolo Abeni
2025-02-04 16:50     ` Jakub Kicinski
2025-02-04 17:35     ` Mina Almasry
2025-02-04 17:56       ` Paolo Abeni
2025-02-04 18:03         ` Mina Almasry
2025-02-04 18:07           ` Stanislav Fomichev
2025-02-03 22:39 ` [PATCH net-next v3 3/6] net: add get_netmem/put_netmem support Mina Almasry
2025-02-03 22:39 ` [PATCH net-next v3 4/6] net: devmem: TCP tx netlink api Mina Almasry
2025-02-03 22:39 ` [PATCH net-next v3 5/6] net: devmem: Implement TX path Mina Almasry
2025-02-04 12:15   ` Paolo Abeni
2025-02-05 12:20   ` Pavel Begunkov
2025-02-10 21:09     ` Mina Almasry
2025-02-12 15:53       ` Pavel Begunkov
2025-02-12 19:18         ` Mina Almasry
2025-02-13 13:18           ` Pavel Begunkov
2025-02-17 23:26             ` Mina Almasry
2025-02-19 22:41               ` Pavel Begunkov
2025-02-20  1:46                 ` Mina Almasry
2025-02-20 14:35                   ` Pavel Begunkov
2025-02-05 21:56   ` Willem de Bruijn
2025-02-03 22:39 ` [PATCH net-next v3 6/6] net: devmem: make dmabuf unbinding scheduled work Mina Almasry
2025-02-04 12:32 ` [PATCH net-next v3 0/6] Device memory TCP TX Paolo Abeni
2025-02-04 17:27   ` Mina Almasry
2025-02-04 18:06     ` Stanislav Fomichev
2025-02-04 18:32       ` Paolo Abeni
2025-02-04 18:47         ` Mina Almasry
2025-02-04 19:41           ` Stanislav Fomichev
2025-02-05  2:06             ` Jakub Kicinski
2025-02-05 19:53               ` Mina Almasry
2025-02-04 18:38       ` Mina Almasry
2025-02-04 19:43         ` Stanislav Fomichev
2025-02-05  0:47           ` Samiullah Khawaja
2025-02-05  1:05             ` Stanislav Fomichev
2025-02-05  2:08 ` Jakub Kicinski
2025-02-05 19:52   ` Mina Almasry
2025-02-06  1:45     ` Jakub Kicinski

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