[dpdk-dev] [PATCH V2 0/5] table: add key mask for hash tables

Cristian Dumitrescu cristian.dumitrescu at intel.com
Tue Oct 10 13:18:56 CEST 2017

Main changes:

1. The key_mask parameter is added to all the hash tables that were
   previously missing it, as well to the hash compute function. This was
   first started in DPDK 2.0, but was only implemented for a couple of
   hash tables. The benefit of this approach is that it allows for better
   performance for large keys (bigger than 16 bytes), while it preserves
   the same performance for small keys [Q&A1].

2. The precomputed key signature (i.e. non-"do-sig") versions have been
   removed for all the hash tables, so now the key signature is always
   computed on every lookup. Note that this approach also allows for the
   precomputed key signature scheme [Q&A2].

3. API cleanup: single parameter structure common for all hash tables.


Q1: How is better lookup performance achieved by using key mask approach
   for hash tables?
A1: This approach eliminates the need to consolidate the lookup key in a
   single contiguous buffer where the relevant packet fields are written
   one by one, which is a very costly operation that also hash strong data

Q2: How can the pre-computed key signature scheme be implemented with
    current approach?
A2: The application can implement a straightforward custom hash function
    that simply reads the pre-computed key signature from a given offset
    in the input key buffer where it has been stored prior to the lookup

Cristian Dumitrescu (5):
  table: add key mask for hash tables
  test: update due to api changes in librte_table
  test-pipeline: update due to api changes in librte_table
  ip_pipeline: update due to api changes in librte_table
  deprecation: removed the librte_table notice

 doc/guides/rel_notes/deprecation.rst               |   6 -
 examples/ip_pipeline/pipeline/hash_func.h          | 178 +++--
 .../pipeline/pipeline_flow_classification.c        |  12 +-
 .../pipeline/pipeline_flow_classification_be.c     |  51 +-
 .../ip_pipeline/pipeline/pipeline_passthrough_be.c |  18 +-
 .../ip_pipeline/pipeline/pipeline_routing_be.c     |  18 +-
 lib/librte_table/rte_table_hash.h                  | 306 +--------
 lib/librte_table/rte_table_hash_cuckoo.c           | 205 +++---
 lib/librte_table/rte_table_hash_ext.c              | 417 ++++--------
 lib/librte_table/rte_table_hash_key16.c            | 749 ++++++---------------
 lib/librte_table/rte_table_hash_key32.c            | 435 +++++++-----
 lib/librte_table/rte_table_hash_key8.c             | 715 ++++++--------------
 lib/librte_table/rte_table_hash_lru.c              | 513 ++++++--------
 lib/librte_table/rte_table_version.map             |  23 +-
 test/test-pipeline/main.h                          |   5 +-
 test/test-pipeline/pipeline_hash.c                 | 107 +--
 test/test/test_table.c                             |   1 +
 test/test/test_table.h                             |   3 +-
 test/test/test_table_combined.c                    | 140 ++--
 test/test/test_table_tables.c                      | 148 ++--
 20 files changed, 1444 insertions(+), 2606 deletions(-)


More information about the dev mailing list