Commit Graph

80 Commits

Author SHA1 Message Date
Kevin Laatz
ea7be0a038 lib/librte_table: add hash function headers
This commit adds rte_table_hash_func.h and rte_table_hash_func_arm64.h to
librte_table. This reduces code duplication by removing duplicate header
files within two folders and consolidating them into a single one. This
also adds a scalar implementation of the x86_64 intrinsic for crc32 as a
generic fallback.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
Acked-by: Gavin Hu <gavin.hu@arm.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
2018-10-12 17:58:53 +02:00
Jasvinder Singh
8ea4143883 table: add dedicated params struct for cuckoo hash
Add dedicated parameter structure for cuckoo hash. The cuckoo hash from
librte_hash uses slightly different prototype for the hash function (no
key_mask parameter, 32-bit seed and return value) that require either
of the following approaches:
   1/ Function pointer conversion: gcc 8.1 warning [1], misleading [2]
   2/ Union within the parameter structure: pollutes a very generic API
      parameter structure with some implementation dependent detail
      (i.e. key mask not available for one of the available
      implementations)
   3/ Using opaque pointer for hash function: same issue from 2/
   4/ Different parameter structure: avoid issue from 2/; hopefully,
      it won't be long before librte_hash implements the key mask feature,
      so the generic API structure could be used.

[1] http://www.dpdk.org/ml/archives/dev/2018-April/094950.html
[2] http://www.dpdk.org/ml/archives/dev/2018-April/096250.html

Fixes: 5a80bf0ae6 ("table: add cuckoo hash")

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2018-05-08 16:19:58 +02:00
Bruce Richardson
629dbf2aa3 build: remove checks for non-optional libraries
Unless a library cannot be built for a specific platform (generally
BSD), it will always be available. Therefore remove checks for IP
fragmentation and ACL libraries, since these are built for all
platforms.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
2018-04-17 16:09:43 +02:00
Jasvinder Singh
8173863865 table: remove incorrect check for ACL
Remove wrong check for table entry pointer.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
2018-04-04 12:26:20 +02:00
Andrew Rybchenko
14cfdf428d table: fix library version in meson build
Fixes: 5b9656b157 ("lib: build with meson")
Cc: stable@dpdk.org

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2018-03-28 00:07:35 +02:00
Bruce Richardson
6c9457c279 build: replace license text with SPDX tag
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Luca Boccassi <bluca@debian.org>
2018-01-30 21:58:59 +01:00
Bruce Richardson
5b9656b157 lib: build with meson
Add non-EAL libraries to DPDK build. The compat lib is a special case,
along with the previously-added EAL, but all other libs can be build using
the same set of commands, where the individual meson.build files only need
to specify their dependencies, source files, header files and ABI versions.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Keith Wiles <keith.wiles@intel.com>
Acked-by: Luca Boccassi <luca.boccassi@gmail.com>
2018-01-30 17:49:16 +01:00
Adrien Mazarguil
0d440d081c lib: fix missing includes in exported headers
Many exported headers rely on definitions found in rte_config.h without
including it, as shown by the following command:

 grep -L '^#include <rte_config.h>' -- \
  $(grep -Rl \
    $(sed -n '/^#define \([^ ]\+\).*$/{s//\1/;H;};${x;s/\n//;s/\n/\\|/g;p;}' \
      build/include/rte_config.h) \
    -- build/include/)

We cannot assume external applications will include rte_config.h on their
own, neither directly nor through a -include parameter like DPDK does
internally.

This not only causes obvious compilation failures that can be reproduced
with check-includes.sh such as:

 [...]/rte_memory.h:88:43: error: ‘RTE_CACHE_LINE_SIZE’ was not declared in
     this scope
  #define __rte_cache_aligned __rte_aligned(RTE_CACHE_LINE_SIZE)
                                            ^

It also results in less visible issues, for instance rte_hash_crc.h relying
on RTE_ARCH_X86_64's presence to provide dedicated inline functions.

This patch partially reverts the commit below and adds missing include
lines to the remaining files.

Fixes: f1a7a5c5f4 ("remove include of generated config header")
Cc: stable@dpdk.org

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
2018-01-17 00:31:05 +01:00
Jerin Jacob
baf3d63c15 lib: use SPDX tag for Cavium copyright files
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2018-01-09 16:19:01 +01:00
Bruce Richardson
369991d997 lib: use SPDX tag for Intel copyright files
Replace the BSD license header with the SPDX tag for files
with only an Intel copyright on them.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
2018-01-04 22:41:39 +01:00
Jasvinder Singh
dc3c853ce2 table: fix LRU hash table parameters check
Fixes the copy paste error in lru hash table parameters check.

