DPDK patches and discussions
 help / color / mirror / Atom feed
From: Robin Jarry <rjarry@redhat.com>
To: dev@dpdk.org, Jiayu Hu <hujiayu.hu@foxmail.com>
Subject: [PATCH dpdk v1 12/15] gro: use ipv6 addr struct
Date: Wed, 21 Aug 2024 18:25:29 +0200	[thread overview]
Message-ID: <20240821162516.610624-29-rjarry@redhat.com> (raw)
In-Reply-To: <20240821162516.610624-17-rjarry@redhat.com>

Update tcp6_flow_key to use the recently introduced IPv6 address
structure instead of uint8_t[16] arrays.

Signed-off-by: Robin Jarry <rjarry@redhat.com>
---
 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 <rte_ip6.h>
+
 #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


  parent reply	other threads:[~2024-08-21 16:28 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-21 16:25 [PATCH dpdk v1 00/15] IPv6 APIs overhaul Robin Jarry
2024-08-21 16:25 ` [PATCH dpdk v1 01/15] net: split raw checksum functions in separate header Robin Jarry
2024-08-21 16:25 ` [PATCH dpdk v1 02/15] net: split ipv6 symbols " Robin Jarry
2024-08-21 16:25 ` [PATCH dpdk v1 03/15] net: add structure for ipv6 addresses Robin Jarry
2024-08-21 16:25 ` [PATCH dpdk v1 04/15] net: use ipv6 structure for header addresses Robin Jarry
2024-08-21 16:25 ` [PATCH dpdk v1 05/15] fib6,rib6,lpm6: use ipv6 addr struct Robin Jarry
2024-08-21 16:25 ` [PATCH dpdk v1 06/15] net: add ipv6 address utilities Robin Jarry
2024-08-21 16:25 ` [PATCH dpdk v1 07/15] fib6,rib6,lpm6: use ipv6 utils Robin Jarry
2024-08-21 16:25 ` [PATCH dpdk v1 08/15] graph,node: use ipv6 addr struct and utils Robin Jarry
2024-08-21 16:25 ` [PATCH dpdk v1 09/15] pipeline: use ipv6 addr struct Robin Jarry
2024-08-21 16:25 ` [PATCH dpdk v1 10/15] ipsec: " Robin Jarry
2024-08-21 16:25 ` [PATCH dpdk v1 11/15] thash: " Robin Jarry
2024-08-21 16:25 ` Robin Jarry [this message]
2024-08-21 16:25 ` [PATCH dpdk v1 13/15] rte_flow: " Robin Jarry
2024-08-21 16:25 ` [PATCH dpdk v1 14/15] rib6,fib6,lpm6: remove duplicate constants Robin Jarry
2024-08-21 16:25 ` [PATCH dpdk v1 15/15] net: add utilities for well known ipv6 address types Robin Jarry
2024-08-21 22:28 ` [PATCH dpdk v1 00/15] IPv6 APIs overhaul Morten Brørup
2024-08-22 14:13 ` Stephen Hemminger
2024-08-22 15:13   ` Morten Brørup
2024-08-22 15:27     ` Robin Jarry
2024-08-22 18:41       ` Morten Brørup
2024-08-22 15:14   ` Robin Jarry
2024-08-22 15:16   ` Robin Jarry

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240821162516.610624-29-rjarry@redhat.com \
    --to=rjarry@redhat.com \
    --cc=dev@dpdk.org \
    --cc=hujiayu.hu@foxmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).