Skip to content
Draft
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
17 changes: 9 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
FROM --platform=${TARGETPLATFORM} debian:13-slim AS builder

ARG TARGETARCH
ARG DPDK_VER=24.11.1
ARG DPDK_VER=25.07
ARG DPDK_BUILDTYPE=release
ARG DPSERVICE_BUILDTYPE=debug
ARG DPSERVICE_FEATURES=""
Expand Down Expand Up @@ -52,17 +52,18 @@ ENV PATH="${PATH}:/usr/local/go/bin"
ADD http://fast.dpdk.org/rel/dpdk-${DPDK_VER}.tar.xz dpdk.tar.xz
RUN tar -xJf dpdk.tar.xz

ENV DPDK_DIR=/workspace/dpdk-stable-${DPDK_VER}
ENV DPDK_DIR=/workspace/dpdk-${DPDK_VER}

# Copy DPDK patches
COPY hack/*.patch hack/

RUN cd $DPDK_DIR \
&& 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 \
&& patch -p1 < ../hack/dpdk_24_11_ethdev_conversion.patch
&& patch -p1 < ../hack/dpdk_25_07_fdb_def_rule.patch \
&& patch -p1 < ../hack/dpdk_25_07_log.patch \
&& patch -p1 < ../hack/dpdk_25_07_telemetry_key.patch \
&& patch -p1 < ../hack/dpdk_25_07_no_pattern_template_validation.patch \
&& patch -p1 < ../hack/dpdk_25_07_ethdev_conversion.patch \
&& patch -p1 < ../hack/dpdk_25_07_allow_outer_inner_ipip.patch

# Compile DPDK
RUN cd $DPDK_DIR && meson setup -Dmax_ethports=132 -Dplatform=generic -Ddisable_drivers=common/dpaax,\
Expand Down
24 changes: 0 additions & 24 deletions hack/dpdk_24_11_ethdev_conversion.patch

This file was deleted.

50 changes: 0 additions & 50 deletions hack/dpdk_24_11_log.patch

This file was deleted.

47 changes: 0 additions & 47 deletions hack/dpdk_24_11_mtu.patch

This file was deleted.

12 changes: 0 additions & 12 deletions hack/dpdk_24_11_telemetry_key.patch

This file was deleted.

34 changes: 34 additions & 0 deletions hack/dpdk_25_07_allow_outer_inner_ipip.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index 7b9e501..bc324ff 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -7927,13 +7927,7 @@ flow_dv_validate(struct rte_eth_dev *dev, const struct rte_flow_attr *attr,
mlx5_flow_tunnel_ip_check(items, next_protocol,
item_flags,
&l3_tunnel_flag);
- /*
- * explicitly allow inner IPIP match
- */
- if (l3_tunnel_detection == l3_tunnel_outer) {
- item_flags |= l3_tunnel_flag;
- tunnel = 1;
- }
+
ret = mlx5_flow_dv_validate_item_ipv4(dev, items,
item_flags,
last_item,
@@ -7954,13 +7948,7 @@ flow_dv_validate(struct rte_eth_dev *dev, const struct rte_flow_attr *attr,
mlx5_flow_tunnel_ip_check(items, next_protocol,
item_flags,
&l3_tunnel_flag);
- /*
- * explicitly allow inner IPIP match
- */
- if (l3_tunnel_detection == l3_tunnel_outer) {
- item_flags |= l3_tunnel_flag;
- tunnel = 1;
- }
+
ret = mlx5_flow_validate_item_ipv6(dev, items,
item_flags,
last_item,
26 changes: 26 additions & 0 deletions hack/dpdk_25_07_ethdev_conversion.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c
index dd7c00b..044a802 100644
--- a/lib/ethdev/rte_ethdev.c
+++ b/lib/ethdev/rte_ethdev.c
@@ -441,7 +441,7 @@ eth_is_valid_owner_id(uint64_t owner_id)
}

RTE_EXPORT_SYMBOL(rte_eth_find_next_owned_by)
-uint64_t
+uint16_t
rte_eth_find_next_owned_by(uint16_t port_id, const uint64_t owner_id)
{
port_id = rte_eth_find_next(port_id);
diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h
index f9fb6ae..f79c312 100644
--- a/lib/ethdev/rte_ethdev.h
+++ b/lib/ethdev/rte_ethdev.h
@@ -2155,7 +2155,7 @@ struct rte_eth_dev_owner {
* @return
* Next valid port ID owned by owner_id, RTE_MAX_ETHPORTS if there is none.
*/
-uint64_t rte_eth_find_next_owned_by(uint16_t port_id,
+uint16_t rte_eth_find_next_owned_by(uint16_t port_id,
const uint64_t owner_id);

/**
Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
This a patch to revert the effect of commit cf9a91c67b88071a03beb32a3ea9970e6ee00391.
(https://github.com/DPDK/dpdk/commit/cf9a91c67b88071a03beb32a3ea9970e6ee00391)
Before this commit, HA dpservice was able to run fine with fdb_def_rule_en=0.
After this commit, it would require manually setting up complex rte_flow rules
to achieve the same effect.
This patch simply immitates the old behavior by skipping over one call.
More details are to be found in the commit message.


diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index 584a51b393..575ff03e8d 100644
index 1321be7..8f3141d 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -1439,7 +1439,12 @@ mlx5_dev_args_check_handler(const char *key, const char *val, void *opaque)
@@ -1448,7 +1448,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 @@ -26,23 +17,23 @@ index 584a51b393..575ff03e8d 100644
config->cnt_svc.service_core = tmp;
} else if (strcmp(MLX5_HWS_CNT_CYCLE_TIME, key) == 0) {
diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h
index 55c29e31a2..382debdbfb 100644
index c08894c..7913e5e 100644
--- a/drivers/net/mlx5/mlx5.h
+++ b/drivers/net/mlx5/mlx5.h
@@ -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. */
@@ -387,7 +387,7 @@ struct mlx5_sh_config {
uint32_t allow_duplicate_pattern:1;
uint32_t lro_allowed:1; /* Whether LRO is allowed. */
/* Allow/Prevent the duplicate rules pattern. */
- uint32_t fdb_def_rule:1; /* Create FDB default jump rule */
+ uint32_t fdb_def_rule:2; /* Create FDB default jump rule */
uint32_t repr_matching:1; /* Enable implicit vport matching in HWS FDB. */
};

uint32_t txq_mem_algn; /* logarithm value of the TxQ address alignment. */
struct {
diff --git a/drivers/net/mlx5/mlx5_trigger.c b/drivers/net/mlx5/mlx5_trigger.c
index fe2c512c5c..0289efe3f1 100644
index 6c6f228..d637fa2 100644
--- a/drivers/net/mlx5/mlx5_trigger.c
+++ b/drivers/net/mlx5/mlx5_trigger.c
@@ -1523,7 +1523,7 @@ mlx5_traffic_enable_hws(struct rte_eth_dev *dev)
@@ -1622,7 +1622,7 @@ mlx5_traffic_enable_hws(struct rte_eth_dev *dev)
}
mlx5_txq_release(dev, i);
}
Expand Down
42 changes: 42 additions & 0 deletions hack/dpdk_25_07_log.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
diff --git a/lib/log/log.c b/lib/log/log.c
index 8ad5250..30a893e 100644
--- a/lib/log/log.c
+++ b/lib/log/log.c
@@ -91,6 +91,14 @@ rte_openlog_stream(FILE *f)
return 0;
}

+/* Change the print function that will be used by the logging system. */
+RTE_EXPORT_SYMBOL(rte_log_set_print_func)
+void
+rte_log_set_print_func(int (*func)(FILE *stream, const char *format, va_list ap))
+{
+ rte_logs.print_func = func;
+}
+
RTE_EXPORT_SYMBOL(rte_log_get_stream)
FILE *
rte_log_get_stream(void)
diff --git a/lib/log/rte_log.h b/lib/log/rte_log.h
index 3735137..f75cb06 100644
--- a/lib/log/rte_log.h
+++ b/lib/log/rte_log.h
@@ -88,6 +88,18 @@ extern "C" {
*/
int rte_openlog_stream(FILE *f);

+ /**
+ * Change the print function that will be used by the logging system.
+ *
+ * This can be done at any time. The func argument represents
+ * the vfprintf-like function to be used to print the logs.
+ * Without calling this function, the default (vfprintf) is used.
+ *
+ * @param func
+ * Pointer to the print function.
+ */
+void rte_log_set_print_func(int (*func)(FILE *stream, const char *format, va_list ap));
+
/**
* Retrieve the stream used by the logging system (see rte_openlog_stream()
* to change it).
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c
index 50dbaa27ab..460ec07933 100644
index 6dc16f8..3f21cd8 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,
@@ -8893,6 +8893,8 @@ pattern_template_validate(struct rte_eth_dev *dev,
uint32_t pt_num,
struct rte_flow_error *error)
{
Expand Down
13 changes: 13 additions & 0 deletions hack/dpdk_25_07_telemetry_key.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/lib/telemetry/telemetry_data.c b/lib/telemetry/telemetry_data.c
index c120600..4734962 100644
--- a/lib/telemetry/telemetry_data.c
+++ b/lib/telemetry/telemetry_data.c
@@ -151,7 +151,7 @@ static bool
valid_name(const char *name)
{
/* non-alphanumeric characters allowed in names */
- static const char allowed[128] = { ['_'] = 1, ['/'] = 1 };
+ static const char allowed[128] = { ['_'] = 1, ['/'] = 1, ['.'] = 1, [':'] = 1, ['-'] = 1 };

for (; *name != '\0'; name++) {
if (isalnum(*name))
4 changes: 2 additions & 2 deletions include/dp_flow.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ enum dp_flow_nat_type {
DP_FLOW_LB_TYPE_LOCAL_NEIGH_TRAFFIC,
DP_FLOW_LB_TYPE_RECIRC,
DP_FLOW_LB_TYPE_FORWARD,
} __rte_packed;
} __attribute__((__packed__));

enum dp_flow_tcp_state {
DP_FLOW_TCP_STATE_NONE,
Expand All @@ -84,7 +84,7 @@ struct flow_key {
uint16_t type_src; /* ICMP */
} src;
uint32_t vni;
} __rte_packed;
} __attribute__((__packed__));
static_assert(sizeof(((struct flow_key *)0)->vnf_type) == 1,
"enum dp_vnf_type is unnecessarily big");

Expand Down
6 changes: 3 additions & 3 deletions include/dp_ipaddr.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ union dp_ipv6 {
rte_be64_t _suffix;
};
const uint8_t bytes[DP_IPV6_ADDR_SIZE];
struct __rte_packed {
struct __attribute__((__packed__)) {
uint8_t prefix[DP_IPV6_ADDR_SIZE - sizeof(rte_be32_t)];
rte_be32_t ipv4;
} _nat64;
struct __rte_packed {
struct __attribute__((__packed__)) {
rte_be64_t prefix;
uint8_t type;
uint8_t subtype;
Expand Down Expand Up @@ -184,7 +184,7 @@ struct dp_ip_address {
bool _is_v6;
const bool is_v6;
};
} __rte_packed;
} __attribute__((__packed__));

static __rte_always_inline
int dp_ipv6_from_ipaddr(union dp_ipv6 *ipv6, const struct dp_ip_address *addr)
Expand Down
Loading
Loading