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 BC9BD45834; Wed, 21 Aug 2024 18:28:05 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9EC11427C1; Wed, 21 Aug 2024 18:28:00 +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 AD24F427CA for ; Wed, 21 Aug 2024 18:27:59 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1724257679; 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=AZOWU6x7ZtrmKmQ5MFbynmhzSrORWAACBHSVZSAc2os=; b=W334AX7aOZeRCD+ics0YGV2sF2wyIO30PwbsawRqPqvGnRRznhu4vJRMIiW394KtpYWMrq jFqKBp/iGEpaYr9TLthefQHyviqGMiAsVS0NGyUNDMiGHJaeA0kyDVfa/n6VVWufJ5gyZz PGq4qc8aL+ep7Ex00av4NcpmIiMByyU= Received: from mx-prod-mc-04.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-360-UWKmN9WjPaOsUpjBeibsJw-1; Wed, 21 Aug 2024 12:27:57 -0400 X-MC-Unique: UWKmN9WjPaOsUpjBeibsJw-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-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id E63C119030BB; Wed, 21 Aug 2024 16:27:41 +0000 (UTC) Received: from localhost.localdomain (unknown [10.39.208.21]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 33F4E19772D2; Wed, 21 Aug 2024 16:27:08 +0000 (UTC) From: Robin Jarry To: dev@dpdk.org, Jiayu Hu Subject: [PATCH dpdk v1 12/15] gro: use ipv6 addr struct Date: Wed, 21 Aug 2024 18:25:29 +0200 Message-ID: <20240821162516.610624-29-rjarry@redhat.com> In-Reply-To: <20240821162516.610624-17-rjarry@redhat.com> References: <20240821162516.610624-17-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 the recently introduced IPv6 address structure instead of uint8_t[16] arrays. Signed-off-by: Robin Jarry --- lib/gro/gro_tcp6.c | 8 ++++---- lib/gro/gro_tcp6.h | 6 ++++-- 2 files changed, 8 insertions(+), 6 deletions(-) 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.0