[ovs-dev] [PATCH v7 0/5] dpcls func ptrs & optimizations

Harry van Haaren harry.van.haaren at intel.com
Thu Apr 11 12:55:59 UTC 2019


TL;DR:
1) As per v6, the function pointer rework for dpcls
2) Last 2 patches include specialized scalar optimizations

Running with Eth/IPv4/UDP traffic should show performance improvements,
with EMC/SMC disabled (so just DPCLS traffic), on a simple test case there
is a > 15% speedup. Please test this patchset, and report back numbers!


Patchset Details;
The code is split into 5 patches to make the code traceable during
review, as the resulting code is quite different to today's dpcls_lookup.

Checkpatch flags two warnings, which I believe to not be sanely fixable
due to the way MACROs accept arguments.

Running TESTSUITE shows all passing, with ~28 tests being skipped, which
is the same as before this patchset.


Per patch details:
1) Refactor dpcls_lookup and the subtable for flexibility.
In particular, add a function pointer to the subtable
structure, which enables "plugging-in" a lookup function
at runtime. This enables a number of optimizations in future.

2) and 3)
With the function pointer in place, we refactor the existing
dpcls_lookup matching code into its own function, and later its
own file. To split it to its own file requires making various
dpcls data-structures available in the dpif-netdev.h header.

4)
Refactor the existing code, to favour compute of flat arrays of
miniflows, instead of the MACRO based iteration. This simplifies
the code itself, and makes future optimizations possible due to
simplified loop structures, and loop trip counts pass in via
function arguments. See commit message for more details.

5)
This patch implements a select few specialized functions, for handling
miniflows with 5-1, 4-1, and 4-0 miniflow unit bit patterns. More of
these types of functions can (and should) be added to accelerate other
patterns of subtable lookups! See commit message for more details.


As always: feedback, suggestions, performance numbers all welcome!
Regards -Harry


Harry van Haaren (5):
  dpif-netdev: implement function pointers/subtable
  dpif-netdev: move dpcls lookup structures to .h
  dpif-netdev: split out generic lookup function
  dpif-netdev: refactor generic implementation
  dpif-netdev: add specialized generic scalar functions

 lib/automake.mk                  |   1 +
 lib/dpif-netdev-lookup-generic.c | 342 +++++++++++++++++++++++++++++++
 lib/dpif-netdev.c                | 128 +++---------
 lib/dpif-netdev.h                |  83 ++++++++
 4 files changed, 456 insertions(+), 98 deletions(-)
 create mode 100644 lib/dpif-netdev-lookup-generic.c

-- 
2.17.1



More information about the dev mailing list