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 DBEFE45648; Thu, 18 Jul 2024 17:03:32 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A0389402DC; Thu, 18 Jul 2024 17:03:32 +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 649CD402D8 for ; Thu, 18 Jul 2024 17:03:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1721315010; 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; bh=s+XC7GXOqDlFVom5ckWmozQhwKPmMPV+hxufJvUiWZg=; b=AjWNEn7RnMSNffKBwNH5Z972I1P1XYkKE03MrNObdtLkY421fFGeoGW6StX/NPLoEaNS+s TYT8vrJ14LJo0/nAnG9VCn4cr5+YHaO80WmFEXhBeEvsMd/6o32c7oH/evX2KXuV0+Ywf8 I7FT07lcWAF1i1WcRHfXuBWnRXejeBM= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-407-nmYpeRkBOMq0qXwQB59HPw-1; Thu, 18 Jul 2024 11:03:29 -0400 X-MC-Unique: nmYpeRkBOMq0qXwQB59HPw-1 Received: by mail-wr1-f70.google.com with SMTP id ffacd0b85a97d-36835daf8b7so713782f8f.2 for ; Thu, 18 Jul 2024 08:03:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721315007; x=1721919807; h=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=s+XC7GXOqDlFVom5ckWmozQhwKPmMPV+hxufJvUiWZg=; b=nCjsKpd3SnWUGlDxU7bMcUclWCnKBnCuEPnvRfSz+VddRk6ZGfUhl4KNoS9SZZAE4+ 4bwstVXKG+uHn0OQz/9HWRNjcZbVdRqZ5Bal+NrY35hfU275jQF9yq0OUxwXfVP5yrrW cg1XfBHZhtgjopxMlDjrnHO7RLPyyBO6n9vW1KNh6DIVW+elHuiIu2zCnqf7GhfJECKl dnVYRhEkk8reZTFDOyv8r6+jULltudRZoidPSUXiKwN+HEIqmr8CvFjSUnC+ahsw+VS5 RG0t1sphg6KFGNNbUBcPxqEh0WLQoLzxOwmSEWcsMiKIyBdyD2b5bZPEoOCVJHQKK2lX BuFQ== X-Gm-Message-State: AOJu0Yw8O3dQIsEt19+ckOp6BJI3Dhha65t6lwor6P40awlKVY6yxKAw ghrmQlcDq4gBuOiRcDOMNR6x8CSTRufNzOBogO6dPRHe1ApIFZxSWioM5wTtB9JdivpwJzgVsYs +a0yNBs2CLmNsyFHKLAL/ieyVpmKk5+B2UNIR+OCpy7AvLqPxC96hl6PWNE3nNAlxD76BXnu/qm H8IDzqATnOB61pb92ixPBT1kzc X-Received: by 2002:a5d:5089:0:b0:368:4def:921a with SMTP id ffacd0b85a97d-3684def92d2mr2404316f8f.48.1721315007565; Thu, 18 Jul 2024 08:03:27 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFUO7AFs1mFNSWLufSkMWlmdkNQpWdRwqQIdiPj8vWUeXJ9qtNaIbUSjHwbMBf7T21hH2lbbA== X-Received: by 2002:a5d:5089:0:b0:368:4def:921a with SMTP id ffacd0b85a97d-3684def92d2mr2404230f8f.48.1721315007056; Thu, 18 Jul 2024 08:03:27 -0700 (PDT) Received: from localhost (2a01cb0003516600b51f9b4ded302b00.ipv6.abo.wanadoo.fr. [2a01:cb00:351:6600:b51f:9b4d:ed30:2b00]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3684eb78e27sm2022108f8f.95.2024.07.18.08.03.26 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 18 Jul 2024 08:03:26 -0700 (PDT) Mime-Version: 1.0 Date: Thu, 18 Jul 2024 17:03:25 +0200 Message-Id: Subject: IPv6 APIs rework Cc: "Sunil Kumar Kori" , "Rakesh Kudurumalla" , "Vladimir Medvedkin" , "Wisam Jaddo" , "Cristian Dumitrescu" , "Konstantin Ananyev" , "Akhil Goyal" , "Fan Zhang" , "Bruce Richardson" , "Yipeng Wang" , "Sameh Gobriel" , "Nithin Dabilpuram" , "Kiran Kumar K" , "Satha Rao" , "Harman Kalra" , "Ankur Dwivedi" , "Anoob Joseph" , "Tejasree Kondoj" , "Gagandeep Singh" , "Hemant Agrawal" , "Ajit Khaparde" , "Somnath Kotur" , "Chas Williams" , "Min Hu (Connor)" , "Potnuri Bharat Teja" , "Sachin Saxena" , "Ziyang Xuan" , "Xiaoyun Wang" , "Jie Hai" , "Yisen Zhuang" , "Jingjing Wu" , "Dariusz Sosnowski" , "Viacheslav Ovsiienko" , "Bing Zhao" , "Ori Kam" , "Suanming Mou" , "Matan Azrad" , "Chaoyong He" , "Devendra Singh Rawat" , "Alok Prasad" , "Andrew Rybchenko" , "Stephen Hemminger" , "Jiawen Wu" , "Jian Wang" , "Thomas Monjalon" , "Ferruh Yigit" , "Jiayu Hu" , "Pavan Nikhilesh" , "Maxime Coquelin" , "Chenbo Xia" From: "Robin Jarry" To: User-Agent: aerc/0.18.0-5-gd32d93015ed7 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 Hi folks, while working on IPv6 support for grout [1], I noticed that all DPDK=20 IPv6 APIs used fixed sized arrays in the route lookup functions [2]. int rte_fib6_lookup_bulk(struct rte_fib6 *fib, uint8_t ips[][RTE_FIB6_IPV6_ADDR_SIZE], uint64_t *next_hops, int n); If I'm not mistaken, using sized arrays in function signatures is only=20 for documentation purposes and does not result in any specific compiler=20 checks. In the above example, the ips parameter is considered as a plain=20 old `uint8_t **` pointer. Also, not having a dedicated type for IPv6 addresses requires obscure=20 pointer arithmetic [3] and casting [4]. I'd like to introduce a real IPv6 address structure that has the same=20 alignment than a dumb `uint8_t *` pointer but has an union to ease=20 casting and most importantly presents the whole thing as an explicit=20 typed structure: #define RTE_IPV6_ADDR_SIZE 16 struct rte_ipv6_addr { union { uint8_t u8[RTE_IPV6_ADDR_SIZE]; uint16_t u16[RTE_IPV6_ADDR_SIZE / sizeof(uint16_t)]; uint32_t u32[RTE_IPV6_ADDR_SIZE / sizeof(uint32_t)]; uint64_t u64[RTE_IPV6_ADDR_SIZE / sizeof(uint64_t)]; }; } __rte_packed __rte_aligned(1); This would require some breakage of the APIs but I think it would=20 benefit code readability and maintainability in the long term. int rte_fib6_lookup_bulk(struct rte_fib6 *fib, const struct rte_ipv6_addr *ips, uint64_t *next_hops, int n); I already have a semi-working draft and am in the process of splitting=20 the changes into small chunks to make them easier to review. https://github.com/DPDK/dpdk/compare/main...rjarry:dpdk:ipv6-address-rework Is that something that would be of interest? If yes, I would like to=20 announce API breakage before the release of 24.07 so that the changes=20 can be integrated into 24.11. Cheers! [1] https://github.com/rjarry/grout [2] https://doc.dpdk.org/api/rte__fib6_8h.html#a924678410ccb9551cda3e75d742= a11e3 [3] https://git.dpdk.org/dpdk/tree/lib/fib/trie_avx512.c?h=3Dv24.07-rc2#n34= 0 [4] https://git.dpdk.org/dpdk/tree/lib/hash/rte_thash.h?h=3Dv24.07-rc2#n156 --=20 Robin