netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 net-next 0/3] sfc: fix unaligned access in loopback selftests
@ 2023-06-23 18:38 edward.cree
  2023-06-23 18:38 ` [PATCH v2 net-next 1/3] sfc: use padding to fix alignment in loopback test edward.cree
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: edward.cree @ 2023-06-23 18:38 UTC (permalink / raw)
  To: linux-net-drivers, davem, kuba, edumazet, pabeni
  Cc: Edward Cree, netdev, habetsm.xilinx, arnd

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(-)


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-08-14 15:56 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-23 18:38 [PATCH v2 net-next 0/3] sfc: fix unaligned access in loopback selftests edward.cree
2023-06-23 18:38 ` [PATCH v2 net-next 1/3] sfc: use padding to fix alignment in loopback test edward.cree
2023-08-12  8:23   ` Arnd Bergmann
2023-08-14 10:06     ` Edward Cree
2023-08-14 13:45       ` Arnd Bergmann
2023-08-14 15:56         ` Edward Cree
2023-06-23 18:38 ` [PATCH v2 net-next 2/3] sfc: siena: " edward.cree
2023-06-23 18:38 ` [PATCH v2 net-next 3/3] sfc: falcon: " edward.cree
2023-06-26  9:50 ` [PATCH v2 net-next 0/3] sfc: fix unaligned access in loopback selftests patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).