Re: [PATCH RFC net-next 18/18] net/ipv4: Optimization for fib_info lookup

2018-09-04 Thread David Ahern
On 9/1/18 2:43 PM, Stephen Hemminger wrote: > On Fri, 31 Aug 2018 17:49:53 -0700 > dsah...@kernel.org wrote: > >> +static inline unsigned int fib_info_hashfn_cfg(const struct fib_config *cfg) >> +{ >> +unsigned int mask = (fib_info_hash_size - 1); >> +unsigned int val = 0; >> + >> +val

Re: [PATCH RFC net-next 18/18] net/ipv4: Optimization for fib_info lookup

2018-09-01 Thread Stephen Hemminger
On Fri, 31 Aug 2018 17:49:53 -0700 dsah...@kernel.org wrote: > +static inline unsigned int fib_info_hashfn_cfg(const struct fib_config *cfg) > +{ > + unsigned int mask = (fib_info_hash_size - 1); > + unsigned int val = 0; > + > + val ^= (cfg->fc_protocol << 8) | cfg->fc_scope; Why do

[PATCH RFC net-next 18/18] net/ipv4: Optimization for fib_info lookup

2018-08-31 Thread dsahern
From: David Ahern Be optimistic about re-using a fib_info when nexthop id is given and the route does not use metrics. Avoids a memory allocation which in most cases is expected to be freed anyways. Signed-off-by: David Ahern --- net/ipv4/fib_semantics.c | 48 ++