mbox series

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

Message ID cover.1687427930.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 22, 2023, 10:18 a.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.

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 | 45 +++++++++++++---------
 drivers/net/ethernet/sfc/selftest.c        | 45 +++++++++++++---------
 drivers/net/ethernet/sfc/siena/selftest.c  | 45 +++++++++++++---------
 3 files changed, 81 insertions(+), 54 deletions(-)