Skip to contentSkip to conversation

rte_lpm_add in librte_lpm

DISCUSSION Jan Sacha 1 participant 1 message Sep 6, 2014

lore
Share & tools
lore

Jan Sacha

author
#0 lore raw

Hi,

I've been playing with DPDK and I got some crashes in the LPM module. As far as I know, this problem has not been reported yet. These crashes happened in DPDK 1.7.0 and 1.6.0r2 (I didn't check other versions) when I added new LPM routes.

In the lib/librte_lpm/rte_lpm.c file, line 399 (add_depth_small function), there is the following condition:

if (!lpm->tbl24[i].valid || (lpm->tbl24[i].ext_entry == 0 && lpm->tbl24[i].depth <= depth))

If the new route has a lower depth than an existing non-extended entry, this condition is not met. We then skip to line 418, where we assume the entry is extended and use an uninitialized index. Is this a bug?

Thanks,
Jan