From: <edward.cree@amd.com>
To: <linux-net-drivers@amd.com>, <davem@davemloft.net>,
<kuba@kernel.org>, <edumazet@google.com>, <pabeni@redhat.com>
Cc: Edward Cree <ecree.xilinx@gmail.com>, <netdev@vger.kernel.org>,
<habetsm.xilinx@gmail.com>, <arnd@arndb.de>
Subject: [PATCH v2 net-next 0/3] sfc: fix unaligned access in loopback selftests
Date: Fri, 23 Jun 2023 19:38:03 +0100 [thread overview]
Message-ID: <cover.1687545312.git.ecree.xilinx@gmail.com> (raw)
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(-)
next reply other threads:[~2023-06-23 18:39 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-23 18:38 edward.cree [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cover.1687545312.git.ecree.xilinx@gmail.com \
--to=edward.cree@amd.com \
--cc=arnd@arndb.de \
--cc=davem@davemloft.net \
--cc=ecree.xilinx@gmail.com \
--cc=edumazet@google.com \
--cc=habetsm.xilinx@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-net-drivers@amd.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).