[PATCH 3/3] net/mlx5: fix stub for HWS context validation
Dariusz Sosnowski
dsosnowski at nvidia.com
Wed Oct 30 11:54:12 CET 2024
Since weak symbols are not supported on MinGW,
move mlx5_hw_ctx_validate() to dedicated stubs file.
Fixes: f3b76d541a25 ("net/mlx5: validate HWS context in meter operations")
Signed-off-by: Dariusz Sosnowski <dsosnowski at nvidia.com>
---
drivers/net/mlx5/mlx5_flow.c | 7 -------
drivers/net/mlx5/mlx5_flow_hw_stubs.c | 12 ++++++++++++
2 files changed, 12 insertions(+), 7 deletions(-)
diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index bfe757ec26..9c43201e05 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -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;
-}
diff --git a/drivers/net/mlx5/mlx5_flow_hw_stubs.c b/drivers/net/mlx5/mlx5_flow_hw_stubs.c
index 06c096e1bc..f17bc27899 100644
--- a/drivers/net/mlx5/mlx5_flow_hw_stubs.c
+++ b/drivers/net/mlx5/mlx5_flow_hw_stubs.c
@@ -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;
+}
--
2.39.5
More information about the dev
mailing list