2017-12-19 15:49:03 +00:00
|
|
|
# SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
# Copyright(c) 2010-2015 Intel Corporation
|
2012-09-04 12:54:00 +00:00
|
|
|
|
|
|
|
include $(RTE_SDK)/mk/rte.vars.mk
|
|
|
|
|
|
|
|
# library name
|
|
|
|
LIB = librte_hash.a
|
|
|
|
|
|
|
|
CFLAGS += -O3
|
|
|
|
CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR)
|
2017-10-12 16:04:21 +00:00
|
|
|
LDLIBS += -lrte_eal -lrte_ring
|
2012-09-04 12:54:00 +00:00
|
|
|
|
2015-02-02 17:40:20 +00:00
|
|
|
EXPORT_MAP := rte_hash_version.map
|
|
|
|
|
2015-09-04 09:05:40 +00:00
|
|
|
LIBABIVER := 2
|
2015-02-02 17:40:21 +00:00
|
|
|
|
2012-09-04 12:54:00 +00:00
|
|
|
# all source are stored in SRCS-y
|
hash: replace with cuckoo hash implementation
This patch replaces the existing hash library with another approach,
using the Cuckoo Hash method to resolve collisions (open addressing),
which pushes items from a full bucket when a new entry tries
to be added in it, storing the evicted entry in an alternative location,
using a secondary hash function.
This gives the user the ability to store more entries when a bucket
is full, in comparison with the previous implementation.
Therefore, the unit test has been updated, as some scenarios have changed
(such as the previous removed restriction).
Also note that the API has not been changed, although new fields
have been added in the rte_hash structure (structure is internal now).
The main change when creating a new table is that the number of entries
per bucket is fixed now, so its parameter is ignored now
(still there to maintain the same parameters structure).
The hash unit test has been updated to reflect these changes.
As a last note, the maximum burst size in lookup_burst function
hash been increased to 64, to improve performance.
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2015-07-11 00:18:50 +00:00
|
|
|
SRCS-$(CONFIG_RTE_LIBRTE_HASH) := rte_cuckoo_hash.c
|
2012-09-04 12:54:00 +00:00
|
|
|
SRCS-$(CONFIG_RTE_LIBRTE_HASH) += rte_fbk_hash.c
|
|
|
|
|
|
|
|
# install this header file
|
|
|
|
SYMLINK-$(CONFIG_RTE_LIBRTE_HASH)-include := rte_hash.h
|
|
|
|
SYMLINK-$(CONFIG_RTE_LIBRTE_HASH)-include += rte_hash_crc.h
|
2015-11-23 18:45:36 +00:00
|
|
|
ifeq ($(CONFIG_RTE_ARCH_ARM64),y)
|
2017-05-12 05:45:43 +00:00
|
|
|
ifneq ($(findstring RTE_MACHINE_CPUFLAG_CRC32,$(CFLAGS)),)
|
2015-11-23 18:45:36 +00:00
|
|
|
SYMLINK-$(CONFIG_RTE_LIBRTE_HASH)-include += rte_crc_arm64.h
|
|
|
|
endif
|
2017-05-12 05:45:43 +00:00
|
|
|
endif
|
2012-09-04 12:54:00 +00:00
|
|
|
SYMLINK-$(CONFIG_RTE_LIBRTE_HASH)-include += rte_jhash.h
|
2015-06-30 23:40:20 +00:00
|
|
|
SYMLINK-$(CONFIG_RTE_LIBRTE_HASH)-include += rte_thash.h
|
2012-09-04 12:54:00 +00:00
|
|
|
SYMLINK-$(CONFIG_RTE_LIBRTE_HASH)-include += rte_fbk_hash.h
|
|
|
|
|
|
|
|
include $(RTE_SDK)/mk/rte.lib.mk
|