mbox series

[v2,net-next,0/3] sfc: fix unaligned access in loopback selftests

Message ID cover.1687545312.git.ecree.xilinx@gmail.com (mailing list archive)
Headers show
Series sfc: fix unaligned access in loopback selftests | expand

Message

edward.cree@amd.com June 23, 2023, 6:38 p.m. UTC
From: Edward Cree <ecree.xilinx@gmail.com>

Arnd reported that the sfc drivers each define a packed loopback_payload
 structure with an ethernet header followed by an IP header, whereas the
 kernel definition of iphdr specifies that this is 4-byte aligned,
 causing a W=1 warning.
Fix this in each case by adding two bytes of leading padding to the
 struct, taking care that these are not sent on the wire.
Tested on EF10; build-tested on Siena and Falcon.

Changed in v2:
* added __aligned(4) to payload struct definitions (Arnd)
* fixed dodgy whitespace (checkpatch)

Edward Cree (3):
  sfc: use padding to fix alignment in loopback test
  sfc: siena: use padding to fix alignment in loopback test
  sfc: falcon: use padding to fix alignment in loopback test

 drivers/net/ethernet/sfc/falcon/selftest.c | 47 +++++++++++++---------
 drivers/net/ethernet/sfc/selftest.c        | 47 +++++++++++++---------
 drivers/net/ethernet/sfc/siena/selftest.c  | 47 +++++++++++++---------
 3 files changed, 84 insertions(+), 57 deletions(-)

Comments

patchwork-bot+netdevbpf@kernel.org June 26, 2023, 9:50 a.m. UTC | #1
Hello:

This series was applied to netdev/net-next.git (main)
by David S. Miller <davem@davemloft.net>:

On Fri, 23 Jun 2023 19:38:03 +0100 you wrote:
> From: Edward Cree <ecree.xilinx@gmail.com>
> 
> Arnd reported that the sfc drivers each define a packed loopback_payload
>  structure with an ethernet header followed by an IP header, whereas the
>  kernel definition of iphdr specifies that this is 4-byte aligned,
>  causing a W=1 warning.
> Fix this in each case by adding two bytes of leading padding to the
>  struct, taking care that these are not sent on the wire.
> Tested on EF10; build-tested on Siena and Falcon.
> 
> [...]

Here is the summary with links:
  - [v2,net-next,1/3] sfc: use padding to fix alignment in loopback test
    https://git.kernel.org/netdev/net-next/c/cf60ed469629
  - [v2,net-next,2/3] sfc: siena: use padding to fix alignment in loopback test
    https://git.kernel.org/netdev/net-next/c/30c24dd87f3f
  - [v2,net-next,3/3] sfc: falcon: use padding to fix alignment in loopback test
    https://git.kernel.org/netdev/net-next/c/1186c6b31ee1

You are awesome, thank you!