Skip to content

app/test: unit test to measure cycles per packet

Cunming Liang dpdk-dev 7 versions – Applied

Status from this message: Applied

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v7 Latest7 patches 7 repliesApplied
  2. v63 patches 5 repliesSuperseded
  3. v53 patches 0 repliesSuperseded
Earlier versions · 4
VersionPostedPatchesRepliesStatus
v43 patches3 repliesSuperseded
v32 patches1 replySuperseded
v24 patches15 repliesSuperseded
v15 patches1 replySuperseded

Patches in v7 Applied

#Subject and filesSizeRepliesApplied
1/7app/test: allow to create packets in different sizesapp/test/packet_burst_generator.c app/test/packet_burst_generator.h app/test/test_link_bonding.c+43 -330 replies
2/7ixgbe:clean scattered_rx configure in dev_stoplib/librte_pmd_ixgbe/ixgbe_ethdev.c+6 -06 replies
3/7ether: new API to format eth_addr in stringlib/librte_ether/rte_ether.h+25 -00 replies
4/7app/testpmd: cleanup eth_addr printapp/test-pmd/config.c app/test-pmd/icmpecho.c app/test-pmd/rxonly.c+8 -290 replies
5/7examples: cleanup eth_addr printexamples/dpdk_qat/main.c examples/ip_fragmentation/main.c examples/ip_reassembly/main.c +5 more+24 -560 replies
6/7app/test: measure the cost of rx/tx routines by cycle numberapp/test/Makefile app/test/commands.c app/test/test.h +1 more+1040 -00 replies
7/7ethdev: fix wrong error return refere to API definitionlib/librte_ether/rte_ethdev.c+3 -30 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v7 yet.

Read the v7 thread

Cover letter [PATCH v7 0/7] app/test: unit test to measure cycles per packet

v7 update:

# patch split and re-orginize

v6 update:

# leave FUNC_PTR_OR_*_RET unmodified

v5 update:

# fix the confusing of retval in some API of rte_ethdev

v4 ignore

v3 update:
# Codes refine according to the feedback.
1. add ether_format_addr to rte_ether.h
2. fix typo in code comments.
3. %lu to %PRIu64, fixing 32-bit targets compilation err

# merge 2 small incremental patches to the first one.
  The whole unit test as a single patch in [PATCH v3 2/2]
# rebase code to the latest master

v2 update:
Rebase code to the latest master branch.

It provides unit test to measure cycles/packet in NIC loopback mode. It simply gives the average cycles of IO used per packet without test equipment. When doing the test, make sure the link is UP.

There's two stream control mode support, one is continues, another is burst.
The former continues to forward the injected packets until reaching a certain amount of number. The latter one stop when all the injected packets are received.
In burst stream, now measure two situations, with or without desc. cache conflict. By default, it runs in continues stream mode to measure the whole rxtx.

Usage Example:
1. Run unit test app in interactive mode

    app/test -c f -n 4 -- -i

2. Set stream control mode, by default is continuous
set_rxtx_sc [continuous|poll_before_xmit|poll_after_xmit]
3. If choose continuous stream, there are another two options can configure
3.1 choose rx/tx pair, default is vector
set_rxtx_mode [vector|scalar|full|hybrid]
Note: To get acurate scalar fast, plz choose 'vector' or 'hybrid' without INC_VEC=y in config
3.2 choose the area of masurement, default is rxtx
set_rxtx_anchor [rxtx|rxonly|txonly]
4. Run and wait for the result
pmd_perf_autotest

For who simply just want to see how much cycles cost per packet. Compile DPDK, Run 'app/test', and type 'pmd_perf_autotest', that's it. Nothing else needs to configure.
Using other options when you understand and what to measures more.

BTW, [1/3] is the same patch as below one.
http://dpdk.org/dev/patchwork/patch/817

*** BLURB HERE ***

Cunming Liang (7):
app/test: allow to create packets in different sizes ixgbe:clean scattered_rx configure in dev_stop
ether: new API to format eth_addr in string app/testpmd: cleanup eth_addr print
examples: cleanup eth_addr print
app/test: measure the cost of rx/tx routines by cycle number
ethdev: fix wrong error return refere to API definition

 app/test-pmd/config.c               |   10 +-
 app/test-pmd/icmpecho.c             |   16 +-
 app/test-pmd/rxonly.c               |   11 +-
 app/test/Makefile                   |    1 +
 app/test/commands.c                 |  111 +++++
 app/test/packet_burst_generator.c   |   26 +-
 app/test/packet_burst_generator.h   |   11 +-
 app/test/test.h                     |    6 +
 app/test/test_link_bonding.c        |   39 +-
 app/test/test_pmd_perf.c            |  922 +++++++++++++++++++++++++++++++++++
 examples/dpdk_qat/main.c            |   10 +-
 examples/ip_fragmentation/main.c    |   10 +-
 examples/ip_reassembly/main.c       |   10 +-
 examples/ipv4_multicast/main.c      |   10 +-
 examples/l3fwd-acl/main.c           |   10 +-
 examples/l3fwd-power/main.c         |   10 +-
 examples/l3fwd-vf/main.c            |   10 +-
 examples/l3fwd/main.c               |   10 +-
 lib/librte_ether/rte_ethdev.c       |    6 +-
 lib/librte_ether/rte_ether.h        |   25 +
 lib/librte_pmd_ixgbe/ixgbe_ethdev.c |    6 +
 21 files changed, 1149 insertions(+), 121 deletions(-)
 create mode 100644 app/test/test_pmd_perf.c
Signature · 1 line
1.7.4.1