* [PATCH 0/3] net/mlx5: fix mingw link issues
@ 2024-10-30 10:54 Dariusz Sosnowski
2024-10-30 10:54 ` [PATCH 1/3] net/mlx5: fix mingw stubs link issue in flow creation Dariusz Sosnowski
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Dariusz Sosnowski @ 2024-10-30 10:54 UTC (permalink / raw)
To: Raslan Darawsheh, Viacheslav Ovsiienko, Bing Zhao, Ori Kam,
Suanming Mou, Matan Azrad
Cc: dev
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/3] net/mlx5: fix mingw stubs link issue in flow creation
2024-10-30 10:54 [PATCH 0/3] net/mlx5: fix mingw link issues Dariusz Sosnowski
@ 2024-10-30 10:54 ` Dariusz Sosnowski
2024-10-30 10:54 ` [PATCH 2/3] net/mlx5: fix mingw stubs link issue in flow destroy Dariusz Sosnowski
2024-10-30 10:54 ` [PATCH 3/3] net/mlx5: fix stub for HWS context validation Dariusz Sosnowski
2 siblings, 0 replies; 4+ messages in thread
From: Dariusz Sosnowski @ 2024-10-30 10:54 UTC (permalink / raw)
To: Raslan Darawsheh, Viacheslav Ovsiienko, Bing Zhao, Ori Kam,
Suanming Mou, Matan Azrad
Cc: dev
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 <dsosnowski@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
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 2/3] net/mlx5: fix mingw stubs link issue in flow destroy
2024-10-30 10:54 [PATCH 0/3] net/mlx5: fix mingw link issues Dariusz Sosnowski
2024-10-30 10:54 ` [PATCH 1/3] net/mlx5: fix mingw stubs link issue in flow creation Dariusz Sosnowski
@ 2024-10-30 10:54 ` Dariusz Sosnowski
2024-10-30 10:54 ` [PATCH 3/3] net/mlx5: fix stub for HWS context validation Dariusz Sosnowski
2 siblings, 0 replies; 4+ messages in thread
From: Dariusz Sosnowski @ 2024-10-30 10:54 UTC (permalink / raw)
To: Raslan Darawsheh, Viacheslav Ovsiienko, Bing Zhao, Ori Kam,
Suanming Mou, Matan Azrad
Cc: dev
Offending 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.
Fixes: 8ed3e0001d0d ("net/mlx5: support destroying unicast flow rules")
Signed-off-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
---
drivers/net/mlx5/mlx5_flow_hw_stubs.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/mlx5/mlx5_flow_hw_stubs.c b/drivers/net/mlx5/mlx5_flow_hw_stubs.c
index 1df615d94c..06c096e1bc 100644
--- a/drivers/net/mlx5/mlx5_flow_hw_stubs.c
+++ b/drivers/net/mlx5/mlx5_flow_hw_stubs.c
@@ -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)
--
2.39.5
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 3/3] net/mlx5: fix stub for HWS context validation
2024-10-30 10:54 [PATCH 0/3] net/mlx5: fix mingw link issues Dariusz Sosnowski
2024-10-30 10:54 ` [PATCH 1/3] net/mlx5: fix mingw stubs link issue in flow creation Dariusz Sosnowski
2024-10-30 10:54 ` [PATCH 2/3] net/mlx5: fix mingw stubs link issue in flow destroy Dariusz Sosnowski
@ 2024-10-30 10:54 ` Dariusz Sosnowski
2 siblings, 0 replies; 4+ messages in thread
From: Dariusz Sosnowski @ 2024-10-30 10:54 UTC (permalink / raw)
To: Raslan Darawsheh, Viacheslav Ovsiienko, Bing Zhao, Ori Kam,
Suanming Mou, Matan Azrad, Gregory Etelson
Cc: dev
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@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
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-10-30 10:55 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-10-30 10:54 [PATCH 0/3] net/mlx5: fix mingw link issues Dariusz Sosnowski
2024-10-30 10:54 ` [PATCH 1/3] net/mlx5: fix mingw stubs link issue in flow creation Dariusz Sosnowski
2024-10-30 10:54 ` [PATCH 2/3] net/mlx5: fix mingw stubs link issue in flow destroy Dariusz Sosnowski
2024-10-30 10:54 ` [PATCH 3/3] net/mlx5: fix stub for HWS context validation Dariusz Sosnowski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).