Skip to contentSkip to conversation

librte_lpm: Improve performance of the delete and add functions

PATCH In review Alex Kiselev 2 participants 2 messages Sep 18, 2018 – Sep 19, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v7 1/2 librte_lpm: Improve performance of the delete and add functions

lpm6: store rules in hash table for lpm6

Rework the lpm6 rule subsystem and replace current rules algorithm complexity O(n) with hashtables which allow dealing with large (50k) rule sets.

---
 lib/Makefile               |   2 +-
 lib/librte_lpm/Makefile    |   2 +-
 lib/librte_lpm/meson.build |   1 +
 lib/librte_lpm/rte_lpm6.c  | 368 +++++++++++++++++++++++++--------------------
 4 files changed, 210 insertions(+), 163 deletions(-)
lib/Makefile +1 -1
index d82462ba2..070104657 100644
@@ -47,7 +47,7 @@ DEPDIRS-librte_hash := librte_eal librte_ring
 DIRS-$(CONFIG_RTE_LIBRTE_EFD) += librte_efd
 DEPDIRS-librte_efd := librte_eal librte_ring librte_hash
 DIRS-$(CONFIG_RTE_LIBRTE_LPM) += librte_lpm
-DEPDIRS-librte_lpm := librte_eal
+DEPDIRS-librte_lpm := librte_eal librte_hash
 DIRS-$(CONFIG_RTE_LIBRTE_ACL) += librte_acl
 DEPDIRS-librte_acl := librte_eal
 DIRS-$(CONFIG_RTE_LIBRTE_MEMBER) += librte_member
lib/librte_lpm/Makefile +1 -1
index 482bd72e9..a7946a1c5 100644
@@ -8,7 +8,7 @@ LIB = librte_lpm.a
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR)
-LDLIBS += -lrte_eal
+LDLIBS += -lrte_eal -lrte_hash
 
 EXPORT_MAP := rte_lpm_version.map
 
lib/librte_lpm/meson.build +1 -0
index 067849427..a5176d8ae 100644
@@ -7,3 +7,4 @@ headers = files('rte_lpm.h', 'rte_lpm6.h')
 # since header files have different names, we can install all vector headers
 # without worrying about which architecture we actually need
 headers += files('rte_lpm_altivec.h', 'rte_lpm_neon.h', 'rte_lpm_sse.h')
+deps += ['hash']
lib/librte_lpm/rte_lpm6.c +207 -161

563 lines not on this page · raw message

Signature · 1 line
2.16.1.windows.1