From: Bruce Richardson <bruce.richardson@intel.com>
To: David Marchand <david.marchand@redhat.com>
Cc: dev@dpdk.org, "Stephen Hemminger" <stephen@networkplumber.org>,
"Chengwen Feng" <fengchengwen@huawei.com>,
"Morten Brørup" <mb@smartsharesystems.com>
Subject: Re: [PATCH] net: fix IPv4 cksum simple function
Date: Tue, 5 Nov 2024 10:18:57 +0000 [thread overview]
Message-ID: <ZynxEY0qKfwbemZn@bricha3-mobl1.ger.corp.intel.com> (raw)
In-Reply-To: <20241105085912.4148208-1-david.marchand@redhat.com>
On Tue, Nov 05, 2024 at 09:59:11AM +0100, David Marchand wrote:
> The new function breaks compilation with -Wcast-align.
>
> In file included from /home/runner/work/ovs/ovs/dpdk-dir/include/rte_ip.h:9:
> /home/runner/work/ovs/ovs/dpdk-dir/include/rte_ip4.h:191:10:
> error: cast from 'const uint8_t *' (aka 'const unsigned char *')
> to 'const unaligned_uint16_t *' (aka 'const unsigned short *')
> increases required alignment from 1 to 2 [-Werror,-Wcast-align]
> v16_h = (const unaligned_uint16_t *)&ipv4_hdr->version_ihl;
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> Fix this by aligning rte_ipv4_hdr to two bytes, and point at the start
> of the structure rather than the first field (which happens to be 1 byte
> large).
>
> Fixes: f9e1d67f237a ("net: add IPv4 cksum function for simple cases")
>
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---
> doc/guides/rel_notes/release_24_11.rst | 2 ++
> lib/net/rte_ip4.h | 4 ++--
> 2 files changed, 4 insertions(+), 2 deletions(-)
>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
prev parent reply other threads:[~2024-11-05 10:19 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-05 8:59 David Marchand
2024-11-05 9:09 ` Morten Brørup
2024-11-05 9:27 ` David Marchand
2024-11-05 10:20 ` Morten Brørup
2024-11-05 10:49 ` David Marchand
2024-11-05 11:02 ` Bruce Richardson
2024-11-05 11:06 ` Morten Brørup
2024-11-05 13:12 ` David Marchand
2024-11-05 9:37 ` Robin Jarry
2024-11-05 9:53 ` Morten Brørup
2024-11-06 20:22 ` David Marchand
2024-11-05 10:18 ` Bruce Richardson [this message]
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=ZynxEY0qKfwbemZn@bricha3-mobl1.ger.corp.intel.com \
--to=bruce.richardson@intel.com \
--cc=david.marchand@redhat.com \
--cc=dev@dpdk.org \
--cc=fengchengwen@huawei.com \
--cc=mb@smartsharesystems.com \
--cc=stephen@networkplumber.org \
/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).