mbox series

[v2,0/2] add a fast path for memif Rx/Tx

Message ID 20220701102815.1444223-1-joyce.kong@arm.com (mailing list archive)
Headers show
Series add a fast path for memif Rx/Tx | expand

Message

Joyce Kong July 1, 2022, 10:28 a.m. UTC
For memif non-zero-copy mode, there is a branch to compare
the mbuf and memif buffer size during memory copying. Add
a fast memory copy path by removing this branch with mbuf
and memif buffer size defined at compile time. And for Tx
fast path, bulk free the mbufs which come from the same
mempool.

When mbuf == memif buffer size, both Rx/Tx would choose
the fast memcpy path. When mbuf < memif buffer size, the
Rx chooses previous memcpy path while Tx chooses fast
memcpy path. When mbuf > memif buffer size, the Rx chooses
fast memcpy path while Tx chooses previous memcpy path.

Test with 1p1q on Ampere Altra AArch64 server,
---------------------------------------------------------
  buf size  | memif = mbuf | memif < mbuf | memif > mbuf
---------------------------------------------------------
non-zc gain |    16.95%    |     3.28%    |    13.29%
---------------------------------------------------------
   zc gain  |    19.43%    |     4.62%    |    18.14%
---------------------------------------------------------

Test with 1p1q on Cascade Lake Xeon X86server,
---------------------------------------------------------
  buf size  | memif = mbuf | memif < mbuf | memif > mbuf
---------------------------------------------------------
non-zc gain |    19.97%    |     2.35%    |    21.43%
---------------------------------------------------------
   zc gain  |    14.30%    |    -1.21%    |    11.98%
---------------------------------------------------------

v2:
 Rebase v1 and update commit message.

Joyce Kong (2):
  net/memif: add a Rx fast path
  net/memif: add a Tx fast path

 drivers/net/memif/rte_eth_memif.c | 257 ++++++++++++++++++++----------
 1 file changed, 175 insertions(+), 82 deletions(-)