Coverity issue: 198433
Fixes: b5cde2cb8c ("table: rework variable size key lru hash table")

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2017-11-07 02:00:01 +01:00
Cristian Dumitrescu
8b05d0be6a table: update library version
Updated map file to current API and bumped up ABI version.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2017-10-24 13:38:31 +02:00
Cristian Dumitrescu
4b08cd8927 table: update copyright
Removed incorrect white spaces and updated year in copyrigh headers.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2017-10-24 13:11:32 +02:00
Cristian Dumitrescu
9285f42303 table: apply cosmetic enhancements to API
Consolidated hash tables into functional groups.
Minor changes in comments.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2017-10-24 13:10:27 +02:00
Cristian Dumitrescu
71afef2c14 apps: add mask-based hash functions
Introduce mask-based hash functions in hash_func.h.

Propagate their usage in test/test, test/test-pipeline and
examples/ip_pipeline.

Remove the non-mask-based hash function prototype from API (which
was previously used as build workaround).

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2017-10-24 13:10:08 +02:00
Cristian Dumitrescu
ec35c73ec6 table: rework cuckoo hash table
Rework for the cuckoo hash table to use the unified parameter
structure.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2017-10-24 13:09:53 +02:00
Cristian Dumitrescu
ea31510376 table: rework 32-byte key hash tables
Rework for the 32-byte key hash tables (both the extendible
bucket and LRU)to use the mask-based hash function and the
unified parameter structure.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2017-10-24 13:09:28 +02:00
Cristian Dumitrescu
fc972a1305 table: rework 16-byte key hash tables
Rework for the 16-byte key hash tables (both the extendible
bucket and LRU)to use the mask-based hash function and the
unified parameter structure.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2017-10-24 13:09:12 +02:00
Cristian Dumitrescu
36842d0aee table: rework 8-byte key hash tables
Rework for the 8-byte key hash tables (both the extendible
bucket and LRU)to use the mask-based hash function and the
unified parameter structure.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2017-10-24 13:08:54 +02:00
Cristian Dumitrescu
b5cde2cb8c table: rework variable size key lru hash table
Rework for the variable size key LRU hash table to use the
mask-based hash function and the unified parameter structure.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2017-10-24 13:08:25 +02:00
Cristian Dumitrescu
6907931413 table: rework variable size key ext hash tables
Rework for the variable size key extendible bucket (EXT) hash
table to use the mask-based hash function and the unified
parameter structure.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2017-10-24 13:08:08 +02:00
Cristian Dumitrescu
2dc5198907 table: add unified params struct and mask-based hash func
Add unified parameter structure for all hash tables in librte_table.

Add mask-based hash function prototype, which is input parameter for
all hash tables.

Renamed the non-mask-based hash function prototype and all the calls
to it (to be removed later).

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2017-10-24 13:07:43 +02:00
Cristian Dumitrescu
1880e755f7 table: rename cuckoo hash table ops
The dosig particle is eliminated from the cuckoo hash ops name.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2017-10-24 13:07:19 +02:00
Cristian Dumitrescu
326223fea3 table: remove deprecated variable size key lru hash tables
The non-dosig version of the variable size key Least Recently Used
(LRU) hash tables are removed. The remaining hash tables are renamed
to eliminate the dosig particle from their name.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2017-10-24 13:07:04 +02:00
Cristian Dumitrescu
14c1477ca6 table: remove deprecated variable size key ext hash tables
The non-dosig version of the variable size key extendible bucket
hash tables are removed. The remaining hash tables are renamed to
eliminate the dosig particle from their name.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2017-10-24 13:06:42 +02:00
Cristian Dumitrescu
092cbc3de6 table: remove deprecated 16-byte key hash tables
The non-dosig version of the 16-byte key hash tables (both extendable
bucket and LRU) are removed. The remaining hash tables are renamed to
eliminate the dosig particle from their name.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2017-10-24 13:06:25 +02:00
Cristian Dumitrescu
4f1c1fa142 table: remove deprecated 8-byte key hash tables
The non-dosig version of the 8-byte key hash tables (both extendable
bucket and LRU) are removed. The remaining hash tables are renamed to
eliminate the dosig particle from their name.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2017-10-24 13:05:51 +02:00
Olivier Matz
cbc12b0a96 mk: do not generate LDLIBS from directory dependencies
The list of libraries in LDLIBS was generated from the DEPDIRS-xyz
variable. This is valid when the subdirectory name match the library
name, but it's not always the case, especially for PMDs.

