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

Harry van Haaren harry.van.haaren at intel.com
Tue Jul 9 12:34:35 UTC 2019

Hey All,

Here a v10 of the DPCLS Function Pointer patchset, as has been
presented at OVS Conf in Nov '18, and discussed on the ML since then.
I'm aware of the soft-freeze for 2.12, I feel this patchset has had
enough reviews/versions/testing to be merged in 2.12.

Thanks Ilya and Ian for review comments on v9, they should all be addressed
in this v10. 

Thanks Malvika Gupta for testing (Tested-by tag added to patches) and also
for reporting ARM performance gains, see here for details:

Regards, -Harry

Patchset 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.

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.

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.

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 | 298 +++++++++++++++++++++++++++++++
 lib/dpif-netdev.c                | 195 ++++++++++----------
 lib/dpif-netdev.h                |  94 ++++++++++
 4 files changed, 491 insertions(+), 97 deletions(-)
 create mode 100644 lib/dpif-netdev-lookup-generic.c


More information about the dev mailing list