Skip to content

distributor lib performance enhancements

David Hunt dpdk-dev 11 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v11 Latest18 patches 9 repliesIn review
  2. v1018 patches 3 repliesSuperseded
  3. v918 patches 18 repliesSuperseded
Earlier versions · 8
VersionPostedPatchesRepliesStatus
v818 patches1 replySuperseded
v717 patches20 repliesSuperseded
v66 patches2 repliesSuperseded
v56 patches2 repliesSuperseded
v46 patches11 repliesSuperseded
v36 patches0 repliesSuperseded
v25 patches5 repliesSuperseded
v12 patches0 repliesSuperseded

Changes in v11 from the cover letter

* Fixed RTE_DIST_BURST_SIZE so it compiles on Arm platforms
* Fixed compile issue in rte_distributor_match_generic.c on Arm plarforms
* Tweaked distributor_app docs based on review and added John's Ack

Patches in v11 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/18lib: rename legacy distributor lib fileslib/librte_distributor/Makefile lib/librte_distributor/rte_distributor.h lib/librte_distributor/rte_distributor_v20.c +1 more+251 -2110 replies
2/18lib: create private header filelib/librte_distributor/rte_distributor_private.h lib/librte_distributor/rte_distributor_v20.c+137 -710 replies
3/18lib: add new distributor codelib/librte_distributor/Makefile lib/librte_distributor/rte_distributor.c lib/librte_distributor/rte_distributor_next.h +1 more+959 -00 replies
4/18lib: add SIMD flow matching to distributorlib/librte_distributor/Makefile lib/librte_distributor/rte_distributor.c lib/librte_distributor/rte_distributor_match_generic.c +2 more+186 -20 replies
5/18test/distributor: extra params for autoteststest/test/test_distributor.c+43 -210 replies
6/18lib: switch distributor over to new APIexamples/distributor/main.c lib/librte_distributor/rte_distributor.c lib/librte_distributor/rte_distributor.h +8 more+512 -4520 replies
7/18lib: make v20 header file privatelib/librte_distributor/Makefile+0 -12 replies
8/18lib: add symbol versioning to distributorlib/librte_distributor/Makefile lib/librte_distributor/rte_distributor.c lib/librte_distributor/rte_distributor_v1705.h +2 more+162 -102 replies
9/18test: test single and burst distributor APItest/test/test_distributor.c+82 -340 replies
10/18test: add perf test for distributor burst modetest/test/test_distributor_perf.c+51 -240 replies
11/18examples/distributor: allow for extra statsexamples/distributor/main.c+124 -160 replies
12/18examples/distributor: wait for ports to come upexamples/distributor/main.c+4 -30 replies
13/18examples/distributor: add dedicated core for distexamples/distributor/main.c+123 -580 replies
14/18examples/distributor: tweaks for performanceexamples/distributor/main.c+23 -132 replies
15/18examples/distributor: give Rx thread a coreexamples/distributor/main.c+16 -80 replies
16/18doc: distributor library changes for new burst APIdoc/guides/prog_guide/packet_distrib_lib.rst+3 -01 reply
17/18doc: distributor app changes for new burst APIdoc/guides/sample_app_ug/dist_app.rst doc/guides/sample_app_ug/img/dist_app.svg+180 -1460 replies
18/18maintainers: add to distributor lib maintainersMAINTAINERS+1 -00 replies

Reviews trailers per patch

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

PatchBruce RichardsonJohn McNamara
1/18A-b
2/18A-b
3/18A-b
4/18A-b
5/18A-b
6/18A-b
7/18A-b
8/18A-b
9/18A-b
10/18A-b
11/18A-b
12/18A-b
13/18A-b
14/18A-b
15/18A-b
16/18A-b A-b
17/18A-b
18/18A-b

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

Read the v11 thread

Cover letter [PATCH v11 0/18] distributor lib performance enhancements

This patch aims to improve the throughput of the distributor library.

It uses a similar handshake mechanism to the previous version of the library, in that bits are used to indicate when packets are ready to be sent to a worker and ready to be returned from a worker. One main difference is that instead of sending one packet in a cache line, it makes use of the 7 free spaces in the same cache line in order to send up to 8 packets at a time to/from a worker.

