From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4809D45AC4; Sun, 6 Oct 2024 10:19:01 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C2D584025D; Sun, 6 Oct 2024 10:19:00 +0200 (CEST) Received: from dkmailrelay1.smartsharesystems.com (smartserver.smartsharesystems.com [77.243.40.215]) by mails.dpdk.org (Postfix) with ESMTP id 6E6B640150 for ; Sun, 6 Oct 2024 10:18:59 +0200 (CEST) Received: from smartserver.smartsharesystems.com (smartserver.smartsharesys.local [192.168.4.10]) by dkmailrelay1.smartsharesystems.com (Postfix) with ESMTP id 35B1820EDB; Sun, 6 Oct 2024 10:18:59 +0200 (CEST) Subject: RE: [PATCH dpdk v2 03/16] net: add structure for ipv6 addresses Date: Sun, 6 Oct 2024 10:18:57 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Message-ID: <98CBD80474FA8B44BF855DF32C47DC35E9F77B@smartserver.smartshare.dk> Content-class: urn:content-classes:message In-Reply-To: <20241001081728.301272-4-rjarry@redhat.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PATCH dpdk v2 03/16] net: add structure for ipv6 addresses Thread-Index: AdsT2mxeYQI9+cokRw+5QPIfQvoDSgD6ehkg References: <20240821162516.610624-17-rjarry@redhat.com> <20241001081728.301272-1-rjarry@redhat.com> <20241001081728.301272-4-rjarry@redhat.com> X-MimeOLE: Produced By Microsoft Exchange V6.5 From: =?iso-8859-1?Q?Morten_Br=F8rup?= To: "Robin Jarry" , "Stephen Hemminger" , "Wathsala Vithanage" , "Min Zhou" , "David Christensen" , "Stanislaw Kardach" Cc: , , , "Vipin Varghese" X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org +to: Various CPU architecture maintainers +to: Stephen (already participating in this discussion) +cc: x86 CPU architecture maintainers > From: Robin Jarry [mailto:rjarry@redhat.com] > Sent: Tuesday, 1 October 2024 10.17 >=20 > There is currently no structure defined for IPv6 addresses. Introduce > one that is simply a uint8_t array of 16 elements without any union. > The > idea is to ensure this structure alignment is 1 so that it can be > mapped > directly on unaligned packet memory. >=20 > Signed-off-by: Robin Jarry > --- > lib/net/rte_ip6.h | 10 ++++++++++ > 1 file changed, 10 insertions(+) >=20 > diff --git a/lib/net/rte_ip6.h b/lib/net/rte_ip6.h > index 5ad1dd25db08..52c41088681e 100644 > --- a/lib/net/rte_ip6.h > +++ b/lib/net/rte_ip6.h > @@ -35,6 +35,16 @@ > extern "C" { > #endif >=20 > +#define RTE_IPV6_ADDR_SIZE 16 > +#define RTE_IPV6_MAX_DEPTH 128 > + > +/** > + * IPv6 Address > + */ > +struct rte_ipv6_addr { > + unsigned char a[RTE_IPV6_ADDR_SIZE]; > +}; This has been discussed before, but I want to double check... If - sometime in the future - we want to add a union to offer a 2-byte = access variant and make the structure to 2-byte aligned (which is the = common case in Ethernet packets), it will break both API and ABI. This = seems unlikely to get accepted at a later time, so I think we are - = right now - in a situation where it's now or never: struct rte_ipv6_addr { __extension__ union { unsigned char a[RTE_IPV6_ADDR_SIZE]; uint16_t w[RTE_IPV6_ADDR_SIZE / 2]; }; }; Unless some of the CPU folks want the 2-byte aligned variant, stick with = what you offered.