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.

Fixes: 17f2e7992fcb ("net/mlx5: rework creation of unicast flow rules")

Signed-off-by: Dariusz Sosnowski <dsosnow...@nvidia.com>
---
 drivers/net/mlx5/meson.build          | 8 +++++++-
 drivers/net/mlx5/mlx5_flow_hw_stubs.c | 6 +++---
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/drivers/net/mlx5/meson.build b/drivers/net/mlx5/meson.build
index 0114673491..e65fac0f6f 100644
--- a/drivers/net/mlx5/meson.build
+++ b/drivers/net/mlx5/meson.build
@@ -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'))
diff --git a/drivers/net/mlx5/mlx5_flow_hw_stubs.c 
b/drivers/net/mlx5/mlx5_flow_hw_stubs.c
index 0e79e6c1f2..1df615d94c 100644
--- a/drivers/net/mlx5/mlx5_flow_hw_stubs.c
+++ b/drivers/net/mlx5/mlx5_flow_hw_stubs.c
@@ -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)
-- 
2.39.5

Reply via email to