DPDK patches and discussions
 help / color / mirror / Atom feed
From: Dariusz Sosnowski <dsosnowski@nvidia.com>
To: Raslan Darawsheh <rasland@nvidia.com>,
	Viacheslav Ovsiienko <viacheslavo@nvidia.com>,
	Bing Zhao <bingz@nvidia.com>, Ori Kam <orika@nvidia.com>,
	Suanming Mou <suanmingm@nvidia.com>,
	Matan Azrad <matan@nvidia.com>,
	Gregory Etelson <getelson@nvidia.com>
Cc: <dev@dpdk.org>
Subject: [PATCH 3/3] net/mlx5: fix stub for HWS context validation
Date: Wed, 30 Oct 2024 11:54:12 +0100	[thread overview]
Message-ID: <20241030105412.482107-4-dsosnowski@nvidia.com> (raw)
In-Reply-To: <20241030105412.482107-1-dsosnowski@nvidia.com>

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


      parent reply	other threads:[~2024-10-30 10:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241030105412.482107-4-dsosnowski@nvidia.com \
    --to=dsosnowski@nvidia.com \
    --cc=bingz@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=getelson@nvidia.com \
    --cc=matan@nvidia.com \
    --cc=orika@nvidia.com \
    --cc=rasland@nvidia.com \
    --cc=suanmingm@nvidia.com \
    --cc=viacheslavo@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).