net/mlx5: fix mingw link issues
Subsystems (2)
cover net/mlx5: fix mingw link issues
This patchset fixes link issues with MinGW which appear in next-net-mlx-main tree. It is based on commit 69461d18dfd5 ("net/mlx5/hws: fix TC to TOS fields mapping in NAT64").
Dariusz Sosnowski (3):
net/mlx5: fix mingw stubs link issue in flow creation net/mlx5: fix mingw stubs link issue in flow destroy net/mlx5: fix stub for HWS context validation
drivers/net/mlx5/meson.build | 8 +++++++- drivers/net/mlx5/mlx5_flow.c | 7 ------- drivers/net/mlx5/mlx5_flow_hw_stubs.c | 22 +++++++++++++++++----- 3 files changed, 24 insertions(+), 13 deletions(-)
--
2.39.5
PATCH 1/3 net/mlx5: fix mingw stubs link issue in flow creation
Offending commit used weak symbols to implement stubs for functions for creating control flow rules for MAC address and VLAN matching.
Since weak symbols are not supported with MinGW and concrete implementations of these functions are required if and only if PMD is compiled on Linux and DV API is available in rdma-core, this patch removes the __rte_weak and adds mlx5_flow_hw_stubs.c to compilation only if aforementioned conditions are specified.
--- drivers/net/mlx5/meson.build | 8 +++++++- drivers/net/mlx5/mlx5_flow_hw_stubs.c | 6 +++--- 2 files changed, 10 insertions(+), 4 deletions(-)
drivers/net/mlx5/meson.build +7 -1
@@ -23,7 +23,6 @@ sources = files( 'mlx5_flow_dv.c', 'mlx5_flow_aso.c', 'mlx5_flow_flex.c', - 'mlx5_flow_hw_stubs.c', 'mlx5_mac.c', 'mlx5_rss.c', 'mlx5_rx.c',
@@ -57,6 +56,13 @@ if is_linux ) endif +if is_windows or (mlx5_config.get('HAVE_INFINIBAND_VERBS_H', false) and + not mlx5_config.get('HAVE_IBV_FLOW_DV_SUPPORT', false)) + sources += files( + 'mlx5_flow_hw_stubs.c', + ) +endif + if is_linux and (dpdk_conf.has('RTE_ARCH_X86_64') or dpdk_conf.has('RTE_ARCH_ARM64') or dpdk_conf.has('RTE_ARCH_PPC_64'))
drivers/net/mlx5/mlx5_flow_hw_stubs.c +3 -3
@@ -8,7 +8,7 @@* mlx5_flow_hw.c source file is included in the build only on Linux. * Functions defined there are compiled if and only if available rdma-core supports DV. * -* This file contains stubs (through weak linking) for any functions exported from that file. +* This file contains stubs for any functions exported from that file. */ #include "mlx5_flow.h"
@@ -18,7 +18,7 @@* - PMD is compiled on Windows or * - available rdma-core does not support HWS. */ -__rte_weak int +int mlx5_flow_hw_ctrl_flow_dmac(struct rte_eth_dev *dev __rte_unused, const struct rte_ether_addr *addr __rte_unused) {
@@ -44,7 +44,7 @@ mlx5_flow_hw_ctrl_flow_dmac_destroy(struct rte_eth_dev *dev __rte_unused,* - PMD is compiled on Windows or * - available rdma-core does not support HWS. */ -__rte_weak int +int mlx5_flow_hw_ctrl_flow_dmac_vlan(struct rte_eth_dev *dev __rte_unused, const struct rte_ether_addr *addr __rte_unused, const uint16_t vlan __rte_unused)
Signature · 1 line
2.39.5
PATCH 2/3 net/mlx5: fix mingw stubs link issue in flow destroy
In reply to Dariusz SosnowskiOffending commit used weak symbols to implement stubs for functions for destroying control flow rules for MAC address and VLAN matching.
Since weak symbols are not supported with MinGW and concrete implementations of these functions are required if and only if PMD is compiled on Linux and DV API is available in rdma-core, this patch removes the __rte_weak. mlx5_flow_hw_stubs.c was already included on required platforms by preceding commit.
--- drivers/net/mlx5/mlx5_flow_hw_stubs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/mlx5/mlx5_flow_hw_stubs.c +2 -2
@@ -31,7 +31,7 @@ mlx5_flow_hw_ctrl_flow_dmac(struct rte_eth_dev *dev __rte_unused,* - PMD is compiled on Windows or * - available rdma-core does not support HWS. */ -__rte_weak int +int mlx5_flow_hw_ctrl_flow_dmac_destroy(struct rte_eth_dev *dev __rte_unused, const struct rte_ether_addr *addr __rte_unused) {
@@ -58,7 +58,7 @@ mlx5_flow_hw_ctrl_flow_dmac_vlan(struct rte_eth_dev *dev __rte_unused,* - PMD is compiled on Windows or * - available rdma-core does not support HWS. */ -__rte_weak int +int mlx5_flow_hw_ctrl_flow_dmac_vlan_destroy(struct rte_eth_dev *dev __rte_unused, const struct rte_ether_addr *addr __rte_unused, const uint16_t vlan __rte_unused)
Signature · 1 line
2.39.5
PATCH 3/3 net/mlx5: fix stub for HWS context validation
In reply to Dariusz SosnowskiSince weak symbols are not supported on MinGW, move mlx5_hw_ctx_validate() to dedicated stubs file.
--- drivers/net/mlx5/mlx5_flow.c | 7 ------- drivers/net/mlx5/mlx5_flow_hw_stubs.c | 12 ++++++++++++ 2 files changed, 12 insertions(+), 7 deletions(-)
drivers/net/mlx5/mlx5_flow.c +0 -7
@@ -12321,10 +12321,3 @@ mlx5_ctrl_flow_uc_dmac_vlan_exists(struct rte_eth_dev *dev, }return exists; } - -__rte_weak bool -mlx5_hw_ctx_validate(__rte_unused const struct rte_eth_dev *dev, - __rte_unused struct rte_flow_error *error) -{ -return false; -}
drivers/net/mlx5/mlx5_flow_hw_stubs.c +12 -0
@@ -66,3 +66,15 @@ mlx5_flow_hw_ctrl_flow_dmac_vlan_destroy(struct rte_eth_dev *dev __rte_unused, rte_errno =ENOTSUP ;return -rte_errno; } + +/* +* This is a stub for the real implementation of this function in mlx5_flow_hw.c in case: +* - PMD is compiled on Windows or +* - available rdma-core does not support HWS. +*/ +bool +mlx5_hw_ctx_validate(__rte_unused const struct rte_eth_dev *dev, + __rte_unused struct rte_flow_error *error) +{ +return false; +}
Signature · 1 line
2.39.5
Hi,
From: Dariusz Sosnowski <[email protected]>
Sent: Wednesday, October 30, 2024 12:54 PM
To: Raslan Darawsheh; Slava Ovsiienko; Bing Zhao; Ori Kam; Suanming Mou; Matan Azrad
Cc: [email protected]
Subject: [PATCH 0/3] net/mlx5: fix mingw link issues
This patchset fixes link issues with MinGW which appear in next-net-mlx-main tree. It is based on commit 69461d18dfd5 ("net/mlx5/hws: fix TC to TOS fields mapping in NAT64").
Dariusz Sosnowski (3):
net/mlx5: fix mingw stubs link issue in flow creation net/mlx5: fix mingw stubs link issue in flow destroy net/mlx5: fix stub for HWS context validation
drivers/net/mlx5/meson.build | 8 +++++++- drivers/net/mlx5/mlx5_flow.c | 7 ------- drivers/net/mlx5/mlx5_flow_hw_stubs.c | 22 +++++++++++++++++----- 3 files changed, 24 insertions(+), 13 deletions(-)
--
2.39.5
series squashed into relevant commits in next-net-mlx,
Kindest regards,
Raslan Darawsheh