From: David Ahern Subject: Re: [PATCH net-next] neighbor: Add protocol attribute Date: Tue, 11 Dec 2018 08:22:04 -0700 Message-ID: <1acd4550-997f-cca9-3062-8fd91d92beff@gmail.com> References: <20181207.154553.2153174795925914538.davem@davemloft.net> <20181210.215937.1179843388675835344.davem@davemloft.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: eric.dumazet@gmail.com, netdev@vger.kernel.org, roopa@cumulusnetworks.com To: David Miller Return-path: Received: from mail-it1-f193.google.com ([209.85.166.193]:50218 "EHLO mail-it1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726366AbeLKPWI (ORCPT ); Tue, 11 Dec 2018 10:22:08 -0500 Received: by mail-it1-f193.google.com with SMTP id z7so4106306iti.0 for ; Tue, 11 Dec 2018 07:22:07 -0800 (PST) In-Reply-To: <20181210.215937.1179843388675835344.davem@davemloft.net> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 12/10/18 10:59 PM, David Miller wrote: > From: David Ahern > Date: Mon, 10 Dec 2018 19:47:33 -0700 > >> On 12/7/18 4:45 PM, David Miller wrote: >>> >>> Right, neigh->ha[] should probably be kept 8-byte aligned. >>> >> >> From what I can see ha is only used with memcpy, and neighbour struct is >> annotated with __randomize_layout. Are you saying that ha should be >> marked with __aligned(8)? > > People who care about performance probably don't build with randomization > enabled, do they? > > Even though it uses memcpy() it will be faster if it is 8 byte aligned > and we can probably explicitly take advantage of that alignment even > more if we add the marking as you suggest perhaps. > > Given all of this, what is your opinion? > Arguably my take is ethernet centric. I do not see how 8-byte alignment matters when copying 6 bytes. In my response to Eric I showed ha is still 4-byte aligned and does not straddle cachelines. Those seem the more relevant to me.