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 C008845B09; Thu, 10 Oct 2024 21:43:55 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7F18540DDC; Thu, 10 Oct 2024 21:43:10 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 3E90B40E19 for ; Thu, 10 Oct 2024 21:43:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1728589387; 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=SxkJPkhCKpggQU1zk63xMLqWHaZPxj6ckP5zfEavGBE=; b=Yi+11j/SV1d58F3JwYuv3V4dm07Yt5yjVTHTDzwyh2e70N4KiQsxryEqt2lNZxXPsmP7Hj 1O6VjTFz3nIndFAjvB5nNLNTAi3cLHD8OZZO2lD8fMcwLZ266ppsX4PJwXk4ji78aARtt3 +tZ2x81TfXmjmX3wTc3vKNAFgyrKhgE= 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-318-IJP4uqPfPca5eDODjVa-Yw-1; Thu, 10 Oct 2024 15:43:06 -0400 X-MC-Unique: IJP4uqPfPca5eDODjVa-Yw-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 6A8841955EA7; Thu, 10 Oct 2024 19:43:05 +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 C2AE719560AA; Thu, 10 Oct 2024 19:43:03 +0000 (UTC) From: Robin Jarry To: dev@dpdk.org, Jiayu Hu Subject: [PATCH dpdk v3 14/17] gro: use struct rte_ipv6_addr Date: Thu, 10 Oct 2024 21:41:44 +0200 Message-ID: <20241010194148.1877659-15-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 tcp6_flow_key to use rte_ipv6_addr structures instead of uint8_t[16] arrays. Use the IPv6 utils that go along. Signed-off-by: Robin Jarry --- Notes: v3: replace memcpy() with direct struct assignments doc/guides/rel_notes/deprecation.rst | 2 -- doc/guides/rel_notes/release_24_11.rst | 1 + lib/gro/gro_tcp6.c | 8 ++++---- lib/gro/gro_tcp6.h | 6 ++++-- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst index dc0c6e4182ff..f384a4b414c9 100644 --- a/doc/guides/rel_notes/deprecation.rst +++ b/doc/guides/rel_notes/deprecation.rst @@ -70,8 +70,6 @@ Deprecation Notices - ``struct rte_flow_item_icmp6_nd_na`` - ``struct rte_flow_action_set_ipv6`` - ``struct rte_flow_tunnel`` - gro - - ``struct tcp6_flow_key`` * net, ethdev: The flow item ``RTE_FLOW_ITEM_TYPE_VXLAN_GPE`` is replaced with ``RTE_FLOW_ITEM_TYPE_VXLAN``. diff --git a/doc/guides/rel_notes/release_24_11.rst b/doc/guides/rel_notes/release_24_11.rst index 54badeeecabd..f912f78017d7 100644 --- a/doc/guides/rel_notes/release_24_11.rst +++ b/doc/guides/rel_notes/release_24_11.rst @@ -152,6 +152,7 @@ API Changes * ipsec: ``rte_ipsec_sadv6_key`` was modified to use ``struct rte_ipv6_addr`` instead of ``uint8_t[16]`` fields. * 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. ABI Changes ----------- diff --git a/lib/gro/gro_tcp6.c b/lib/gro/gro_tcp6.c index 6edfb6045cf6..ab4cd6c68bf0 100644 --- a/lib/gro/gro_tcp6.c +++ b/lib/gro/gro_tcp6.c @@ -99,8 +99,8 @@ insert_new_flow(struct gro_tcp6_tbl *tbl, dst = &(tbl->flows[flow_idx].key); ASSIGN_COMMON_TCP_KEY((&src->cmn_key), (&dst->cmn_key)); - memcpy(&dst->src_addr[0], &src->src_addr[0], sizeof(dst->src_addr)); - memcpy(&dst->dst_addr[0], &src->dst_addr[0], sizeof(dst->dst_addr)); + dst->src_addr = src->src_addr; + dst->dst_addr = src->dst_addr; dst->vtc_flow = src->vtc_flow; tbl->flows[flow_idx].start_index = item_idx; @@ -168,8 +168,8 @@ gro_tcp6_reassemble(struct rte_mbuf *pkt, rte_ether_addr_copy(&(eth_hdr->src_addr), &(key.cmn_key.eth_saddr)); rte_ether_addr_copy(&(eth_hdr->dst_addr), &(key.cmn_key.eth_daddr)); - memcpy(&key.src_addr[0], &ipv6_hdr->src_addr, sizeof(key.src_addr)); - memcpy(&key.dst_addr[0], &ipv6_hdr->dst_addr, sizeof(key.dst_addr)); + key.src_addr = ipv6_hdr->src_addr; + key.dst_addr = ipv6_hdr->dst_addr; key.cmn_key.src_port = tcp_hdr->src_port; key.cmn_key.dst_port = tcp_hdr->dst_port; key.cmn_key.recv_ack = tcp_hdr->recv_ack; diff --git a/lib/gro/gro_tcp6.h b/lib/gro/gro_tcp6.h index 073122f0ec84..acf3971bb6e9 100644 --- a/lib/gro/gro_tcp6.h +++ b/lib/gro/gro_tcp6.h @@ -5,6 +5,8 @@ #ifndef _GRO_TCP6_H_ #define _GRO_TCP6_H_ +#include + #include "gro_tcp.h" #define GRO_TCP6_TBL_MAX_ITEM_NUM (1024UL * 1024UL) @@ -12,8 +14,8 @@ /* Header fields representing a TCP/IPv6 flow */ struct tcp6_flow_key { struct cmn_tcp_key cmn_key; - uint8_t src_addr[16]; - uint8_t dst_addr[16]; + struct rte_ipv6_addr src_addr; + struct rte_ipv6_addr dst_addr; rte_be32_t vtc_flow; }; -- 2.46.2