mbox series

[v5,0/8] lib/ring: add zero copy APIs

Message ID 20201025054556.14277-1-honnappa.nagarahalli@arm.com
Headers show
Series lib/ring: add zero copy APIs | expand

Message

Honnappa Nagarahalli Oct. 25, 2020, 5:45 a.m. UTC
It is pretty common for the DPDK applications to be deployed in
semi-pipeline model. In these models, a small number of cores
(typically 1) are designated as I/O cores. The I/O cores work
on receiving and transmitting packets from the NIC and several
packet processing cores. The IO core and the packet processing
cores exchange the packets over a ring. Typically, such applications
receive the mbufs in a temporary array and copy the mbufs on
to the ring. Depending on the requirements the packets
could be copied in batches of 32, 64 etc resulting in 256B,
512B etc memory copy.

The zero copy APIs help avoid intermediate copies by exposing
the space on the ring directly to the application.

v5:
1) Fixed CI compilation issues

v4:
1) Fixed multiple pointer issues
2) Added documentation

v3:
1) Changed the name of the APIs to 'zero-copy (zc)'
2) Made the address calculation simpler
3) Structure to return the data to the user is aligned on
   cache line boundary.
4) Added functional and stress test cases

v2: changed the patch to use the SP-SC and HTS modes

v1: Initial version

Honnappa Nagarahalli (8):
  lib/ring: add zero copy APIs
  test/ring: move common function to header file
  test/ring: add functional tests for zero copy APIs
  test/ring: add stress tests for zero copy APIs
  doc/ring: add zero copy peek APIs
  test/ring: fix the memory dump size
  test/ring: remove unnecessary braces
  test/ring: user uintptr_t instead of unsigned long

 app/test/meson.build                   |   2 +
 app/test/test_ring.c                   | 209 +++++++++-
 app/test/test_ring.h                   |  67 ++-
 app/test/test_ring_mt_peek_stress_zc.c |  56 +++
 app/test/test_ring_st_peek_stress_zc.c |  63 +++
 app/test/test_ring_stress.c            |   6 +
 app/test/test_ring_stress.h            |   2 +
 app/test/test_ring_stress_impl.h       |   2 +-
 doc/guides/prog_guide/ring_lib.rst     |  41 ++
 doc/guides/rel_notes/release_20_11.rst |   9 +
 lib/librte_ring/meson.build            |   1 +
 lib/librte_ring/rte_ring_elem.h        |   1 +
 lib/librte_ring/rte_ring_peek_zc.h     | 548 +++++++++++++++++++++++++
 13 files changed, 988 insertions(+), 19 deletions(-)
 create mode 100644 app/test/test_ring_mt_peek_stress_zc.c
 create mode 100644 app/test/test_ring_st_peek_stress_zc.c
 create mode 100644 lib/librte_ring/rte_ring_peek_zc.h

-- 
2.17.1

Comments

David Marchand Oct. 29, 2020, 1:57 p.m. UTC | #1
On Sun, Oct 25, 2020 at 6:46 AM Honnappa Nagarahalli
<honnappa.nagarahalli@arm.com> wrote:
>

> It is pretty common for the DPDK applications to be deployed in

> semi-pipeline model. In these models, a small number of cores

> (typically 1) are designated as I/O cores. The I/O cores work

> on receiving and transmitting packets from the NIC and several

> packet processing cores. The IO core and the packet processing

> cores exchange the packets over a ring. Typically, such applications

> receive the mbufs in a temporary array and copy the mbufs on

> to the ring. Depending on the requirements the packets

> could be copied in batches of 32, 64 etc resulting in 256B,

> 512B etc memory copy.

>

> The zero copy APIs help avoid intermediate copies by exposing

> the space on the ring directly to the application.


Reordered the patches to have the fixes and coding style changes first
in the series.
Fixed incorrect Fixes: line format.
Squashed documentation with introduction of the API.
Moved release note update (ring comes after EAL).
Fixed example of API usage.

Series applied, thanks Honnappa.

-- 
David Marchand
Honnappa Nagarahalli Oct. 29, 2020, 10:11 p.m. UTC | #2
<snip>

> On Sun, Oct 25, 2020 at 6:46 AM Honnappa Nagarahalli

> <honnappa.nagarahalli@arm.com> wrote:

> >

> > It is pretty common for the DPDK applications to be deployed in

> > semi-pipeline model. In these models, a small number of cores

> > (typically 1) are designated as I/O cores. The I/O cores work on

> > receiving and transmitting packets from the NIC and several packet

> > processing cores. The IO core and the packet processing cores exchange

> > the packets over a ring. Typically, such applications receive the

> > mbufs in a temporary array and copy the mbufs on to the ring.

> > Depending on the requirements the packets could be copied in batches

> > of 32, 64 etc resulting in 256B, 512B etc memory copy.

> >

> > The zero copy APIs help avoid intermediate copies by exposing the

> > space on the ring directly to the application.

> 

> Reordered the patches to have the fixes and coding style changes first in the

> series.

> Fixed incorrect Fixes: line format.

> Squashed documentation with introduction of the API.

> Moved release note update (ring comes after EAL).

> Fixed example of API usage.

> 

> Series applied, thanks Honnappa.

Thanks David. Sorry, you had to fix things up.

> 

> --

> David Marchand