[PATCH dpdk v2 03/16] net: add structure for ipv6 addresses

Robin Jarry rjarry at redhat.com
Tue Oct 1 10:17:15 CEST 2024


There is currently no structure defined for IPv6 addresses. Introduce
one that is simply a uint8_t array of 16 elements without any union. The
idea is to ensure this structure alignment is 1 so that it can be mapped
directly on unaligned packet memory.

Signed-off-by: Robin Jarry <rjarry at redhat.com>
---
 lib/net/rte_ip6.h | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/lib/net/rte_ip6.h b/lib/net/rte_ip6.h
index 5ad1dd25db08..52c41088681e 100644
--- a/lib/net/rte_ip6.h
+++ b/lib/net/rte_ip6.h
@@ -35,6 +35,16 @@
 extern "C" {
 #endif
 
+#define RTE_IPV6_ADDR_SIZE 16
+#define RTE_IPV6_MAX_DEPTH 128
+
+/**
+ * IPv6 Address
+ */
+struct rte_ipv6_addr {
+	unsigned char a[RTE_IPV6_ADDR_SIZE];
+};
+
 /**
  * IPv6 Header
  */
-- 
2.46.1



More information about the dev mailing list