Skip to contentSkip to conversation

crc: deinline crc functions

PATCH In review Stephen Hemminger 2 participants 2 messages Oct 1, 2015 – Oct 13, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 crc: deinline crc functions

Because the CRC functions are inline and defined purely in the header file, every component that uses these functions gets its own copy of the software CRC table which is a big space waster.

Just deinline which give better long term ABI stablity anyway.

---
 app/test/test_hash_functions.c |   1 +
 lib/librte_hash/Makefile       |   1 +
 lib/librte_hash/rte_hash_crc.c | 488 +++++++++++++++++++++++++++++++++++++++++
 lib/librte_hash/rte_hash_crc.h | 458 +-------------------------------------
 4 files changed, 495 insertions(+), 453 deletions(-)
 create mode 100644 lib/librte_hash/rte_hash_crc.c
app/test/test_hash_functions.c +1 -0
index 3ad6d80..345ca88 100644
@@ -44,6 +44,7 @@
 #include <rte_hash.h>
 #include <rte_jhash.h>
 #include <rte_hash_crc.h>
+#include <rte_common.h>
 
 #include "test.h"
 
lib/librte_hash/Makefile +1 -0
index 7902c2b..a16a6d9 100644
@@ -44,6 +44,7 @@ LIBABIVER := 2
 # all source are stored in SRCS-y
 SRCS-$(CONFIG_RTE_LIBRTE_HASH) := rte_cuckoo_hash.c
 SRCS-$(CONFIG_RTE_LIBRTE_HASH) += rte_fbk_hash.c
+SRCS-$(CONFIG_RTE_LIBRTE_HASH) += rte_hash_crc.c
 
 # install this header file
 SYMLINK-$(CONFIG_RTE_LIBRTE_HASH)-include := rte_hash.h
lib/librte_hash/rte_hash_crc.c new file +488 -0

488 lines not on this page · raw message

lib/librte_hash/rte_hash_crc.h +5 -453

494 lines not on this page · raw message

Signature · 1 line
2.1.4
#1 lore raw
Quoted 7 lines

-----Original Message-----
From: Stephen Hemminger [mailto:[email protected]]
Sent: Friday, October 2, 2015 12:38 AM
To: Richardson, Bruce; De Lara Guarch, Pablo
Cc: [email protected]; Stephen Hemminger
Subject: [PATCH] crc: deinline crc functions

Quoted 7 lines

Because the CRC functions are inline and defined purely in the header file, every component that uses these functions gets its own copy of the software CRC table which is a big space waster.

Just deinline which give better long term ABI stablity anyway.

While I think it's a good idea to de-inline the functions that do the calculations using the lookup tables, I think the functions that consist of a single assembly instruction should be kept as inline.

/Bruce