The patches removes this feature and explicitly adds the proper
libraries in LDLIBS.

Some DEPDIRS-xyz variables become useless, remove them.

Reported-by: Gage Eads <gage.eads@intel.com>
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Gage Eads <gage.eads@intel.com>
2017-10-24 02:14:57 +02:00
Jerin Jacob
3abcd29f2d update Cavium Inc copyright headers
Replace the incorrect reference to "Cavium Networks", "Cavium Ltd"
company name with correct the "Cavium, Inc" company name in
copyright headers.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
2017-07-08 17:43:49 +02:00
Ashwin Sekhar T K
266451e419 eal: move gcc version definition to common header
Moved the definition of GCC_VERSION from lib/librte_table/rte_lru.h
to lib/librte_eal/common/include/rte_common.h.

Tested compilation on:
 * arm64 with gcc
 * x86 with gcc and clang

Signed-off-by: Ashwin Sekhar T K <ashwin.sekhar@caviumnetworks.com>
Reviewed-by: Jan Viktorin <viktorin@rehivetech.com>
Acked-by: Jianbo Liu <jianbo.liu@linaro.org>
2017-07-04 15:57:22 +02:00
Bruce Richardson
887c272fab table: remove check for SSE4
Since SSE4 is now part of the minimum requirements for DPDK, we don't need
the scalar version on x86.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2017-07-04 14:39:18 +02:00
Ashwin Sekhar T K
47e15e618a table: add NEON implementation of LRU strategy 3
* Added new file rte_lru_arm64.h for holding arm64 specific
  definitions
* Verified the changes with table_autotest unit test case

Signed-off-by: Ashwin Sekhar T K <ashwin.sekhar@caviumnetworks.com>
2017-07-03 17:15:47 +02:00
Ashwin Sekhar T K
1e29a16248 table: separate out x86-specific from LRU header
* Moved all x86 related lru defines to rte_lru_x86.h while
  retaining all common defines in rte_lru.h
* Verified the changes with table_autotest unit test case

Signed-off-by: Ashwin Sekhar T K <ashwin.sekhar@caviumnetworks.com>
2017-07-03 16:54:01 +02:00
Aleksey Katargin
c1e07f036d table: fix stats update
Fixed stats double update.

Signed-off-by: Aleksey Katargin <gureedo@gmail.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2017-04-21 01:29:21 +02:00
Stephen Hemminger
c5ba278876 lib: remove unnecessary void cast
Remove unnecessary casts of void * pointers to a specific type.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2017-04-11 18:05:10 +02:00
Olivier Matz
feb9f680cd mk: optimize directory dependencies
Before this patch, the management of dependencies between directories
had several issues:

- the generation of .depdirs, done at configuration is slow: it can take
  more than one minute on some slow targets (usually ~10s on a standard
  PC without -j).

- for instance, it is possible to express a dependency like:
  - app/foo depends on lib/librte_foo
  - and lib/librte_foo depends on app/bar
  But this won't work because the directories are traversed with a
  depth-first algorithm, so we have to choose between doing 'app' before
  or after 'lib'.

- the script depdirs-rule.sh is too complex.

- we cannot use "make -d" for debug, because the output of make is used for
  the generation of .depdirs.

This patch moves the DEPDIRS-* variables in the upper Makefile, making
the dependencies much easier to calculate. A DEPDIRS variable is still
used to process library dependencies in LDLIBS.

After this commit, "make config" is almost immediate.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Tested-by: Robin Jarry <robin.jarry@6wind.com>
Tested-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
2017-03-27 23:28:43 +02:00
Vladyslav Buslov
d89a5bce1d lpm6: extend next hop field
This patch extend next_hop field from 8-bits to 21-bits in LPM library
for IPv6.

Added versioning symbols to functions and updated
library and applications that have a dependency on LPM library.

Signed-off-by: Vladyslav Buslov <vladyslav.buslov@harmonicinc.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2017-03-15 18:49:41 +01:00
Michał Mirosław
c6c7a8d7e6 acl: allow zero verdict
This enables ACL matches to return 0 where the distinction
from no-match case is not needed.

