Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
FROM --platform=${TARGETPLATFORM} debian:12-slim AS builder

ARG TARGETARCH
ARG DPDK_VER=23.11.3
ARG DPDK_VER=24.11.1
ARG DPDK_BUILDTYPE=release
ARG DPSERVICE_BUILDTYPE=debug
ARG DPSERVICE_FEATURES=""
Expand Down Expand Up @@ -57,11 +57,12 @@ ENV DPDK_DIR=/workspace/dpdk-stable-${DPDK_VER}
# Copy DPDK patches
COPY hack/*.patch hack/
RUN cd $DPDK_DIR \
&& patch -p1 -R < ../hack/dpdk_23_11_3_mtu.patch \
&& patch -p1 < ../hack/dpdk_23_11_3_fdb_def_rule.patch \
&& patch -p1 < ../hack/dpdk_23_11_log.patch \
&& patch -p1 < ../hack/dpdk_23_11_telemetry_key.patch \
&& patch -p1 < ../hack/dpdk_23_11_ethdev_conversion.patch
&& patch -p1 -R < ../hack/dpdk_24_11_mtu.patch \
&& patch -p1 < ../hack/dpdk_24_11_fdb_def_rule.patch \
&& patch -p1 < ../hack/dpdk_24_11_log.patch \
&& patch -p1 < ../hack/dpdk_24_11_telemetry_key.patch \
&& patch -p1 < ../hack/dpdk_24_11_no_pattern_template_validation.patch \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought that we agreed to make this optional with a docker parameter ? or do I miss smt here ?

Copy link
Contributor Author

@PlagueCZ PlagueCZ Apr 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was when the change would mean changing functionality. I later discovered that we can simply not validate without changing any functionality. Validation was only a feature introduced in 24, so this was never used before.

The build argument was meant to be there because the previous solution of mine would prevent anyone from using sync-flow-api, but the current solution does not prevent anything.

We can still make it a parameter of course, it's just that this is basically similar to the MTU patch now, removing some additional behavior that has been added in 24 but we do not actually need.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for clarifying. If the sync-flow-api is not effected then this can stay without Docker parameter.

&& patch -p1 < ../hack/dpdk_24_11_ethdev_conversion.patch

# Compile DPDK
RUN cd $DPDK_DIR && meson setup -Dmax_ethports=132 -Dplatform=generic -Ddisable_drivers=common/dpaax,\
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index 584a51b393..575ff03e8d 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -1437,7 +1437,12 @@ mlx5_dev_args_check_handler(const char *key, const char *val, void *opaque)
@@ -1439,7 +1439,12 @@ mlx5_dev_args_check_handler(const char *key, const char *val, void *opaque)
} else if (strcmp(MLX5_ALLOW_DUPLICATE_PATTERN, key) == 0) {
config->allow_duplicate_pattern = !!tmp;
} else if (strcmp(MLX5_FDB_DEFAULT_RULE_EN, key) == 0) {
Expand All @@ -29,7 +29,7 @@ diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h
index 55c29e31a2..382debdbfb 100644
--- a/drivers/net/mlx5/mlx5.h
+++ b/drivers/net/mlx5/mlx5.h
@@ -363,7 +363,7 @@ struct mlx5_sh_config {
@@ -377,7 +377,7 @@ struct mlx5_sh_config {
uint32_t cycle_time; /* query cycle time in milli-second. */
} cnt_svc; /* configure for HW steering's counter's service. */
/* Allow/Prevent the duplicate rules pattern. */
Expand All @@ -42,7 +42,7 @@ diff --git a/drivers/net/mlx5/mlx5_trigger.c b/drivers/net/mlx5/mlx5_trigger.c
index fe2c512c5c..0289efe3f1 100644
--- a/drivers/net/mlx5/mlx5_trigger.c
+++ b/drivers/net/mlx5/mlx5_trigger.c
@@ -1514,7 +1514,7 @@ mlx5_traffic_enable_hws(struct rte_eth_dev *dev)
@@ -1523,7 +1523,7 @@ mlx5_traffic_enable_hws(struct rte_eth_dev *dev)
}
mlx5_txq_release(dev, i);
}
Expand Down
30 changes: 3 additions & 27 deletions hack/dpdk_23_11_log.patch → hack/dpdk_24_11_log.patch
Original file line number Diff line number Diff line change
@@ -1,48 +1,24 @@
diff --color -ruN dpdk-23.11/lib/log/log.c dpdk-23.11-patch/lib/log/log.c
--- dpdk-23.11/lib/log/log.c 2023-11-28 14:35:41.000000000 +0000
+++ dpdk-23.11-patch/lib/log/log.c 2024-03-04 15:01:39.318300347 +0000
@@ -31,11 +31,14 @@
uint32_t type; /**< Bitfield with enabled logs. */
uint32_t level; /**< Log level. */
FILE *file; /**< Output file set by rte_openlog_stream, or NULL. */
+ /** Print function set by rte_log_set_print_func, or vfprintf. */
+ int (*func)(FILE *stream, const char *format, va_list ap);
size_t dynamic_types_len;
struct rte_log_dynamic_type *dynamic_types;
} rte_logs = {
.type = UINT32_MAX,
.level = RTE_LOG_DEBUG,
+ .func = vfprintf,
};