The flow matching algorithm has had significant re-work, and now keeps an array of inflight flows and an array of backlog flows, and matches incoming flows to the inflight/backlog flows of all workers so that flow pinning to workers can be maintained.

The Flow Match algorithm has both scalar and a vector versions, and a function pointer is used to select the post appropriate function at run time, depending on the presence of the SSE2 cpu flag. On non-x86 platforms, the the scalar match function is selected, which should still gives a good boost in performance over the non-burst API.

v11 changes:
* Fixed RTE_DIST_BURST_SIZE so it compiles on Arm platforms
* Fixed compile issue in rte_distributor_match_generic.c on Arm plarforms
* Tweaked distributor_app docs based on review and added John's Ack

v10 changes:
* Addressed all review comments from v9 (thanks, Bruce)
* Inherited v9 series Ack by Bruce, except new suggested addition for example app documentation (17/18)
* Squashed the two patches containing distributor structs and code
* Renamed confusing rte_distributor_v1705.h to rte_distributor_next.h
* Added usleep in main so as to be a little more gentle with that core
* Fixed some patch titles and improved some descriptions
* Updated sample app guide documentation
* Removed un-needed code limiting Tx rings and cleaned up patch

v9 changes:
* fixed symbol versioning so it will compile on CentOS and RedHat

v8 changes:
* Changed the patch set to have a more logical order order of the changes, but the end result is basically the same.
* Fixed broken shared library build.
* Split down the updates to example app more
* No longer changes the test app and sample app to use a temporary API.
* No longer temporarily re-names the functions in the version.map file.

v7 changes:
* Reorganised patch so there's a more natural progression in the changes, and divided them down into easier to review chunks.
* Previous versions of this patch set were effectively two APIs. We now have a single API. Legacy functionality can
be used by by using the rte_distributor_create API call with the RTE_DISTRIBUTOR_SINGLE flag when creating a distributor instance.
* Added symbol versioning for old API so that ABI is preserved.

v6 changes:
* Fixed intermittent segfault where num pkts not divisible by BURST_SIZE
* Cleanup due to review comments on mailing list
* Renamed _priv.h to _private.h.

v5 changes:
* Removed some un-needed code around retries in worker API calls
* Cleanup due to review comments on mailing list
* Cleanup of non-x86 platform compilation, fallback to scalar match

v4 changes:
* fixed issue building shared libraries

v3 changes:
* Addressed mailing list review comments
* Test code removal
* Split out SSE match into separate file to facilitate NEON addition
* Cleaned up conditional compilation flags for SSE2
* Addressed c99 style compilation errors
* rebased on latest head (Jan 2 2017, Happy New Year to all)

v2 changes:
* Created a common distributor_priv.h header file with common definitions and structures.
* Added a scalar version so it can be built and used on machines without sse2 instruction set
* Added unit autotests
* Added perf autotest

Notes:
Apps must now work in bursts, as up to 8 are given to a worker at a time For performance in matching, Flow ID's are 15-bits
If 32 bits Flow IDs are required, use the packet-at-a-time (SINGLE) mode.

Performance Gains
2.2GHz Intel(R) Xeon(R) CPU E5-2699 v4 @ 2.20GHz
2 x XL710 40GbE NICS to 2 x 40Gbps traffic generator channels 64b packets separate cores for rx, tx, distributor
1 worker - up to 4.8x
4 workers - up to 2.9x
8 workers - up to 1.8x
12 workers - up to 2.1x
16 workers - up to 1.8x

[01/18] lib: rename legacy distributor lib files [02/18] lib: create private header file
[03/18] lib: add new distributor code
[04/18] lib: add SIMD flow matching to distributor [05/18] test/distributor: extra params for autotests [06/18] lib: switch distributor over to new API [07/18] lib: make v20 header file private
[08/18] lib: add symbol versioning to distributor [09/18] test: test single and burst distributor API [10/18] test: add perf test for distributor burst mode [11/18] examples/distributor: allow for extra stats [12/18] examples/distributor: wait for ports to come up [13/18] examples/distributor: add dedicated core for dist [14/18] examples/distributor: tweaks for performance [15/18] examples/distributor: give Rx thread a core [16/18] doc: distributor library changes for new burst API [17/18] doc: distributor app changes for new burst API [18/18] maintainers: add to distributor lib maintainers