From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f43.google.com (mail-pa0-f43.google.com [209.85.220.43]) by dpdk.org (Postfix) with ESMTP id C61974A63 for ; Tue, 8 Dec 2015 21:02:46 +0100 (CET) Received: by pacej9 with SMTP id ej9so17004087pac.2 for ; Tue, 08 Dec 2015 12:02:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=n5pIbdp70gK1Ze86XKgQWYSdSrlQW3rBNS7M5hfhepA=; b=GPd4Gpy2Rv0R/KZHSiHXrpx32+Cv12x9c+Y/kELDNBhAcPa2bY2Ktv+3FPJ824r6aU CLeecI9RdDa4cG0INDVTZWWU00v9UgTo8/BzxqCoqynA4tioH8gswHDQ+hHl25KQjxfP h6A0dXt2OL4YbDS88uOwNYDdfN/hzOXbp0pSItqf2fXlRQX5hHYjuwtHX7BOjooRmVX/ Fze3PLbtMvd4/vCQ+h9zYKeocc5xYtIs8Mf/+yDA7OMRHh5bAbNErAKRgtIBfilspYYZ +6ypzmszBCQdujrVYJmyPqU0U92u+zydxGtWY+geAf3B6/jP+HcHfGXL8czJTx44xLaL VDwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=n5pIbdp70gK1Ze86XKgQWYSdSrlQW3rBNS7M5hfhepA=; b=jx7x2etU5gBtLWjylDid7onBarVmegtoGe7TxgtCM/Y/SQi0fEdXW6eIZRNcIeqSui WoBMCsoBtRyQvZ/TdnUG4dfBijx9Cp0W04h/sXmHMyhCyRDHxv70fOHzwSG2JM/anvzT rRLivoeUAk6U1TVqPdWHxx2+9zsQG4EvSvZyLw9QHB4gHwI7JFpj0p2X3Vi6uHwhJa05 Ky8Wiv0XdHevxAut12vR6+637ng1I8WnxU6r0Hmgf8whawj0yV5z9HMFYNvji9O1vdqj bax44mCRyvjijVAjMXTEialhK7fOUtU45OtN4hGmS8hpCVpzaT1P1SWJzAyNqhijSJtF 8AUA== X-Gm-Message-State: ALoCoQm5ZdcHFBgRA5iABNzjw9X6UGDm3Nr+D/naxTCJaDzpAroFW3RZNkXjY1wYH+w4tatenItQq1i+wc9s+sAMMLEJ8IsjrQ== X-Received: by 10.66.141.41 with SMTP id rl9mr2438971pab.139.1449604965855; Tue, 08 Dec 2015 12:02:45 -0800 (PST) Received: from xeon-e3 (static-50-53-82-155.bvtn.or.frontiernet.net. [50.53.82.155]) by smtp.gmail.com with ESMTPSA id 81sm6488922pfk.56.2015.12.08.12.02.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 Dec 2015 12:02:45 -0800 (PST) Date: Tue, 8 Dec 2015 12:02:54 -0800 From: Stephen Hemminger To: Jan Viktorin Message-ID: <20151208120254.45758054@xeon-e3> In-Reply-To: <1449602993-6047-1-git-send-email-viktorin@rehivetech.com> References: <1449602993-6047-1-git-send-email-viktorin@rehivetech.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [[RFC PATCH]] lib/ether: fix 16-bit unaligned access X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2015 20:02:47 -0000 On Tue, 8 Dec 2015 20:29:53 +0100 Jan Viktorin wrote: > Hello, > > I was looking at some warnings generated during ARM build. I can see > 53 warnings for my build based on v2.2.0-rc3, spread among: > > app/test-pmd/{flowgen,icmpecho,txonly}.c > app/test/{packet_burst_generator,test_hash_functions,test_thash}.c > lib/librte_ether/rte_ether.h > drivers/net/bonding/rte_eth_bond_pmd.c > lib/librte_acl/{acl_gen,acl_run}.c > lib/librte_eal/linuxapp/eal/{eal_interrupts,eal_pci_vfio_mp_sync}.c > lib/librte_hash/rte_cuckoo_hash.c > lib/librte_ip_frag/rte_ipv4_reassembly.c > lib/librte_sched/{rte_bitmap.h,rte_sched.c} > > I think, some of them are false-positives. In this RFC patch I tried to fix > only the rte_ether.h which uses the unaligned_uint16_t data type. I didn't > test it as it is just the first kick to solve more of those warns. > > Regards > Jan > > (I considered to not add the cover-letter as this is just a single small patch. > I hope it does not matter a lot. Is there any convention how to do this?) > --- > This commit removes warning reported when building for ARMv7 target. > > Signed-off-by: Jan Viktorin > --- > lib/librte_ether/rte_ether.h | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/lib/librte_ether/rte_ether.h b/lib/librte_ether/rte_ether.h > index 07c17d7..ba8a80a 100644 > --- a/lib/librte_ether/rte_ether.h > +++ b/lib/librte_ether/rte_ether.h > @@ -175,10 +175,9 @@ static inline int is_multicast_ether_addr(const struct ether_addr *ea) > */ > static inline int is_broadcast_ether_addr(const struct ether_addr *ea) > { > - const unaligned_uint16_t *ea_words = (const unaligned_uint16_t *)ea; > + const uint32_t *ea_words = (const uint32_t *)ea; > > - return (ea_words[0] == 0xFFFF && ea_words[1] == 0xFFFF && > - ea_words[2] == 0xFFFF); > + return ea_words[0] == 0xFFFFFFFF && (ea_words[1] & 0x0FFFF) == 0x0FFFF; The problem with that is that it assumes little-endian.