From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH] examples/l3fwd: fix segfault with gcc 5.x Date: Wed, 06 Apr 2016 11:27:17 +0200 Message-ID: <2020208.0hTbuSh3Wa@xps13> References: <1459781123-7556-1-git-send-email-tomaszx.kulasek@intel.com> <2601191342CEEE43887BDE71AB97725836B2E246@irsmsx105.ger.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org, "Ananyev, Konstantin" To: "Kulasek, TomaszX" Return-path: Received: from mail-wm0-f42.google.com (mail-wm0-f42.google.com [74.125.82.42]) by dpdk.org (Postfix) with ESMTP id A9CBE2956 for ; Wed, 6 Apr 2016 11:28:55 +0200 (CEST) Received: by mail-wm0-f42.google.com with SMTP id n3so54456835wmn.0 for ; Wed, 06 Apr 2016 02:28:55 -0700 (PDT) In-Reply-To: <2601191342CEEE43887BDE71AB97725836B2E246@irsmsx105.ger.corp.intel.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" > > It seems that with gcc >5.x and -O2/-O3 optimization breaks packet grouping > > algorithm. > > > > When last packet pointer "lp" and "pnum->u64" buffer points the same > > memory buffer, high optimization can cause unpredictable results. It seems > > that assignment of precalculated group sizes may interfere with > > initialization of new group size when lp points value inside current group > > and didn't should be changed. > > > > With gcc >5.x and optimization we cannot be sure which assignment will be > > done first, so the group size can be counted incorrectly. > > > > This patch eliminates intersection of assignment of initial group size > > (lp[0] = 1) and precalculated group sizes when gptbl[v].idx < 4. > > > > Fixes: 94c54b4158d5 ("examples/l3fwd: rework exact-match") > > > > Signed-off-by: Tomasz Kulasek > > Acked-by: Konstantin Ananyev Applied, thanks