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 A993145B09; Thu, 10 Oct 2024 21:44:00 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AB9B240E01; Thu, 10 Oct 2024 21:43:16 +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 BDE4A4068A for ; Thu, 10 Oct 2024 21:43:14 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1728589394; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7nI9YzMM+euRSQ9DBevElUjnf+L6EAlPWaOvIY6IOAU=; b=Qi/dT/Dz/t1qyRhDsn3DSD6tJhF9iZKfl30B5gp6Y1RqEYIloSpiSrc5wzd3vqtOHU6iA0 iHP8xrDja+6K3WeKr6jNycDFT9qHgWILK/1NLCTm6nnPzGe+35qjD5d2/OV0Zekk9HAV6o wtWlSytRrhDlatqmiKj2jpY7uOoyS/4= Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-249-tV5ax-jvMmWM2eZ8JFHTqg-1; Thu, 10 Oct 2024 15:43:11 -0400 X-MC-Unique: tV5ax-jvMmWM2eZ8JFHTqg-1 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 6F50C195608A; Thu, 10 Oct 2024 19:43:09 +0000 (UTC) Received: from ringo.redhat.com (unknown [10.39.208.7]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 569B919560AA; Thu, 10 Oct 2024 19:43:06 +0000 (UTC) From: Robin Jarry To: dev@dpdk.org, Wisam Jaddo , Potnuri Bharat Teja , Chaoyong He , Ori Kam , Thomas Monjalon , Ferruh Yigit , Andrew Rybchenko Subject: [PATCH dpdk v3 15/17] rte_flow: use struct rte_ipv6_addr Date: Thu, 10 Oct 2024 21:41:45 +0200 Message-ID: <20241010194148.1877659-16-rjarry@redhat.com> In-Reply-To: <20241010194148.1877659-1-rjarry@redhat.com> References: <20240821162516.610624-17-rjarry@redhat.com> <20241010194148.1877659-1-rjarry@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true 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 Update rte_flow_tunnel, rte_flow_action_set_ipv6, rte_flow_item_icmp6_nd_na and rte_flow_item_icmp6_nd_ns to use rte_ipv6_addr structures instead of uint8_t[16] arrays. Use the IPv6 utils that go along. Update all code accordingly. Signed-off-by: Robin Jarry --- Notes: v3: replace string initializers with RTE_IPV6_MASK_FULL app/test-flow-perf/actions_gen.c | 4 ++-- doc/guides/rel_notes/deprecation.rst | 10 ---------- doc/guides/rel_notes/release_24_11.rst | 1 + drivers/net/cxgbe/cxgbe_flow.c | 4 ++-- drivers/net/nfp/flower/nfp_flower_flow.c | 2 +- lib/ethdev/rte_flow.h | 18 +++++++----------- 6 files changed, 13 insertions(+), 26 deletions(-) diff --git a/app/test-flow-perf/actions_gen.c b/app/test-flow-perf/actions_gen.c index b5336e83ff9f..54fcbacb98ce 100644 --- a/app/test-flow-perf/actions_gen.c +++ b/app/test-flow-perf/actions_gen.c @@ -304,7 +304,7 @@ add_set_src_ipv6(struct rte_flow_action *actions, /* IPv6 value to set is random each time */ for (i = 0; i < 16; i++) { - set_ipv6[para.core_idx].ipv6_addr[i] = ipv6 & 0xff; + set_ipv6[para.core_idx].ipv6_addr.a[i] = ipv6 & 0xff; ipv6 = ipv6 >> 8; } @@ -327,7 +327,7 @@ add_set_dst_ipv6(struct rte_flow_action *actions, /* IPv6 value to set is random each time */ for (i = 0; i < 16; i++) { - set_ipv6[para.core_idx].ipv6_addr[i] = ipv6 & 0xff; + set_ipv6[para.core_idx].ipv6_addr.a[i] = ipv6 & 0xff; ipv6 = ipv6 >> 8; } diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst index f384a4b414c9..7b77987bffa2 100644 --- a/doc/guides/rel_notes/deprecation.rst +++ b/doc/guides/rel_notes/deprecation.rst @@ -61,16 +61,6 @@ Deprecation Notices us extending existing enum/define. One solution can be using a fixed size array instead of ``.*MAX.*`` value. -* net: A new IPv6 address structure will be introduced in DPDK 24.11. - It will replace all ad-hoc ``uint8_t[16]`` arrays in all public APIs and structures. - The following libraries and symbols are expected to be affected: - - ethdev - - ``struct rte_flow_item_icmp6_nd_ns`` - - ``struct rte_flow_item_icmp6_nd_na`` - - ``struct rte_flow_action_set_ipv6`` - - ``struct rte_flow_tunnel`` - * net, ethdev: The flow item ``RTE_FLOW_ITEM_TYPE_VXLAN_GPE`` is replaced with ``RTE_FLOW_ITEM_TYPE_VXLAN``. The struct ``rte_flow_item_vxlan_gpe`` and its mask ``rte_flow_item_vxlan_gpe_mask`` diff --git a/doc/guides/rel_notes/release_24_11.rst b/doc/guides/rel_notes/release_24_11.rst index f912f78017d7..027ac3ce9177 100644 --- a/doc/guides/rel_notes/release_24_11.rst +++ b/doc/guides/rel_notes/release_24_11.rst @@ -153,6 +153,7 @@ API Changes * security: ``rte_security_ipsec_tunnel_param`` was modified to use ``rte_ipv6_addr`` instead of ``in6_addr``. * hash: ``rte_ipv6_tuple`` was modified to use ``struct rte_ipv6_addr`` instead of ``uint8_t[16]`` fields. * gro: ``tcp6_flow_key`` was modified to use ``struct rte_ipv6_addr`` instead of ``uint8_t[16]`` fields. +* ethdev: ``rte_flow_*`` structures were modified to use ``struct rte_ipv6_addr`` instead of ``uint8_t[16]`` fields. ABI Changes ----------- diff --git a/drivers/net/cxgbe/cxgbe_flow.c b/drivers/net/cxgbe/cxgbe_flow.c index 9c7fa19bef00..9cb36172f818 100644 --- a/drivers/net/cxgbe/cxgbe_flow.c +++ b/drivers/net/cxgbe/cxgbe_flow.c @@ -680,7 +680,7 @@ ch_rte_parse_atype_switch(const struct rte_flow_action *a, "found."); ipv6 = (const struct rte_flow_action_set_ipv6 *)a->conf; - memcpy(fs->nat_fip, ipv6->ipv6_addr, sizeof(ipv6->ipv6_addr)); + memcpy(fs->nat_fip, &ipv6->ipv6_addr, sizeof(ipv6->ipv6_addr)); *nmode |= 1 << 0; break; case RTE_FLOW_ACTION_TYPE_SET_IPV6_DST: @@ -693,7 +693,7 @@ ch_rte_parse_atype_switch(const struct rte_flow_action *a, "found."); ipv6 = (const struct rte_flow_action_set_ipv6 *)a->conf; - memcpy(fs->nat_lip, ipv6->ipv6_addr, sizeof(ipv6->ipv6_addr)); + memcpy(fs->nat_lip, &ipv6->ipv6_addr, sizeof(ipv6->ipv6_addr)); *nmode |= 1 << 1; break; case RTE_FLOW_ACTION_TYPE_SET_TP_SRC: diff --git a/drivers/net/nfp/flower/nfp_flower_flow.c b/drivers/net/nfp/flower/nfp_flower_flow.c index 56352893d832..8c35ec539e59 100644 --- a/drivers/net/nfp/flower/nfp_flower_flow.c +++ b/drivers/net/nfp/flower/nfp_flower_flow.c @@ -2972,7 +2972,7 @@ nfp_flow_action_set_ipv6(char *act_data, set_ip->reserved = 0; for (i = 0; i < 4; i++) { - rte_memcpy(&tmp, &set_ipv6->ipv6_addr[i * 4], 4); + rte_memcpy(&tmp, &set_ipv6->ipv6_addr.a[i * 4], 4); set_ip->ipv6[i].exact = tmp; set_ip->ipv6[i].mask = RTE_BE32(0xffffffff); } diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h index 3990bda14980..c58b49586b5d 100644 --- a/lib/ethdev/rte_flow.h +++ b/lib/ethdev/rte_flow.h @@ -1499,16 +1499,14 @@ struct rte_flow_item_icmp6_nd_ns { uint8_t code; /**< ICMPv6 code, normally 0. */ rte_be16_t checksum; /**< ICMPv6 checksum. */ rte_be32_t reserved; /**< Reserved, normally 0. */ - uint8_t target_addr[16]; /**< Target address. */ + struct rte_ipv6_addr target_addr; /**< Target address. */ }; /** Default mask for RTE_FLOW_ITEM_TYPE_ICMP6_ND_NS. */ #ifndef __cplusplus static const struct rte_flow_item_icmp6_nd_ns rte_flow_item_icmp6_nd_ns_mask = { - .target_addr = - "\xff\xff\xff\xff\xff\xff\xff\xff" - "\xff\xff\xff\xff\xff\xff\xff\xff", + .target_addr = RTE_IPV6_MASK_FULL, }; #endif @@ -1526,16 +1524,14 @@ struct rte_flow_item_icmp6_nd_na { * reserved (29b). */ rte_be32_t rso_reserved; - uint8_t target_addr[16]; /**< Target address. */ + struct rte_ipv6_addr target_addr; /**< Target address. */ }; /** Default mask for RTE_FLOW_ITEM_TYPE_ICMP6_ND_NA. */ #ifndef __cplusplus static const struct rte_flow_item_icmp6_nd_na rte_flow_item_icmp6_nd_na_mask = { - .target_addr = - "\xff\xff\xff\xff\xff\xff\xff\xff" - "\xff\xff\xff\xff\xff\xff\xff\xff", + .target_addr = RTE_IPV6_MASK_FULL, }; #endif @@ -3806,7 +3802,7 @@ struct rte_flow_action_set_ipv4 { * specified outermost IPv6 header. */ struct rte_flow_action_set_ipv6 { - uint8_t ipv6_addr[16]; + struct rte_ipv6_addr ipv6_addr; }; /** @@ -5190,8 +5186,8 @@ struct rte_flow_tunnel { rte_be32_t dst_addr; /**< IPv4 destination address. */ } ipv4; struct { - uint8_t src_addr[16]; /**< IPv6 source address. */ - uint8_t dst_addr[16]; /**< IPv6 destination address. */ + struct rte_ipv6_addr src_addr; /**< IPv6 source address. */ + struct rte_ipv6_addr dst_addr; /**< IPv6 destination address. */ } ipv6; }; rte_be16_t tp_src; /**< Tunnel port source. */ -- 2.46.2