struct rte_eal_opt_loglevel {
@@ -80,6 +83,13 @@
@@ -85,6 +88,13 @@
return 0;
}

+/* Change the print function that will be used by the logging system. */
+void
+rte_log_set_print_func(int (*func)(FILE *stream, const char *format, va_list ap))
+{
+ rte_logs.func = func;
+ rte_logs.print_func = func;
+}
+
FILE *
rte_log_get_stream(void)
{
@@ -501,7 +511,7 @@
RTE_PER_LCORE(log_cur_msg).loglevel = level;
RTE_PER_LCORE(log_cur_msg).logtype = logtype;

- ret = vfprintf(f, format, ap);
+ ret = rte_logs.func(f, format, ap);
fflush(f);
return ret;
}
diff --color -ruN dpdk-23.11/lib/log/rte_log.h dpdk-23.11-patch/lib/log/rte_log.h
--- dpdk-23.11/lib/log/rte_log.h 2023-11-28 14:35:41.000000000 +0000
+++ dpdk-23.11-patch/lib/log/rte_log.h 2024-03-04 15:03:08.442486094 +0000
@@ -88,6 +88,18 @@
@@ -89,6 +89,18 @@
int rte_openlog_stream(FILE *f);

/**
Expand Down
File renamed without changes.
13 changes: 13 additions & 0 deletions hack/dpdk_24_11_no_pattern_template_validation.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c
index 50dbaa27ab..460ec07933 100644
--- a/drivers/net/mlx5/mlx5_flow_hw.c
+++ b/drivers/net/mlx5/mlx5_flow_hw.c
@@ -8838,6 +8838,8 @@ pattern_template_validate(struct rte_eth_dev *dev,
uint32_t pt_num,
struct rte_flow_error *error)
{
+ return 0;
+
struct mlx5_flow_template_table_cfg tbl_cfg = {
.attr = {
.nb_flows = 64,
27 changes: 17 additions & 10 deletions include/dp_ipaddr.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,6 @@ extern "C" {
#define DP_IPV6_ADDR_SIZE 16
static_assert(sizeof(rte_be64_t) * 2 == DP_IPV6_ADDR_SIZE, "DP_IPV6_ADDR_SIZE is invalid");

#define DP_INIT_FROM_IPV6(IPV6) { \
(IPV6)->bytes[0], (IPV6)->bytes[1], (IPV6)->bytes[2], (IPV6)->bytes[3], \
(IPV6)->bytes[4], (IPV6)->bytes[5], (IPV6)->bytes[6], (IPV6)->bytes[7], \
(IPV6)->bytes[8], (IPV6)->bytes[9], (IPV6)->bytes[10], (IPV6)->bytes[11], \
(IPV6)->bytes[12], (IPV6)->bytes[13], (IPV6)->bytes[14], (IPV6)->bytes[15] }

#define DP_UNDERLAY_FLAG_EXTERNALLY_GENERATED 0x80
#define DP_UNDERLAY_FLAG_SECONDARY_POOL 0x40

Expand All @@ -47,8 +41,10 @@ union dp_ipv6 {
uint8_t random;
rte_be32_t local;
} _ul;
const struct rte_ipv6_addr addr;
};
static_assert(sizeof(union dp_ipv6) == DP_IPV6_ADDR_SIZE, "union dp_ipv6 has padding");
static_assert(sizeof(struct rte_ipv6_addr) == DP_IPV6_ADDR_SIZE, "rte_ipv6_addr does not match dp_ipv6");

extern const union dp_ipv6 dp_empty_ipv6;
extern const union dp_ipv6 dp_multicast_ipv6;
Expand All @@ -63,15 +59,26 @@ void dp_copy_ipv6(union dp_ipv6 *dst, const union dp_ipv6 *src)
}

#define DP_IPV6_FROM_ARRAY(IPV6, ARRAY) do { \
static_assert(sizeof(ARRAY) == sizeof(union dp_ipv6), "Invalid array size for DP_SET_IPV6"); \
static_assert(sizeof(ARRAY) == sizeof(union dp_ipv6), "Invalid array size for DP_IPV6_FROM_ARRAY"); \
dp_copy_ipv6((IPV6), (const union dp_ipv6 *)(ARRAY)); \
} while (0)

#define DP_ARRAY_FROM_IPV6(ARRAY, IPV6) do { \
#define DP_IPV6_TO_ARRAY(IPV6, ARRAY) do { \
static_assert(sizeof(ARRAY) == sizeof(union dp_ipv6), "Invalid array size for DP_IPV6_TO_ARRAY"); \
dp_copy_ipv6((union dp_ipv6 *)(ARRAY), (IPV6)); \
} while (0)

static __rte_always_inline
void dp_ipv6_from_rte(union dp_ipv6 *ipv6, const struct rte_ipv6_addr *rte_ipv6)
{
dp_copy_ipv6(ipv6, (const union dp_ipv6 *)rte_ipv6);
}
static __rte_always_inline
void dp_ipv6_to_rte(const union dp_ipv6 *ipv6, struct rte_ipv6_addr *rte_ipv6)
{
dp_copy_ipv6((union dp_ipv6 *)rte_ipv6, ipv6);
}

static __rte_always_inline
const union dp_ipv6 *dp_get_src_ipv6(const struct rte_ipv6_hdr *ipv6_hdr)
{
Expand All @@ -89,13 +96,13 @@ static __rte_always_inline
void dp_set_src_ipv6(struct rte_ipv6_hdr *ipv6_hdr, const union dp_ipv6 *ipv6)
{
static_assert(sizeof(ipv6_hdr->src_addr) == sizeof(union dp_ipv6), "Structure dp_ipv6 is not compatible with IPv6 source address");
dp_copy_ipv6((union dp_ipv6 *)ipv6_hdr->src_addr, ipv6);
dp_copy_ipv6((union dp_ipv6 *)ipv6_hdr->src_addr.a, ipv6);
}
static __rte_always_inline
void dp_set_dst_ipv6(struct rte_ipv6_hdr *ipv6_hdr, const union dp_ipv6 *ipv6)
{
static_assert(sizeof(ipv6_hdr->dst_addr) == sizeof(union dp_ipv6), "Structure dp_ipv6 is not compatible with IPv6 destination address");
dp_copy_ipv6((union dp_ipv6 *)ipv6_hdr->dst_addr, ipv6);
dp_copy_ipv6((union dp_ipv6 *)ipv6_hdr->dst_addr.a, ipv6);
}

static __rte_always_inline
Expand Down
12 changes: 6 additions & 6 deletions include/rte_flow/dp_rte_flow_helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,17 @@ static const struct rte_flow_item_ipv6 dp_flow_item_ipv6_mask = {
.hdr.proto = 0xff,
};
static const struct rte_flow_item_ipv6 dp_flow_item_ipv6_src_mask = {
.hdr.src_addr = "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff",
.hdr.src_addr.a = "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff",
.hdr.proto = 0xff,
};
static const struct rte_flow_item_ipv6 dp_flow_item_ipv6_dst_mask = {
.hdr.dst_addr = "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff",
.hdr.dst_addr.a = "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff",
.hdr.proto = 0xff,
};
#ifdef ENABLE_VIRTSVC
static const struct rte_flow_item_ipv6 dp_flow_item_ipv6_src_dst_mask = {
.hdr.src_addr = "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff",
.hdr.dst_addr = "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff",
.hdr.src_addr.a = "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff",
.hdr.dst_addr.a = "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff",
.hdr.proto = 0xff,
};
#endif
Expand Down Expand Up @@ -473,7 +473,7 @@ void dp_set_ipv6_set_src_action(struct rte_flow_action *action,
struct rte_flow_action_set_ipv6 *ipv6_action,
const union dp_ipv6 *ipv6)
{
DP_ARRAY_FROM_IPV6(ipv6_action->ipv6_addr, ipv6);
dp_ipv6_to_rte(ipv6, &ipv6_action->ipv6_addr);
action->type = RTE_FLOW_ACTION_TYPE_SET_IPV6_SRC;
action->conf = ipv6_action;
}
Expand All @@ -483,7 +483,7 @@ void dp_set_ipv6_set_dst_action(struct rte_flow_action *action,
struct rte_flow_action_set_ipv6 *ipv6_action,
const union dp_ipv6 *ipv6)
{
DP_ARRAY_FROM_IPV6(ipv6_action->ipv6_addr, ipv6);
dp_ipv6_to_rte(ipv6, &ipv6_action->ipv6_addr);
action->type = RTE_FLOW_ACTION_TYPE_SET_IPV6_DST;
action->conf = ipv6_action;
}
Expand Down
10 changes: 5 additions & 5 deletions src/dp_flow.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ static __rte_always_inline int dp_build_icmp_flow_key(const struct dp_flow *df,
{
struct dp_icmp_err_ip_info icmp_err_ip_info = {0};

if (df->l4_info.icmp_field.icmp_type == RTE_IP_ICMP_ECHO_REPLY || df->l4_info.icmp_field.icmp_type == RTE_IP_ICMP_ECHO_REQUEST) {
if (df->l4_info.icmp_field.icmp_type == RTE_ICMP_TYPE_ECHO_REPLY || df->l4_info.icmp_field.icmp_type == RTE_ICMP_TYPE_ECHO_REQUEST) {
key->port_dst = ntohs(df->l4_info.icmp_field.icmp_identifier);
key->src.type_src = df->l4_info.icmp_field.icmp_type;
return DP_OK;
Expand Down Expand Up @@ -194,10 +194,10 @@ void dp_invert_flow_key(const struct flow_key *key /* in */, struct flow_key *in
inv_key->port_dst = key->src.port_src;
} else if (key->proto == IPPROTO_ICMP) {
inv_key->port_dst = key->port_dst;
if (key->src.type_src == RTE_IP_ICMP_ECHO_REPLY)
inv_key->src.type_src = RTE_IP_ICMP_ECHO_REQUEST;
else if (key->src.type_src == RTE_IP_ICMP_ECHO_REQUEST)
inv_key->src.type_src = RTE_IP_ICMP_ECHO_REPLY;
if (key->src.type_src == RTE_ICMP_TYPE_ECHO_REPLY)
inv_key->src.type_src = RTE_ICMP_TYPE_ECHO_REQUEST;
else if (key->src.type_src == RTE_ICMP_TYPE_ECHO_REQUEST)
inv_key->src.type_src = RTE_ICMP_TYPE_ECHO_REPLY;
else
inv_key->src.type_src = 0;
} else if (key->proto == IPPROTO_ICMPV6) {
Expand Down
16 changes: 8 additions & 8 deletions src/dp_lpm.c
Original file line number Diff line number Diff line change
Expand Up @@ -231,11 +231,11 @@ int dp_add_route6(const struct dp_port *port, uint32_t vni, uint32_t t_vni, cons
if (!root)
return DP_GRPC_ERR_NO_VNI;

node = rte_rib6_lookup_exact(root, ipv6->bytes, depth);
node = rte_rib6_lookup_exact(root, &ipv6->addr, depth);
if (node)
return DP_GRPC_ERR_ROUTE_EXISTS;

node = rte_rib6_insert(root, ipv6->bytes, depth);
node = rte_rib6_insert(root, &ipv6->addr, depth);
if (!node)
return DP_GRPC_ERR_ROUTE_INSERT;

Expand All @@ -261,7 +261,7 @@ int dp_del_route6(const struct dp_port *port, uint32_t vni, const union dp_ipv6
if (!root)
return DP_GRPC_ERR_NO_VNI;

node = rte_rib6_lookup_exact(root, ipv6->bytes, depth);
node = rte_rib6_lookup_exact(root, &ipv6->addr, depth);
if (!node)
return DP_GRPC_ERR_ROUTE_NOT_FOUND;

Expand All @@ -270,7 +270,7 @@ int dp_del_route6(const struct dp_port *port, uint32_t vni, const union dp_ipv6
if (next_hop != port->port_id)
return DP_GRPC_ERR_ROUTE_BAD_PORT;

rte_rib6_remove(root, ipv6->bytes, depth);
rte_rib6_remove(root, &ipv6->addr, depth);
return DP_GRPC_OK;
}

Expand Down Expand Up @@ -323,7 +323,7 @@ const struct dp_port *dp_get_ip6_out_port(const struct dp_port *in_port,
struct rte_rib6 *root;
uint64_t next_hop;
struct dp_port *dst_port;
uint8_t ip[RTE_RIB6_IPV6_ADDR_SIZE];
struct rte_ipv6_addr ip;

if (t_vni == 0)
t_vni = in_port->iface.vni;
Expand All @@ -332,7 +332,7 @@ const struct dp_port *dp_get_ip6_out_port(const struct dp_port *in_port,
if (!root)
return NULL;

node = rte_rib6_lookup(root, df->dst.dst_addr6.bytes);
node = rte_rib6_lookup(root, &df->dst.dst_addr6.addr);
if (!node)
return NULL;

Expand All @@ -346,9 +346,9 @@ const struct dp_port *dp_get_ip6_out_port(const struct dp_port *in_port,
if (dst_port->is_pf)
rte_memcpy(route, rte_rib6_get_ext(node), sizeof(*route));

if (DP_FAILED(rte_rib6_get_ip(node, ip)))
if (DP_FAILED(rte_rib6_get_ip(node, &ip)))
return NULL;

DP_IPV6_FROM_ARRAY(p_ipv6, ip);
dp_ipv6_from_rte(p_ipv6, &ip);
return dst_port;
}
8 changes: 4 additions & 4 deletions src/dp_nat.c
Original file line number Diff line number Diff line change
Expand Up @@ -396,9 +396,9 @@ int dp_nat_chg_ipv6_to_ipv4_hdr(struct dp_flow *df, struct rte_mbuf *m, uint32_t
icmp_hdr = (struct rte_icmp_hdr *)(ipv4_hdr + 1);
icmp_hdr->icmp_code = 0;
if (icmp_hdr->icmp_type == DP_ICMPV6_ECHO_REQUEST)
icmp_hdr->icmp_type = RTE_IP_ICMP_ECHO_REQUEST;
icmp_hdr->icmp_type = RTE_ICMP_TYPE_ECHO_REQUEST;
else if (icmp_hdr->icmp_type == DP_ICMPV6_ECHO_REPLY)
icmp_hdr->icmp_type = RTE_IP_ICMP_ECHO_REPLY;
icmp_hdr->icmp_type = RTE_ICMP_TYPE_ECHO_REPLY;
else
return DP_ERROR; //Drop unsupported ICMP Types for the time being
dp_calculate_icmp_checksum(icmp_hdr, rte_be_to_cpu_16(ipv4_hdr->total_length) - ((ipv4_hdr->version_ihl & 0x0F) * 4));
Expand Down Expand Up @@ -476,9 +476,9 @@ int dp_nat_chg_ipv4_to_ipv6_hdr(struct dp_flow *df, struct rte_mbuf *m, const un
icmp_hdr->icmp_code = 0;
icmp_hdr->icmp_cksum = 0;

if (icmp_hdr->icmp_type == RTE_IP_ICMP_ECHO_REQUEST)
if (icmp_hdr->icmp_type == RTE_ICMP_TYPE_ECHO_REQUEST)
icmp_hdr->icmp_type = DP_ICMPV6_ECHO_REQUEST;
else if (icmp_hdr->icmp_type == RTE_IP_ICMP_ECHO_REPLY)
else if (icmp_hdr->icmp_type == RTE_ICMP_TYPE_ECHO_REPLY)
icmp_hdr->icmp_type = DP_ICMPV6_ECHO_REPLY;
else
return DP_ERROR; //Drop unsupported ICMP Types for the time being
Expand Down
2 changes: 1 addition & 1 deletion src/dp_periodic_msg.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ void trigger_nd_unsol_adv(void)
icmp6_hdr->icmp6_override = 1;
icmp6_hdr->icmp6_router = 1;

DP_ARRAY_FROM_IPV6(ns_msg->target, gw_ip);
DP_IPV6_TO_ARRAY(gw_ip, ns_msg->target);
pkt_size = sizeof(struct rte_ether_hdr) + sizeof(struct rte_ipv6_hdr) +
sizeof(struct icmp6hdr) + sizeof(struct in6_addr);
pkt->data_len = pkt_size;
Expand Down
2 changes: 1 addition & 1 deletion src/monitoring/dp_graphtrace_shared.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ static int dp_graphtrace_sprint_ipv6(void **p_pkt_data, size_t *p_pos, char *buf

PRINT_LAYER(p_pos, buf, bufsize,
DP_IPV6_PRINT_FMT " -> " DP_IPV6_PRINT_FMT,
DP_IPV6_PRINT_BYTES(ipv6_hdr->src_addr), DP_IPV6_PRINT_BYTES(ipv6_hdr->dst_addr));
DP_IPV6_PRINT_BYTES(ipv6_hdr->src_addr.a), DP_IPV6_PRINT_BYTES(ipv6_hdr->dst_addr.a));

*p_pkt_data = ipv6_hdr + 1;
return ipv6_hdr->proto;
Expand Down
5 changes: 3 additions & 2 deletions src/nodes/dhcpv6_node.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,10 @@ static __rte_always_inline int parse_options(struct rte_mbuf *m,
reply_options->opt_iana = opt_iana_template;
reply_options->opt_iana.ia_na.iaid = ((const struct dhcpv6_ia_na *)&opt->data)->iaid;
// cannot use optimized function here due to the destination being packed (can cause alignment problems)
static_assert(sizeof(reply_options->opt_iana.ia_na.options[0].addr.ipv6) == sizeof(dp_get_in_port(m)->iface.cfg.dhcp_ipv6),
static_assert(sizeof(reply_options->opt_iana.ia_na.options[0].addr.ipv6) == sizeof(dp_get_in_port(m)->iface.cfg.dhcp_ipv6.bytes),
"Incompatible IPv6 array for IA_NA options");
rte_memcpy(reply_options->opt_iana.ia_na.options[0].addr.ipv6, dp_get_in_port(m)->iface.cfg.dhcp_ipv6.bytes, DP_IPV6_ADDR_SIZE);
rte_memcpy(reply_options->opt_iana.ia_na.options[0].addr.ipv6,
dp_get_in_port(m)->iface.cfg.dhcp_ipv6.bytes, sizeof(dp_get_in_port(m)->iface.cfg.dhcp_ipv6.bytes));
reply_options->opt_iana_len = sizeof(opt_iana_template);
break;
case DHCPV6_OPT_RAPID_COMMIT:
Expand Down
Loading
Loading