[dpdk-stable] patch 'examples/l3fwd: fix aliasing in port grouping' has been queued to stable release 17.08.1

Yuanhan Liu yliu at fridaylinux.org
Tue Nov 21 14:18:44 CET 2017


Hi,

FYI, your patch has been queued to stable release 17.08.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 11/24/17. So please
shout if anyone has objections.

Thanks.

	--yliu

---
>From c592d2de222f21cbed30470654d855ee8bfeb115 Mon Sep 17 00:00:00 2001
From: Guduri Prathyusha <gprathyusha at caviumnetworks.com>
Date: Fri, 3 Nov 2017 16:13:51 +0530
Subject: [PATCH] examples/l3fwd: fix aliasing in port grouping

[ upstream commit 01ac23460c36927e019473e71b582223ad6b79c5 ]

With -f-strict-aliasing enabled by default from -O2, gcc > 5.x gives
undefined behavior in port_groupx4 in ARM. 'pn' and 'pnum' are
two different pointers pointing to same chunk of memory and
with -f-strict-aliasing the pointers are assumed to be pointing to
different memory and compiler reorders instructions that depend on
pnum and pn. This breaks port grouping algorithm.

This patch eliminates the above problem by introducing a compiler
barrier between the instructions that depend on pnum, pn and lp.

Fixes: 569b290cdb36 ("examples/l3fwd: add NEON implementation")

Signed-off-by: Guduri Prathyusha <gprathyusha at caviumnetworks.com>
Acked-by: Jerin Jacob <jerin.jacob at caviumnetworks.com>
Acked-by: Jianbo Liu <jianbo.liu at arm.com>
---
 examples/l3fwd/l3fwd_neon.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/examples/l3fwd/l3fwd_neon.h b/examples/l3fwd/l3fwd_neon.h
index 4bc1613..b319b5a 100644
--- a/examples/l3fwd/l3fwd_neon.h
+++ b/examples/l3fwd/l3fwd_neon.h
@@ -114,6 +114,7 @@ port_groupx4(uint16_t pn[FWDSTEP + 1], uint16_t *lp, uint16x8_t dp1,
 
 	/* update last port counter. */
 	lp[0] += gptbl[v].lpv;
+	rte_compiler_barrier();
 
 	/* if dest port value has changed. */
 	if (v != GRPMSK) {
-- 
2.7.4



More information about the stable mailing list