From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 474FE1BDF4 for ; Fri, 6 Jul 2018 12:25:54 +0200 (CEST) X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Jul 2018 03:25:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,315,1526367600"; d="scan'208";a="243105135" Received: from bricha3-mobl.ger.corp.intel.com ([10.237.221.107]) by fmsmga005.fm.intel.com with SMTP; 06 Jul 2018 03:25:37 -0700 Received: by (sSMTP sendmail emulation); Fri, 06 Jul 2018 11:25:37 +0100 Date: Fri, 6 Jul 2018 11:25:36 +0100 From: Bruce Richardson To: Alex Kiselev Cc: "dev@dpdk.org" Message-ID: <20180706102536.GC6220@bricha3-MOBL.ger.corp.intel.com> References: <20180706101352.GA6220@bricha3-MOBL.ger.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <20180706101352.GA6220@bricha3-MOBL.ger.corp.intel.com> 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: Fri, 06 Jul 2018 10:25:54 -0000 On Fri, Jul 06, 2018 at 11:13:53AM +0100, Bruce Richardson wrote: > 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. > >=20 > > Signed-off-by: Alex Kiselev > > --- > > lib/librte_lpm/rte_lpm6.c | 1073 ++++++++++++++++++++++++++++++++++---= -------- > > 1 file changed, 816 insertions(+), 257 deletions(-) > >=20 >=20 > I get a compiler error with gcc8 after this patch: >=20 > /home/bruce/dpdk.org/lib/librte_lpm/rte_lpm6.c: In function =E2=80=98rte_= lpm6_add_v1705=E2=80=99: > /home/bruce/dpdk.org/lib/librte_lpm/rte_lpm6.c:748:18: error: =E2=80=98tb= l_next_num=E2=80=99 may be used uninitialized in this function [-Werror=3Dm= aybe-uninitialized] > lpm->tbl8_hdrs[tbl_ind].ref_cnt++; > ^ >=20 On fixing this, clang errors show up thereafter. I suggest using "test-meson-builds.sh" to sanity check compile on the patch. Thanks, /Bruce ccache clang -Ilib/lib@@rte_lpm@sta -Ilib -I../lib -Ilib/librte_lpm -I../li= b/librte_lpm -I. -I../ -Iconfig -I../config -Ilib/librte_eal/common -I../li= b/librte_eal/common -Ilib/librte_eal/common/include -I../lib/librte_eal/com= mon/include -Ilib/librte_eal/common/include/arch/x86 -I../lib/librte_eal/co= mmon/include/arch/x86 -I../lib/librte_eal/linuxapp/eal/include -Ilib/librte= _eal/linuxapp/eal/../../../librte_compat -I../lib/librte_eal/linuxapp/eal/.= =2E/../../librte_compat -Ilib/librte_eal -I../lib/librte_eal -Ilib/librte_c= ompat -I../lib/librte_compat -Ilib/librte_mempool -I../lib/librte_mempool -= Ilib/librte_ring -I../lib/librte_ring -Ilib/librte_hash -I../lib/librte_has= h -Xclang -fcolor-diagnostics -pipe -D_FILE_OFFSET_BITS=3D64 -Wall -Winvali= d-pch -Werror -O3 -include rte_config.h -Wsign-compare -Wcast-qual -Wno-add= ress-of-packed-member -fPIC -march=3Dnative -MD -MQ 'lib/lib@@rte_lpm@sta/= librte_lpm_rte_lpm6.c.o' -MF 'lib/lib@@rte_lpm@sta/librte_lpm_rte_lpm6.c.o.= d' -o 'lib/lib@@rte_lpm@sta/librte_lpm_rte_lpm6.c.o' -c ../lib/librte_lpm/r= te_lpm6.c =2E./lib/librte_lpm/rte_lpm6.c:233:58: error: cast from 'struct rte_lpm6_ru= le **' to 'const void **' must have all intermediate pointers const qualifi= ed to be safe [-Werror,-Wcast-qual] while (rte_hash_iterate(lpm->rules_tbl, (const void **) &rule_key, ^ =2E./lib/librte_lpm/rte_lpm6.c:247:58: error: cast from 'struct rte_lpm6_ru= le **' to 'const void **' must have all intermediate pointers const qualifi= ed to be safe [-Werror,-Wcast-qual] while (rte_hash_iterate(lpm->rules_tbl, (const void **) &rule_key, ^