From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 562285F21 for ; Mon, 9 Jul 2018 11:08:05 +0200 (CEST) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Jul 2018 02:08:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,329,1526367600"; d="scan'208";a="71150506" Received: from bricha3-mobl.ger.corp.intel.com ([10.237.221.107]) by orsmga001.jf.intel.com with SMTP; 09 Jul 2018 02:07:23 -0700 Received: by (sSMTP sendmail emulation); Mon, 09 Jul 2018 10:07:22 +0100 Date: Mon, 9 Jul 2018 10:07:21 +0100 From: Bruce Richardson To: Alex Kiselev Cc: "dev@dpdk.org" Message-ID: <20180709090721.GA20456@bricha3-MOBL.ger.corp.intel.com> References: <20180706161640.GA24764@bricha3-MOBL.ger.corp.intel.com> <710674507.20180706195922@therouter.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <710674507.20180706195922@therouter.net> Organization: Intel Research and Development Ireland Ltd. User-Agent: Mutt/1.10.0 (2018-05-17) Subject: Re: [dpdk-dev] [PATCH v2] librte_lpm: Improve performance of the delete and add functions X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jul 2018 09:08:05 -0000 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 > > > Hi, > > > Some initial review comments inline below > > > /Bruce > >> --- > >> lib/librte_lpm/rte_lpm6.c | 1073 ++++++++++++++++++++++++++++++++++----------- > >> 1 file changed, 816 insertions(+), 257 deletions(-) > > >> +/* > >> + * 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.