[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <6f87fdf5-1844-4633-b4fe-6b247bc6ab49@app.fastmail.com>
Date: Thu, 22 Jun 2023 14:19:58 +0200
From: "Arnd Bergmann" <arnd@...db.de>
To: "Edward Cree" <ecree.xilinx@...il.com>,
"edward.cree" <edward.cree@....com>, linux-net-drivers@....com,
"David S . Miller" <davem@...emloft.net>, "Jakub Kicinski" <kuba@...nel.org>,
"Eric Dumazet" <edumazet@...gle.com>, "Paolo Abeni" <pabeni@...hat.com>
Cc: Netdev <netdev@...r.kernel.org>,
"Martin Habets" <habetsm.xilinx@...il.com>
Subject: Re: [PATCH net-next 1/3] sfc: use padding to fix alignment in loopback test
On Thu, Jun 22, 2023, at 14:02, Edward Cree wrote:
> On 22/06/2023 12:38, Arnd Bergmann wrote:
>> On Thu, Jun 22, 2023, at 12:18, edward.cree@....com wrote:
>>
>> There should probably be an extra __aligned(4) after the __packed,
>> so that the compiler knows the start of the structure is aligned,
>> otherwise (depending on the architecture and compiler), any access
>> to a member can still turn into multiple single-byte accesses.
>
> Ok, will add that in v2.
>
>> I would also expect to still see a warning without that extra
>> attribute. Aside from this, the patch looks good to me.
> My compiler (gcc 8.3.1) doesn't reproduce the original warning, so
> I'm flying slightly blind here :( If you could build-test this on
> your setup with/without the __aligned(4), I'd be very grateful.
I can confirm that your patch addresses the warning for me
with any version of clang I have installed, and that the __aligned(4)
is not needed for the warning, though it is still a good idea for
code generation.
Arnd
Powered by blists - more mailing lists