diff --git a/Dockerfile b/Dockerfile index bf3ce72cc..75f9a20bf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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="" @@ -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,\ diff --git a/hack/dpdk_24_11_ethdev_conversion.patch b/hack/dpdk_24_11_ethdev_conversion.patch deleted file mode 100644 index a1ca90d15..000000000 --- a/hack/dpdk_24_11_ethdev_conversion.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff --color -ruN dpdk-23.11/lib/ethdev/rte_ethdev.c dpdk-23.11-patch/lib/ethdev/rte_ethdev.c ---- dpdk-23.11/lib/ethdev/rte_ethdev.c 2023-11-28 14:35:41.000000000 +0000 -+++ dpdk-23.11-patch/lib/ethdev/rte_ethdev.c 2024-03-04 12:28:35.492608466 +0000 -@@ -428,7 +428,7 @@ - return 1; - } - --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 --color -ruN dpdk-23.11/lib/ethdev/rte_ethdev.h dpdk-23.11-patch/lib/ethdev/rte_ethdev.h ---- dpdk-23.11/lib/ethdev/rte_ethdev.h 2023-11-28 14:35:41.000000000 +0000 -+++ dpdk-23.11-patch/lib/ethdev/rte_ethdev.h 2024-03-04 12:28:28.084570580 +0000 -@@ -2126,7 +2126,7 @@ - * @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); - - /** diff --git a/hack/dpdk_24_11_log.patch b/hack/dpdk_24_11_log.patch deleted file mode 100644 index 29a215bd8..000000000 --- a/hack/dpdk_24_11_log.patch +++ /dev/null @@ -1,50 +0,0 @@ -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 -@@ -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.print_func = func; -+} -+ - FILE * - rte_log_get_stream(void) - { -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 -@@ -89,6 +89,18 @@ - 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). - * -diff --color -ruN dpdk-23.11/lib/log/version.map dpdk-23.11-patch/lib/log/version.map ---- dpdk-23.11/lib/log/version.map 2023-11-28 14:35:41.000000000 +0000 -+++ dpdk-23.11-patch/lib/log/version.map 2024-03-04 15:03:23.118516680 +0000 -@@ -17,6 +17,7 @@ - rte_log_set_level_pattern; - rte_log_set_level_regexp; - rte_openlog_stream; -+ rte_log_set_print_func; - rte_vlog; - - local: *; diff --git a/hack/dpdk_24_11_mtu.patch b/hack/dpdk_24_11_mtu.patch deleted file mode 100644 index fdba9a959..000000000 --- a/hack/dpdk_24_11_mtu.patch +++ /dev/null @@ -1,47 +0,0 @@ -This is the original patch from upstream DPDK. -Dpservice needs to revert it for MTU to stay untouched. -Reason being that dpservice actually only handles custom underlay traffic, -that uses MTU 1500+overhead and not the full 9100 MTU setup on a node. -Using this patch forces dpservice to support MTU 9100, -which increases memory footprint significantly. ---- - -From 4032e7572a85005127d65ded4460ddbbfcf780f9 Mon Sep 17 00:00:00 2001 -From: Dariusz Sosnowski -Date: Mon, 8 Jul 2024 12:59:31 +0200 -Subject: [PATCH] net/mlx5: fix MTU configuration - -[ upstream commit 10859ecf09c424c0f6a89379f0326a0c51f9cd2f ] - -Apply provided MTU, derived from rte_eth_conf.rxmode.mtu, -on port configuration. - -Bugzilla ID: 1483 -Fixes: e60fbd5b24fc ("mlx5: add device configure/start/stop") - -Signed-off-by: Dariusz Sosnowski -Acked-by: Viacheslav Ovsiienko ---- - drivers/net/mlx5/mlx5_ethdev.c | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c -index 9c44471c42..c6ec156493 100644 ---- a/drivers/net/mlx5/mlx5_ethdev.c -+++ b/drivers/net/mlx5/mlx5_ethdev.c -@@ -136,6 +136,12 @@ mlx5_dev_configure(struct rte_eth_dev *dev) - ret = mlx5_proc_priv_init(dev); - if (ret) - return ret; -+ ret = mlx5_dev_set_mtu(dev, dev->data->mtu); -+ if (ret) { -+ DRV_LOG(ERR, "port %u failed to set MTU to %u", dev->data->port_id, -+ dev->data->mtu); -+ return ret; -+ } - return 0; - } - --- -2.39.2 - diff --git a/hack/dpdk_24_11_telemetry_key.patch b/hack/dpdk_24_11_telemetry_key.patch deleted file mode 100644 index a42b8419b..000000000 --- a/hack/dpdk_24_11_telemetry_key.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --color -ruN dpdk-23.11/lib/telemetry/telemetry_data.c dpdk-23.11-patch/lib/telemetry/telemetry_data.c ---- dpdk-23.11/lib/telemetry/telemetry_data.c 2023-11-28 14:35:41.000000000 +0000 -+++ dpdk-23.11-patch/lib/telemetry/telemetry_data.c 2024-03-04 13:35:15.585285834 +0000 -@@ -141,7 +141,7 @@ - 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)) diff --git a/hack/dpdk_25_07_allow_outer_inner_ipip.patch b/hack/dpdk_25_07_allow_outer_inner_ipip.patch new file mode 100644 index 000000000..509233247 --- /dev/null +++ b/hack/dpdk_25_07_allow_outer_inner_ipip.patch @@ -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, diff --git a/hack/dpdk_25_07_ethdev_conversion.patch b/hack/dpdk_25_07_ethdev_conversion.patch new file mode 100644 index 000000000..926bbb715 --- /dev/null +++ b/hack/dpdk_25_07_ethdev_conversion.patch @@ -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); + + /** diff --git a/hack/dpdk_24_11_fdb_def_rule.patch b/hack/dpdk_25_07_fdb_def_rule.patch similarity index 62% rename from hack/dpdk_24_11_fdb_def_rule.patch rename to hack/dpdk_25_07_fdb_def_rule.patch index 6552f35c9..204d7af47 100644 --- a/hack/dpdk_24_11_fdb_def_rule.patch +++ b/hack/dpdk_25_07_fdb_def_rule.patch @@ -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) { @@ -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); } diff --git a/hack/dpdk_25_07_log.patch b/hack/dpdk_25_07_log.patch new file mode 100644 index 000000000..5cdd99dd4 --- /dev/null +++ b/hack/dpdk_25_07_log.patch @@ -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). diff --git a/hack/dpdk_24_11_no_pattern_template_validation.patch b/hack/dpdk_25_07_no_pattern_template_validation.patch similarity index 76% rename from hack/dpdk_24_11_no_pattern_template_validation.patch rename to hack/dpdk_25_07_no_pattern_template_validation.patch index 76593b9aa..6356d6a18 100644 --- a/hack/dpdk_24_11_no_pattern_template_validation.patch +++ b/hack/dpdk_25_07_no_pattern_template_validation.patch @@ -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) { diff --git a/hack/dpdk_25_07_telemetry_key.patch b/hack/dpdk_25_07_telemetry_key.patch new file mode 100644 index 000000000..0af39bb09 --- /dev/null +++ b/hack/dpdk_25_07_telemetry_key.patch @@ -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)) diff --git a/include/dp_flow.h b/include/dp_flow.h index 1398a105e..3fa069b61 100644 --- a/include/dp_flow.h +++ b/include/dp_flow.h @@ -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, @@ -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"); diff --git a/include/dp_ipaddr.h b/include/dp_ipaddr.h index 728bf57d7..c20cf7ecd 100644 --- a/include/dp_ipaddr.h +++ b/include/dp_ipaddr.h @@ -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; @@ -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) diff --git a/include/dp_lb.h b/include/dp_lb.h index 1652e6872..e2605f823 100644 --- a/include/dp_lb.h +++ b/include/dp_lb.h @@ -21,7 +21,7 @@ extern "C" { struct lb_key { uint32_t vni; struct dp_ip_address ip; -} __rte_packed; +} __attribute__((__packed__)); struct lb_port { uint8_t protocol; diff --git a/include/dp_mbuf_dyn.h b/include/dp_mbuf_dyn.h index 35c762a72..bb4c69067 100644 --- a/include/dp_mbuf_dyn.h +++ b/include/dp_mbuf_dyn.h @@ -24,18 +24,18 @@ extern "C" { enum dp_flow_type { DP_FLOW_WEST_EAST, DP_FLOW_SOUTH_NORTH, -} __rte_packed; +} __attribute__((__packed__)); enum dp_pkt_offload_state { DP_FLOW_NON_OFFLOAD, DP_FLOW_OFFLOAD_INSTALL, DP_FLOW_OFFLOADED, -} __rte_packed; +} __attribute__((__packed__)); enum dp_flow_dir { DP_FLOW_DIR_ORG, DP_FLOW_DIR_REPLY, -} __rte_packed; +} __attribute__((__packed__)); #define DP_FLOW_DIR_CAPACITY 2 enum dp_nat_type { @@ -46,7 +46,7 @@ enum dp_nat_type { DP_LB_RECIRC, DP_NAT_64_CHG_SRC_IP, DP_NAT_64_CHG_DST_IP, -} __rte_packed; +} __attribute__((__packed__)); struct dp_flow { enum dp_flow_type flow_type : 1; diff --git a/include/dp_nat.h b/include/dp_nat.h index bc67fc48a..cbe9e926e 100644 --- a/include/dp_nat.h +++ b/include/dp_nat.h @@ -26,7 +26,7 @@ extern "C" { struct nat_key { uint32_t ip; uint32_t vni; -} __rte_packed; +} __attribute__((__packed__)); struct nat_entry { uint32_t nat_ip; @@ -54,7 +54,7 @@ struct netnat_portmap_key { uint32_t vni; struct dp_ip_address src_ip; uint16_t iface_src_port; -} __rte_packed; +} __attribute__((__packed__)); struct netnat_portmap_data { uint32_t nat_ip; @@ -68,7 +68,7 @@ struct netnat_portoverload_tbl_key { uint32_t dst_ip; uint16_t dst_port; uint8_t l4_type; -} __rte_packed; +} __attribute__((__packed__)); struct nat_check_result { bool is_vip_natted; diff --git a/include/dp_vnf.h b/include/dp_vnf.h index ada27b5eb..b7d4def0d 100644 --- a/include/dp_vnf.h +++ b/include/dp_vnf.h @@ -29,7 +29,7 @@ enum dp_vnf_type { DP_VNF_TYPE_LB, DP_VNF_TYPE_LB_ALIAS_PFX, DP_VNF_TYPE_ALIAS_PFX, -} __rte_packed; // for 'struct dp_flow' and 'struct flow_key' +} __attribute__((__packed__)); // for 'struct dp_flow' and 'struct flow_key' struct dp_vnf_prefix { struct dp_ip_address ol; diff --git a/include/dp_vni.h b/include/dp_vni.h index 2e17ec3f9..162303856 100644 --- a/include/dp_vni.h +++ b/include/dp_vni.h @@ -30,7 +30,7 @@ extern struct rte_hash *vni_handle_tbl; struct dp_vni_key { uint32_t vni; -} __rte_packed; +} __attribute__((__packed__)); struct dp_vni_data { struct rte_rib *ipv4[DP_NB_SOCKETS]; diff --git a/include/protocols/dp_dhcpv6.h b/include/protocols/dp_dhcpv6.h index a1e26a9b7..5692c1ca3 100644 --- a/include/protocols/dp_dhcpv6.h +++ b/include/protocols/dp_dhcpv6.h @@ -67,39 +67,39 @@ struct dhcpv6_packet { uint8_t msg_type; uint8_t transaction_id[3]; uint8_t options[]; -} __rte_packed; +} __attribute__((__packed__)); struct dhcpv6_option { rte_be16_t op_code; rte_be16_t op_len; uint8_t data[]; -} __rte_packed; +} __attribute__((__packed__)); struct dhcpv6_opt_dns_servers { uint16_t opt_code; uint16_t opt_len; struct in6_addr dns_server_addrs[]; // Array of IPv6 addresses -} __rte_packed; +} __attribute__((__packed__)); // client id can be of any type, this is the maximum size allowed struct dhcpv6_opt_client_id { rte_be16_t op_code; rte_be16_t op_len; uint8_t id[128]; -} __rte_packed; +} __attribute__((__packed__)); struct dhcpv6_ia_na { rte_be32_t iaid; rte_be32_t t1; rte_be32_t t2; struct dhcpv6_option options[]; -} __rte_packed; +} __attribute__((__packed__)); struct dhcpv6_opt_ia_na { rte_be16_t op_code; rte_be16_t op_len; struct dhcpv6_ia_na ia_na; -} __rte_packed; +} __attribute__((__packed__)); struct dhcpv6_opt_vnd_cls { rte_be16_t op_code; @@ -107,33 +107,33 @@ struct dhcpv6_opt_vnd_cls { rte_be32_t entp_id; rte_be16_t opq_data_len; uint8_t opq_data[]; -} __rte_packed; +} __attribute__((__packed__)); struct dhcpv6_opt_usr_cls { rte_be16_t op_code; rte_be16_t op_len; rte_be16_t sub_opt_len; uint8_t sub_opt_data[]; -} __rte_packed; +} __attribute__((__packed__)); struct dhcpv6_ia_addr { uint8_t ipv6[16]; rte_be32_t preferred_lifetime; rte_be32_t valid_lifetime; struct dhcpv6_option options[]; -} __rte_packed; +} __attribute__((__packed__)); struct dhcpv6_opt_ia_addr { rte_be16_t op_code; rte_be16_t op_len; struct dhcpv6_ia_addr addr; -} __rte_packed; +} __attribute__((__packed__)); struct dhcpv6_opt_status_code { rte_be16_t op_code; rte_be16_t op_len; rte_be16_t status; -} __rte_packed; +} __attribute__((__packed__)); struct dhcpv6_duid_ll { rte_be16_t type; @@ -154,31 +154,31 @@ struct dhcpv6_ia_addr_status { rte_be32_t preferred_lifetime; rte_be32_t valid_lifetime; struct dhcpv6_opt_status_code options[1]; -} __rte_packed; +} __attribute__((__packed__)); struct dhcpv6_opt_ia_addr_status { rte_be16_t op_code; rte_be16_t op_len; struct dhcpv6_ia_addr_status addr; -} __rte_packed; +} __attribute__((__packed__)); struct dhcpv6_ia_na_single_addr_status { rte_be32_t iaid; rte_be32_t t1; rte_be32_t t2; struct dhcpv6_opt_ia_addr_status options[1]; -} __rte_packed; +} __attribute__((__packed__)); struct dhcpv6_opt_ia_na_single_addr_status { rte_be16_t op_code; rte_be16_t op_len; struct dhcpv6_ia_na_single_addr_status ia_na; -} __rte_packed; +} __attribute__((__packed__)); struct dhcpv6_opt_boot_file_url { rte_be16_t op_code; rte_be16_t op_len; char boot_file_url[DHCPV6_BOOT_FILE_BUF_LEN]; -} __rte_packed; +} __attribute__((__packed__)); #endif diff --git a/src/dp_virtsvc.c b/src/dp_virtsvc.c index e912c0b0d..a27e7b695 100644 --- a/src/dp_virtsvc.c +++ b/src/dp_virtsvc.c @@ -34,7 +34,7 @@ struct dp_virtsvc_conn_key { uint16_t vf_port_id; rte_be16_t vf_l4_port; rte_be32_t vf_ip; -} __rte_packed; +} __attribute__((__packed__)); static struct dp_virtsvc *dp_virtservices; static struct dp_virtsvc *dp_virtservices_end;