From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH v2] net: fix build with gcc 4.4.7 and strict aliasing Date: Tue, 24 Nov 2015 14:42:44 -0800 Message-ID: <20151124144244.0ecf7627@xeon-e3> References: <1448377959-4440-1-git-send-email-danielx.t.mrzyglod@intel.com> <1448382678-6060-1-git-send-email-danielx.t.mrzyglod@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org To: Daniel Mrzyglod Return-path: Received: from mail-pa0-f54.google.com (mail-pa0-f54.google.com [209.85.220.54]) by dpdk.org (Postfix) with ESMTP id DE5F23772 for ; Tue, 24 Nov 2015 23:42:36 +0100 (CET) Received: by pacdm15 with SMTP id dm15so35470724pac.3 for ; Tue, 24 Nov 2015 14:42:36 -0800 (PST) In-Reply-To: <1448382678-6060-1-git-send-email-danielx.t.mrzyglod@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" On Tue, 24 Nov 2015 17:31:17 +0100 Daniel Mrzyglod wrote: > This fix is for IPv6 checksum offload error on RHEL65. > Any optimalisation above -O0 provide error in IPv6 checksum > flag "-fstrict-aliasing" is default for optimalisation above -O0. > The solution is to add typedef with __attribute__((__may_alias__) for uint16_t. > > Step 1 : start testpmd > ./testpmd -c 0x6 -n 4 -- -i --portmask=0x3 --disable-hw-vlan --enable-rx-cksum --crc-strip --txqflags=0 > > Step 2 : settings and start > set verbose 1 > set fwd csum > start > > Step 3 : send scapy with bad checksum IPv6/TCP packet > Ether(src="52:00:00:00:00:00", dst="90:e2:ba:4a:33:5d")/IPv6(src="::1")/TCP(chksum=0xf)/("X"*46) > > Step 4 : Recieved packets: > RESULTS: > IPv6/TCP': ['0xd41'] or other unexpected. > > EXPECTED RESULTS: > IPv6/TCP': ['0x9f5e'] > > Daniel Mrzyglod (1): > net: fix build with gcc 4.4.7 and strict aliasing > > lib/librte_net/rte_ip.h | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > An alternative way of fixing it (without resorting to attributes) would be to use a union.