[dpdk-dev] [PATCH v2] librte_lpm: Improve performance of the delete and add functions

Bruce Richardson bruce.richardson at intel.com
Fri Jul 6 12:25:36 CEST 2018


On Fri, Jul 06, 2018 at 11:13:53AM +0100, Bruce Richardson wrote:
> On Mon, Jul 02, 2018 at 07:42:11PM +0300, Alex Kiselev wrote:
> > There are two major problems with the library:
> > first, there is no need to rebuild the whole LPM tree
> > when a rule is deleted and second, due to the current
> > rules algorithm with complexity O(n) it's almost
> > impossible to deal with large rule sets (50k or so rules).
> > This patch addresses those two issues.
> > 
> > Signed-off-by: Alex Kiselev <alex at therouter.net>
> > ---
> >  lib/librte_lpm/rte_lpm6.c | 1073 ++++++++++++++++++++++++++++++++++-----------
> >  1 file changed, 816 insertions(+), 257 deletions(-)
> > 
> 
> I get a compiler error with gcc8 after this patch:
> 
> /home/bruce/dpdk.org/lib/librte_lpm/rte_lpm6.c: In function ‘rte_lpm6_add_v1705’:
> /home/bruce/dpdk.org/lib/librte_lpm/rte_lpm6.c:748:18: error: ‘tbl_next_num’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
>     lpm->tbl8_hdrs[tbl_ind].ref_cnt++;
>             ^
> 

On fixing this, clang errors show up thereafter. I suggest using
"test-meson-builds.sh" to sanity check compile on the patch.

Thanks,
/Bruce

ccache clang -Ilib/lib@@rte_lpm at sta -Ilib -I../lib -Ilib/librte_lpm -I../lib/librte_lpm -I. -I../ -Iconfig -I../config -Ilib/librte_eal/common -I../lib/librte_eal/common -Ilib/librte_eal/common/include -I../lib/librte_eal/common/include -Ilib/librte_eal/common/include/arch/x86 -I../lib/librte_eal/common/include/arch/x86 -I../lib/librte_eal/linuxapp/eal/include -Ilib/librte_eal/linuxapp/eal/../../../librte_compat -I../lib/librte_eal/linuxapp/eal/../../../librte_compat -Ilib/librte_eal -I../lib/librte_eal -Ilib/librte_compat -I../lib/librte_compat -Ilib/librte_mempool -I../lib/librte_mempool -Ilib/librte_ring -I../lib/librte_ring -Ilib/librte_hash -I../lib/librte_hash -Xclang -fcolor-diagnostics -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Werror -O3 -include rte_config.h -Wsign-compare -Wcast-qual -Wno-address-of-packed-member -fPIC -march=native  -MD -MQ 'lib/lib@@rte_lpm at sta/librte_lpm_rte_lpm6.c.o' -MF 'lib/lib@@rte_lpm at sta/librte_lpm_rte_lpm6.c.o.d' -o 'lib/lib@@rte_lpm at sta/librte_lpm_rte_lpm6.c.o' -c ../lib/librte_lpm/rte_lpm6.c
../lib/librte_lpm/rte_lpm6.c:233:58: error: cast from 'struct rte_lpm6_rule **' to 'const void **' must have all intermediate pointers const qualified to be safe [-Werror,-Wcast-qual]
        while (rte_hash_iterate(lpm->rules_tbl, (const void **) &rule_key,
                                                                ^
../lib/librte_lpm/rte_lpm6.c:247:58: error: cast from 'struct rte_lpm6_rule **' to 'const void **' must have all intermediate pointers const qualified to be safe [-Werror,-Wcast-qual]
        while (rte_hash_iterate(lpm->rules_tbl, (const void **) &rule_key,
                                                                ^



More information about the dev mailing list