From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 6F804A0096 for ; Wed, 5 Jun 2019 11:04:33 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CD7261B9C5; Wed, 5 Jun 2019 11:04:32 +0200 (CEST) Received: from dispatch1-us1.ppe-hosted.com (dispatch1-us1.ppe-hosted.com [148.163.129.52]) by dpdk.org (Postfix) with ESMTP id 1F9DD1B9BD for ; Wed, 5 Jun 2019 11:04:31 +0200 (CEST) X-Virus-Scanned: Proofpoint Essentials engine Received: from webmail.solarflare.com (uk.solarflare.com [193.34.186.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTPS id 5ED4DB40060; Wed, 5 Jun 2019 09:04:29 +0000 (UTC) Received: from [192.168.38.17] (91.220.146.112) by ukex01.SolarFlarecom.com (10.17.10.4) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Wed, 5 Jun 2019 10:04:24 +0100 To: Stephen Hemminger , CC: Bruce Richardson References: <20190516180427.17270-1-stephen@networkplumber.org> <20190605010852.28395-1-stephen@networkplumber.org> <20190605010852.28395-6-stephen@networkplumber.org> From: Andrew Rybchenko Message-ID: <005bbc2d-da32-cdad-8fb3-cf580e942529@solarflare.com> Date: Wed, 5 Jun 2019 12:04:20 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <20190605010852.28395-6-stephen@networkplumber.org> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-GB X-Originating-IP: [91.220.146.112] X-ClientProxiedBy: ocex03.SolarFlarecom.com (10.20.40.36) To ukex01.SolarFlarecom.com (10.17.10.4) X-TM-AS-Product-Ver: SMEX-12.5.0.1300-8.5.1010-24658.003 X-TM-AS-Result: No-3.196100-8.000000-10 X-TMASE-MatchedRID: cgbqQT5W8hfmLzc6AOD8DfHkpkyUphL90Y5wB8cprq5psnGGIgWMmeBq 0yNOt+07IB6clFv+PPTcJxdWvjKQ3+aJ4GIhMVpZ8Kg68su2wyFMkOX0Uoduuc2r9z7B+jUROWj cBJBnam0Mr3jxEqd66L78RkHQ3ikChrD3pNcSx1aOjIrMSa2sR86gBdMBUo41vnfHvUgggRJ3gA GtpjIjbufOVcxjDhcwPcCXjNqUmkVYF3qW3Je6+3FWRp4Nh+Nxd+ChWjbBngWAL0iOce6YoBN7/ zgIhSERZG6RyiUGjf+i5pOruDiXDIALTxfWqlhMYdmo7NJ5fDbPHGmCWrRm4vAdfn5DyOPDXC6u Jnc/p0SsglkltB8xdGpozkualSTDO6clcnPxfVB+3BndfXUhXQ== X-TM-AS-User-Approved-Sender: Yes X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--3.196100-8.000000 X-TMASE-Version: SMEX-12.5.0.1300-8.5.1010-24658.003 X-MDID: 1559725470-Xe62uhiCvn-v Subject: Re: [dpdk-dev] [PATCH v3 5/6] net/ether: mark ethernet addresses as being 2-byte aligned X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 6/5/19 4:08 AM, Stephen Hemminger wrote: > From: Bruce Richardson > > When including the rte_ether.h header in applications with warnings > enabled, a warning was given because of the assumption of 2-byte alignment > of ethernet addresses when processing them. > > .../include/rte_ether.h:149:2: warning: converting a packed ‘const > struct ether_addr’ pointer (alignment 1) to a ‘unaligned_uint16_t’ > {aka ‘const short unsigned int’} pointer (alignment 2) may result in > an unaligned pointer value [-Waddress-of-packed-member] > 149 | const unaligned_uint16_t *ea_words = (const unaligned_uint16_t *)ea; > | ^~~~~ > > Since ethernet addresses should always be aligned on a two-byte boundary, > we can just inform the compiler of this assumption to remove the warnings > and allow us to always access the addresses using 16-bit operations. > > Signed-off-by: Bruce Richardson > Signed-off-by: Stephen Hemminger Reviewed-by: Andrew Rybchenko