Signed-off-by: Michał Mirosław <michal.miroslaw@atendesoftware.pl>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2017-01-30 11:08:47 +01:00
Guruprasad Rao
5a80bf0ae6 table: add cuckoo hash
This patch provides table apis for dosig version of cuckoo hash
via  rte_table_hash_cuckoo_dosig_ops

The following apis are implemented for cuckoo hash
	rte_table_hash_cuckoo_create
	rte_table_hash_cuckoo_free
	rte_table_hash_cuckoo_entry_add
	rte_table_hash_cuckoo_entry_delete
	rte_table_hash_cuckoo_lookup_dosig
	rte_table_hash_cuckoo_stats_read

Signed-off-by: Sankar Chokkalingam <sankarx.chokkalingam@intel.com>
Signed-off-by: Guruprasad Rao <guruprasadx.rao@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2016-10-12 22:08:36 +02:00
Gowrishankar Muthukrishnan
43f15e2837 table: fix verification on hash bucket header alignment
In powerpc systems, rte table hash structs rte_bucket_4_8, rte_bucket_4_16 and
rte_bucket_4_32 are not cache aligned and hence verification on same would fail.
Instead of checking alignment on cpu cacheline, it could equally be tested as
multiple of 64 bytes.

Signed-off-by: Gowrishankar Muthukrishnan <gowrishankar.m@linux.vnet.ibm.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2016-09-09 17:56:25 +02:00
Aleksey Katargin
322a8d2b89 table: fix symbol exports
Fixes: 8aa327214c ("table: hash")
Fixes: 68866e2417 ("table: add 16-byte hash operations computed on lookup")

Signed-off-by: Aleksey Katargin <gureedo@gmail.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2016-08-22 22:59:05 +02:00
Thomas Monjalon
d7a4bb1549 table: remove unneeded dependency on hash library
Fixes: 8aa327214c ("table: hash")

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2016-07-10 16:23:13 +02:00
Michal Kobylinski
34d279906d table: fix next hop table entry type
Change type of nht field from uint32_t to uint8_t and increase max of
next hops.

nht_entry and nht should be declared as uint8_t because
entry_size is in bytes and is given as a parameter to compute
the position in nht array.

Fixes: dc81ebbaca ("lpm: extend IPv4 next hop field")

Signed-off-by: Michal Kobylinski <michalx.kobylinski@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2016-06-21 22:41:40 +02:00
Jasvinder Singh
aaa69e5db4 table: remove unnecessary acl dump
Removes rte_acl_dump() call from rte_table_acl_build () as it invokes
number of printf messages.

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2016-06-07 22:58:18 +02:00
Michal Kobylinski
f1f7261838 lpm: add a new config structure for IPv4
A new rte_lpm_config structure is used so LPM library will allocate
exactly the amount of memory which is necessary to hold application’s
rules.

Signed-off-by: Michal Kobylinski <michalx.kobylinski@intel.com>
Acked-by: David Hunt <david.hunt@intel.com>
2016-03-09 23:05:05 +01:00
Michal Kobylinski
dc81ebbaca lpm: extend IPv4 next hop field
This patch extend next_hop field from 8-bits to 24-bits in LPM library
for IPv4.

Added versioning symbols to functions and updated
library and applications that have a dependency on LPM library.

Signed-off-by: Michal Kobylinski <michalx.kobylinski@intel.com>
Acked-by: David Hunt <david.hunt@intel.com>
2016-03-09 22:57:43 +01:00
Thomas Monjalon
4b15247150 doc: drop old naming of the project
It was requested by Intel, more than one year ago, to replace the name
"Intel DPDK" by "DPDK".
Some references to the old name were still in some docs and code comments,
leading to confusion.

Fixes: ac8ada004c ("doc: remove Intel references from release notes")

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2016-02-10 15:47:51 +01:00
Fan Zhang
e37d9d7655 table: improve lookup performance with prefetch offset
This patch modifies rte_prefetch offsets to improve hash/lru
table lookup performance.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2015-11-26 00:45:50 +01:00
Fan Zhang
68866e2417 table: add 16-byte hash operations computed on lookup
This patch is to adding hash table operations for key signature
computed on lookup ("do-sig") for LRU hash tables and Extendible buckets.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2015-11-26 00:45:50 +01:00
Fan Zhang
fc6bcc6fee table: add key mask to 8 and 16-byte hash parameters
This patch relates to ABI change proposed for librte_table.
The key_mask parameter is added for 8-byte and 16-byte
key extendible bucket and LRU tables.The release notes
is updated and the deprecation notice is removed.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2015-11-26 00:45:50 +01:00