[PATCH] net: fix IPv4 cksum simple function
Morten Brørup
mb at smartsharesystems.com
Tue Nov 5 10:53:15 CET 2024
> From: Robin Jarry [mailto:rjarry at redhat.com]
> Sent: Tuesday, 5 November 2024 10.37
>
> Morten Brørup, Nov 05, 2024 at 10:09:
> > For consistency, could one of you - David or Robin - please also
> > 2-byte align the IPv6 header structure?
>
> I can send a patch but I wonder if this is really necessary after the
> RC-1 has passed?
Yes, please.
And don't forget the extension headers (rte_ipv6_routing_ext and rte_ipv6_fragment_ext).
>
> We don't have any gcc warning related to IPv6 unaligned access (except
> maybe in drivers).
I think both IPv4 and IPv6 headers are always 2-byte aligned IRL; so for consistency and to prevent potential future problems, the API should reflect this.
Consistency is important: If the alignment differs between IPv4 and IPv6 headers in the API, someone might think there is a good reason for this, and as time passes no one will be able to answer why there is a difference.
PS:
I am also pushing for 2-byte aligning Layer 4 headers (TCP, UDP, etc.), e.g. for checksumming purposes; but didn't get enough response to that RFC:
https://inbox.dpdk.org/dev/20241011160653.88028-1-mb@smartsharesystems.com/
More information about the dev
mailing list