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

Signed-off-by: Robin Jarry <rja...@redhat.com>
---

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 <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.1

Reply via email to