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 E726745A78; Tue, 1 Oct 2024 10:19:29 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8A19B40DDE; Tue, 1 Oct 2024 10:18:24 +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 2680D40DD3 for ; Tue, 1 Oct 2024 10:18:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1727770702; 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=Ah3nuKjLAYUpvswEQdtV6qqYhoLztE+ZWWxpsWQzVj4=; b=RmDds6zUxMa5LZareK2creqjpYeS9kYYFpJ3CBMK0nV7fyiBF6vpSwP8DVgFD798LjIfAN 6oyPYqsTMM+1Wk4pNltTovmbAmJcfL33HMV+yY1WfBzxS/onuTlP0fWqAeX/JrEhV2pkQg ycjdNWqQI/msxLPHUIEjT59zP+GRaJo= 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-508-04C1aU5iNlmjPi5X7n_wGQ-1; Tue, 01 Oct 2024 04:18:19 -0400 X-MC-Unique: 04C1aU5iNlmjPi5X7n_wGQ-1 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (unknown [10.30.177.15]) (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 C76291955EA7; Tue, 1 Oct 2024 08:18:18 +0000 (UTC) Received: from ringo.redhat.com (unknown [10.39.208.33]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 450431979060; Tue, 1 Oct 2024 08:18:17 +0000 (UTC) From: Robin Jarry To: dev@dpdk.org, Jiayu Hu Subject: [PATCH dpdk v2 12/16] gro: use ipv6 addr struct Date: Tue, 1 Oct 2024 10:17:24 +0200 Message-ID: <20241001081728.301272-13-rjarry@redhat.com> In-Reply-To: <20241001081728.301272-1-rjarry@redhat.com> References: <20240821162516.610624-17-rjarry@redhat.com> <20241001081728.301272-1-rjarry@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 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 the recently introduced IPv6 address structure instead of uint8_t[16] arrays. Signed-off-by: Robin Jarry --- Notes: v2: updated changelog for 24.11 doc/guides/rel_notes/deprecation.rst | 2 -- doc/guides/rel_notes/release_24_11.rst | 2 ++ lib/gro/gro_tcp6.c | 8 ++++---- lib/gro/gro_tcp6.h | 6 ++++-- 4 files changed, 10 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 78d222be180e..d6d75033bf8f 100644 --- a/doc/guides/rel_notes/release_24_11.rst +++ b/doc/guides/rel_notes/release_24_11.rst @@ -97,6 +97,8 @@ API Changes ``uint8_t[16]`` fields. * hash: ``rte_ipv6_tuple`` was modified to use ``rte_ipv6_addr`` structures instead of ``uint8_t[16]`` fields. +* gro: ``tcp6_flow_key`` was modified to use ``rte_ipv6_addr`` structures instead of ``uint8_t[16]`` + fields. ABI Changes ----------- diff --git a/lib/gro/gro_tcp6.c b/lib/gro/gro_tcp6.c index 6edfb6045cf6..0c6adbf2ecdb 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)); + rte_ipv6_addr_cpy(&dst->src_addr, &src->src_addr); + rte_ipv6_addr_cpy(&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)); + rte_ipv6_addr_cpy(&key.src_addr, &ipv6_hdr->src_addr); + rte_ipv6_addr_cpy(&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.1