Skip to content

add a fast path for memif Rx/Tx

Joyce Kong dpdk-dev 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest2 patches 2 repliesIn review
  2. v32 patches 2 repliesSuperseded
  3. v22 patches 1 replySuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v12 patches8 repliesSuperseded

Changes in v4 from the cover letter

1.Fix incorrect indentation.
2.Fix the mbuf array length to avoid additional overhead if
stack-protector strong is enabled. <Stephen Hemminger>

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2net/memif: add a Rx fast pathdrivers/net/memif/rte_eth_memif.c drivers/net/memif/rte_eth_memif.h+107 -410 replies
2/2net/memif: add a Tx fast pathdrivers/net/memif/rte_eth_memif.c+92 -420 replies

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchRuifeng WangMorten Brørup
1/2R-b A-b
2/2R-b A-b

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

Read the v4 thread

Cover letter [PATCH v4 0/2] add a fast path for memif Rx/Tx

For memif non-zero-copy mode, there is a branch to compare the mbuf and memif buffer size during memory copy. Add a fast memcpy path by removing this branch with mbuf and memif buffer size defined at compile time. For Rx fast path, bulk allocating mbufs to get additional speedup. For Tx fast path, bulk free 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 N1SDP AArch64 server,
---------------------------------------------------------
buf size | memif = mbuf | memif < mbuf | memif > mbuf
---------------------------------------------------------
non-zc gain | 47.16% | 24.67% | 12.47%
---------------------------------------------------------
zc gain | 20.96% | 9.16% | 10.66%
---------------------------------------------------------

Test with 1p1q on Cascade Lake Xeon X86 server,
---------------------------------------------------------
buf size | memif = mbuf | memif < mbuf | memif > mbuf
---------------------------------------------------------
non-zc gain | 23.52% | 14.20% | 5.10%
---------------------------------------------------------
zc gain | 17.49% | 10.62% | 12.42%
---------------------------------------------------------

v4:
1.Fix incorrect indentation.
2.Fix the mbuf array length to avoid additional overhead if
stack-protector strong is enabled. <Stephen Hemminger>

v3:
Add bulk allocation to get additional speedup for memif Rx fast path. <Stephen Hemminger>

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 | 280 +++++++++++++++++++++---------
 drivers/net/memif/rte_eth_memif.h |   2 +
 2 files changed, 199 insertions(+), 83 deletions(-)
Signature · 1 line
2.17.1