On Fri, Jul 06, 2018 at 07:59:22PM +0300, Alex Kiselev wrote: > Please see inline replies > > > 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 <a...@therouter.net> > > > Hi, > > > Some initial review comments inline below > > > /Bruce > >> --- > >> lib/librte_lpm/rte_lpm6.c | 1073 > >> ++++++++++++++++++++++++++++++++++----------- > >> 1 file changed, 816 insertions(+), 257 deletions(-) > <snip> > >> +/* > >> + * LPM6 rule hash function > >> + */ > >> +static inline uint32_t > >> +rule_hash_crc(const void *data, __rte_unused uint32_t data_len, > >> + uint32_t init_val) > >> +{ > >> + return rte_hash_crc(data, sizeof(struct rte_lpm6_rule_key), > >> init_val); > >> +} > > > Why bother passing in the length and making the data a void pointer. > > I beleive it should be compatible with the rte_hash_function prototype.
Ah, ok, you are passing this to rte_hash. Makes sense now. I suggest putting in a comment explaining why you have the extra unused parameter so.