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 B6E0645B09; Thu, 10 Oct 2024 22:08:15 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 83D154028E; Thu, 10 Oct 2024 22:08:15 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 7214340279 for ; Thu, 10 Oct 2024 22:08:13 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1728590893; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ze2+RjFapZ04Ykr+oiBZGL8HcRLWukyC6REskDOhk48=; b=GJcL02B/+cjQYOp0xl7WUDUOO0S+VTQYHdcy6Lfih7detgraoN2AEp/izmOBxf9sE72Whx PJkbhAh/DC9zTklwVkT/Fth16iLh7CX/HBvVmKdJZnv2J7C8U5DRNZbLjgfiiFphROOjUe uWa7fszcL8oJjpI6SLgMzVgbivURf3c= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-451-2tI3OwKWPHe26aS64_aECA-1; Thu, 10 Oct 2024 16:08:09 -0400 X-MC-Unique: 2tI3OwKWPHe26aS64_aECA-1 Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-37d52ccc50eso146505f8f.3 for ; Thu, 10 Oct 2024 13:08:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728590887; x=1729195687; h=in-reply-to:references:user-agent:to:from:cc:subject:message-id :date:content-transfer-encoding:mime-version:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=irfJW1qVdCv9hLlbXKhiJ6dHUBiV6KS5UZvy+o0GpI0=; b=NLqy/Kp7N8k2omDRYW1GLTLQjWqpGUWEJKTHvPjE8xHh6035RiCaETOYjsD/2xjVXK yTHzLpY20UmMreFOIYS+gR7Vcl66e0pbafrP2X4S/Ykc47LShRYSq8mxXqzFmkUslNxP L3DaKuhS9z+e98Oi+uwjuJ2soSQcwrlMktX/ORJ5Ah0V6pZjVl8118FQ3j4tZNacpAqQ 3mta5N2vKGDj7dyquc4YqJtIFCxC5r8VPesCjSFDPdMn4yZikKRyuBVWvD5nSunZDgxx QimOvN8wt++ZQuZ7b7rX8VqhS5yrB3qifm108SxycVX586PNHv+6ozBQryDjRNeAYQCi KhPg== X-Gm-Message-State: AOJu0YwJo10gm1WfAhq3o2W+xfbDwvlhyQdTMkPgPoy9Wf0Bzk5ZPSlA g8eR0fLlD+Ue89DdU/YZuHlgdJWilcyI0QPiDjXbdTXEepKuH6BWfzGMhxuus1Dmo+Tya50WiLu kZ+7ENlxOaDxHu/gBn4QR/Pt06+YqD6AjM5+4EN8C X-Received: by 2002:a05:6000:4599:b0:37d:4647:154e with SMTP id ffacd0b85a97d-37d551ab470mr172938f8f.9.1728590887657; Thu, 10 Oct 2024 13:08:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHBX0GTbG5sxXuaGbSYsFWBBW+KEprwN27bO/eiLviW/Lxcz7+wMEOY1Tnb4PgoJj8+kqqf8Q== X-Received: by 2002:a05:6000:4599:b0:37d:4647:154e with SMTP id ffacd0b85a97d-37d551ab470mr172922f8f.9.1728590887246; Thu, 10 Oct 2024 13:08:07 -0700 (PDT) Received: from localhost (2a01cb00025433001b9f807167cdbf20.ipv6.abo.wanadoo.fr. [2a01:cb00:254:3300:1b9f:8071:67cd:bf20]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37d4b6bd399sm2277009f8f.26.2024.10.10.13.08.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 10 Oct 2024 13:08:06 -0700 (PDT) Mime-Version: 1.0 Date: Thu, 10 Oct 2024 22:08:05 +0200 Message-Id: Subject: Re: [PATCH dpdk v2 03/16] net: add structure for ipv6 addresses Cc: , , , "Vipin Varghese" From: "Robin Jarry" To: =?utf-8?q?Morten_Br=C3=B8rup?= , "Stephen Hemminger" , "Wathsala Vithanage" , "Min Zhou" , "David Christensen" , "Stanislaw Kardach" User-Agent: aerc/0.18.2-74-g7e4ac1a5f54c References: <20240821162516.610624-17-rjarry@redhat.com> <20241001081728.301272-1-rjarry@redhat.com> <20241001081728.301272-4-rjarry@redhat.com> <98CBD80474FA8B44BF855DF32C47DC35E9F77B@smartserver.smartshare.dk> In-Reply-To: <98CBD80474FA8B44BF855DF32C47DC35E9F77B@smartserver.smartshare.dk> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8; format=Flowed 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 Morten Br=C3=B8rup, Oct 06, 2024 at 10:18: > 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=20 > access variant and make the structure to 2-byte aligned (which is the=20 > common case in Ethernet packets), it will break both API and ABI. This=20 > seems unlikely to get accepted at a later time, so I think we are=20 > - right now - in a situation where it's now or never: > > struct rte_ipv6_addr { > =09__extension__ > =09union { > =09=09unsigned char a[RTE_IPV6_ADDR_SIZE]; > =09=09uint16_t w[RTE_IPV6_ADDR_SIZE / 2]; > =09}; > }; > > Unless some of the CPU folks want the 2-byte aligned variant, stick=20 > with what you offered. I was also thinking the same. I could have added an unnamed union which=20 only contains one field. However, it does not make much sense if we never want to change the=20 default alignment. Important note: DPDK is compiled with the following C flags: -Wno-address-of-packed-member Added in 2017 https://git.dpdk.org/dpdk/commit/?id=3D95cd37070af44 If we had struct rte_ipv6_addr aligned on 2 bytes (or more),=20 applications that do not silence that warning would have a hard time.=20 Example in grout: ../modules/ip6/datapath/ip6_input.c:99:54: error: taking address of packed = member of =E2=80=98struct rte_ipv6_hdr=E2=80=99 may result in an unaligned = pointer value [-Werror=3Daddress-of-packed-member] 99 | nh =3D ip6_route_lookup(iface->vrf_id, &ip->dst_add= r); | ^~~~~~~~~~~~~ I'd say that it is better to keep it simple :)