From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Ahern Subject: Re: [PATCH RFC net-next 18/18] net/ipv4: Optimization for fib_info lookup Date: Tue, 4 Sep 2018 09:27:17 -0600 Message-ID: <9b50b920-5b62-fdcd-6648-0d0756c23df9@gmail.com> References: <20180901004954.7145-1-dsahern@kernel.org> <20180901004954.7145-19-dsahern@kernel.org> <20180901134334.5fc199fb@xeon-e3> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, roopa@cumulusnetworks.com, sharpd@cumulusnetworks.com, idosch@mellanox.com, davem@davemloft.net To: Stephen Hemminger , dsahern@kernel.org Return-path: Received: from mail-pf1-f194.google.com ([209.85.210.194]:41595 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727057AbeIDTwz (ORCPT ); Tue, 4 Sep 2018 15:52:55 -0400 Received: by mail-pf1-f194.google.com with SMTP id h79-v6so1862034pfk.8 for ; Tue, 04 Sep 2018 08:27:20 -0700 (PDT) In-Reply-To: <20180901134334.5fc199fb@xeon-e3> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 9/1/18 2:43 PM, Stephen Hemminger wrote: > On Fri, 31 Aug 2018 17:49:53 -0700 > dsahern@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 assignment to 0 than do initial xor? > Why not instead just do assignment in the first statement which would be clearer. > Side effect of copy-paste-adjust of the original. Will fix for the next rfc (really need to not have 2 versions of the hashfn; need to think through it).