From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by inbox.dpdk.org (Postfix) with ESMTP id C9A19A046B
	for <public@inbox.dpdk.org>; Thu, 25 Jul 2019 16:01:24 +0200 (CEST)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id 420B61C34E;
	Thu, 25 Jul 2019 16:01:24 +0200 (CEST)
Received: from mga06.intel.com (mga06.intel.com [134.134.136.31])
 by dpdk.org (Postfix) with ESMTP id 2DA321C34D;
 Thu, 25 Jul 2019 16:01:21 +0200 (CEST)
X-Amp-Result: SKIPPED(no attachment in message)
X-Amp-File-Uploaded: False
Received: from fmsmga004.fm.intel.com ([10.253.24.48])
 by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;
 25 Jul 2019 07:01:20 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.64,306,1559545200"; d="scan'208";a="193814228"
Received: from aburakov-mobl1.ger.corp.intel.com (HELO [10.237.220.83])
 ([10.237.220.83])
 by fmsmga004.fm.intel.com with ESMTP; 25 Jul 2019 07:01:18 -0700
To: Aaron Conole <aconole@redhat.com>,
 hgovindh <hariprasad.govindharajan@intel.com>
Cc: Remy Horton <remy.horton@intel.com>,
 Marko Kovacevic <marko.kovacevic@intel.com>, Ori Kam <orika@mellanox.com>,
 Bruce Richardson <bruce.richardson@intel.com>,
 Pablo de Lara <pablo.de.lara.guarch@intel.com>,
 Radu Nicolau <radu.nicolau@intel.com>, Akhil Goyal <akhil.goyal@nxp.com>,
 Tomasz Kantecki <tomasz.kantecki@intel.com>, dev@dpdk.org, stable@dpdk.org
References: <20190724164354.18811-1-hariprasad.govindharajan@intel.com>
 <f7ty30mp7kz.fsf@dhcp-25.97.bos.redhat.com>
From: "Burakov, Anatoly" <anatoly.burakov@intel.com>
Message-ID: <ef161dc8-5ea7-3f6d-3c36-b22946379b24@intel.com>
Date: Thu, 25 Jul 2019 15:01:17 +0100
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101
 Thunderbird/60.8.0
MIME-Version: 1.0
In-Reply-To: <f7ty30mp7kz.fsf@dhcp-25.97.bos.redhat.com>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
Subject: Re: [dpdk-dev] [PATCH] examples/l3fwd: fix unaligned memory access
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

On 25-Jul-19 2:27 PM, Aaron Conole wrote:
> hgovindh <hariprasad.govindharajan@intel.com> writes:
> 
>> Fix unaligned memory access when reading IPv6 header which
>> leads to segmentation fault by changing aligned memory read
>> to unaligned memory read.
>>
>> Bugzilla ID: 279
>> Fixes: 64d3955de1de ("examples/l3fwd: fix ARM build")
>> Cc: maciej.czekaj@caviumnetworks.com
>> Cc: stable@dpdk.org
>> Signed-off-by: hgovindh <hariprasad.govindharajan@intel.com>
>> ---
>>   examples/l3fwd/l3fwd_em.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/examples/l3fwd/l3fwd_em.c b/examples/l3fwd/l3fwd_em.c
>> index fa8f82be6..f0c443dae 100644
>> --- a/examples/l3fwd/l3fwd_em.c
>> +++ b/examples/l3fwd/l3fwd_em.c
>> @@ -285,7 +285,7 @@ em_get_ipv6_dst_port(void *ipv6_hdr, uint16_t portid, void *lookup_struct)
>>   	 * Get part of 5 tuple: dst IP address lower 96 bits
>>   	 * and src IP address higher 32 bits.
>>   	 */
>> -	key.xmm[1] = *(xmm_t *)data1;
>> +	key.xmm[1] = _mm_loadu_si128((xmm_t *)data1);
> 
> Nak.  Please use a generic unaligned load, rather than an intel specific
> one.  Otherwise, supported platforms like arm64 will have broken builds.
> 
> Additionally, which chip and compiler did you use to get this error?

I have reproduced this error on Intel Xeon E5-2699 and GCC 7.4 (Ubuntu 
18.04).

> 
>>   
>>   	/*
>>   	 * Get part of 5 tuple: dst port and src port
> 


-- 
Thanks,
Anatoly