patch 'net/mlx5: fix default flow engine on Windows' has been queued to stable release 25.11.1

Kevin Traynor ktraynor at redhat.com
Thu Mar 19 11:02:33 CET 2026


Hi,

FYI, your patch has been queued to stable release 25.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/23/26. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/kevintraynor/dpdk-stable

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable/commit/04be793d954f41171a4720951524c2850f60ddce

Thanks.

Kevin

---
>From 04be793d954f41171a4720951524c2850f60ddce Mon Sep 17 00:00:00 2001
From: Dariusz Sosnowski <dsosnowski at nvidia.com>
Date: Mon, 9 Mar 2026 13:47:53 +0100
Subject: [PATCH] net/mlx5: fix default flow engine on Windows

[ upstream commit b8744d9e39444fcf04e3864cb4b4f93e584f9742 ]

Offending patch has changed the logic for handling default
configuration for dv_flow_en device argument.
This change has introduced a regression to Windows support.
On Windows, mlx5 PMD only supports flow API implementation
with dv_flow_en set to 1. With the change, this argument value was
changed based on device capabilities.
On newer NICs, dv_flow_en would be set to HW Steering flow engine
which is not supported on Windows.
On older NICs, it would be set to Verbs engine, which is also not
supported.

This patch fixes that by introducing platform-specific initialization
and fixup of relevant device arguments i.e., dv_flow_en and
allow_duplicate_pattern.
On Linux the existing logic is kept. On Windows dv_flow_en and
allow_duplicate_pattern are set by default to 1 (same as before
the offending patch).

Fixes: 170ebe941be3 ("net/mlx5: fix flow devargs handling for future HW")

Signed-off-by: Maayan Kashani <mkashani at nvidia.com>
Signed-off-by: Dariusz Sosnowski <dsosnowski at nvidia.com>
Acked-by: Bing Zhao <bingz at nvidia.com>
---
 drivers/net/mlx5/linux/mlx5_os.c   |  98 ++++++++++++++++++++++++++++
 drivers/net/mlx5/linux/mlx5_os.h   |   1 +
 drivers/net/mlx5/mlx5.c            | 100 ++++++++---------------------
 drivers/net/mlx5/mlx5.h            |   9 +++
 drivers/net/mlx5/windows/mlx5_os.c |  23 +++++++
 5 files changed, 158 insertions(+), 73 deletions(-)

diff --git a/drivers/net/mlx5/linux/mlx5_os.c b/drivers/net/mlx5/linux/mlx5_os.c
index a1285a2345..2f1e7b10b9 100644
--- a/drivers/net/mlx5/linux/mlx5_os.c
+++ b/drivers/net/mlx5/linux/mlx5_os.c
@@ -3497,2 +3497,100 @@ mlx5_os_mac_addr_flush(struct rte_eth_dev *dev)
 			       MLX5_MAX_MAC_ADDRESSES, priv->mac_own, vf);
 }
+
+static bool
+mlx5_hws_is_supported(struct mlx5_dev_ctx_shared *sh)
+{
+	return (sh->cdev->config.devx &&
+	       sh->cdev->config.hca_attr.wqe_based_flow_table_sup);
+}
+
+static bool
+mlx5_sws_is_any_supported(struct mlx5_dev_ctx_shared *sh)
+{
+	struct mlx5_common_device *cdev = sh->cdev;
+	struct mlx5_hca_attr *hca_attr = &cdev->config.hca_attr;
+
+	if (hca_attr->rx_sw_owner_v2 || hca_attr->rx_sw_owner)
+		return true;
+
+	if (hca_attr->tx_sw_owner_v2 || hca_attr->tx_sw_owner)
+		return true;
+
+	if (hca_attr->eswitch_manager && (hca_attr->esw_sw_owner_v2 || hca_attr->esw_sw_owner))
+		return true;
+
+	return false;
+}
+
+/**
+ * Initialize default shared configuration for arguments related to flow engine.
+ *
+ * @param[in] sh
+ *   Pointer to shared configuration.
+ * @param[in] sh
+ *   Pointer to shared device context.
+ */
+void
+mlx5_os_default_flow_config(struct mlx5_sh_config *config, struct mlx5_dev_ctx_shared *sh)
+{
+	bool hws_is_supported = mlx5_hws_is_supported(sh);
+	bool sws_is_supported = mlx5_sws_is_any_supported(sh);
+
+	if (!sws_is_supported && hws_is_supported)
+		config->dv_flow_en = 2;
+	else
+		config->dv_flow_en = 1;
+
+	if (config->dv_flow_en == 2)
+		config->allow_duplicate_pattern = 0;
+	else
+		config->allow_duplicate_pattern = 1;
+}
+
+static bool
+mlx5_kvargs_is_used(struct mlx5_kvargs_ctrl *mkvlist, const char *key)
+{
+	const struct rte_kvargs_pair *pair;
+	uint32_t i;
+
+	for (i = 0; i < mkvlist->kvlist->count; ++i) {
+		pair = &mkvlist->kvlist->pairs[i];
+		if (strcmp(pair->key, key) == 0 && mkvlist->is_used[i])
+			return true;
+	}
+	return false;
+}
+
+void mlx5_os_fixup_flow_en(struct mlx5_sh_config *config,
+			   struct mlx5_dev_ctx_shared *sh)
+{
+	bool hws_is_supported = mlx5_hws_is_supported(sh);
+	bool sws_is_supported = mlx5_sws_is_any_supported(sh);
+
+	/* Inform user if DV flow is not supported. */
+	if (config->dv_flow_en == 1 && !sws_is_supported && hws_is_supported) {
+		DRV_LOG(WARNING, "DV flow is not supported. Changing to HWS mode.");
+		config->dv_flow_en = 2;
+	}
+}
+
+void
+mlx5_os_fixup_duplicate_pattern(struct mlx5_sh_config *config,
+				struct mlx5_kvargs_ctrl *mkvlist,
+				const char *key)
+{
+	/* Handle allow_duplicate_pattern based on final dv_flow_en mode.
+	 * HWS mode (dv_flow_en=2) doesn't support duplicate patterns.
+	 * Warn only if user explicitly requested an incompatible setting.
+	 */
+	bool allow_dup_pattern_set = mkvlist != NULL &&
+		mlx5_kvargs_is_used(mkvlist, key);
+	if (config->dv_flow_en == 2) {
+		if (config->allow_duplicate_pattern == 1 && allow_dup_pattern_set)
+			DRV_LOG(WARNING, "Duplicate pattern is not supported with HWS. Disabling it.");
+		config->allow_duplicate_pattern = 0;
+	} else if (!allow_dup_pattern_set) {
+		/* Non-HWS mode: set default to 1 only if not explicitly set by user */
+		config->allow_duplicate_pattern = 1;
+	}
+}
diff --git a/drivers/net/mlx5/linux/mlx5_os.h b/drivers/net/mlx5/linux/mlx5_os.h
index 4ef0916173..4d073048fb 100644
--- a/drivers/net/mlx5/linux/mlx5_os.h
+++ b/drivers/net/mlx5/linux/mlx5_os.h
@@ -43,3 +43,4 @@ enum mlx5_tunnel_offloads {
 #endif
 };
+
 #endif /* RTE_PMD_MLX5_OS_H_ */
diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index c6c639a800..66d74739e1 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -1462,43 +1462,4 @@ mlx5_dev_args_check_handler(const char *key, const char *val, void *opaque)
 }
 
-static bool
-mlx5_hws_is_supported(struct mlx5_dev_ctx_shared *sh)
-{
-	return (sh->cdev->config.devx &&
-	       sh->cdev->config.hca_attr.wqe_based_flow_table_sup);
-}
-
-static bool
-mlx5_sws_is_any_supported(struct mlx5_dev_ctx_shared *sh)
-{
-	struct mlx5_common_device *cdev = sh->cdev;
-	struct mlx5_hca_attr *hca_attr = &cdev->config.hca_attr;
-
-	if (hca_attr->rx_sw_owner_v2 || hca_attr->rx_sw_owner)
-		return true;
-
-	if (hca_attr->tx_sw_owner_v2 || hca_attr->tx_sw_owner)
-		return true;
-
-	if (hca_attr->eswitch_manager && (hca_attr->esw_sw_owner_v2 || hca_attr->esw_sw_owner))
-		return true;
-
-	return false;
-}
-
-static bool
-mlx5_kvargs_is_used(struct mlx5_kvargs_ctrl *mkvlist, const char *key)
-{
-	const struct rte_kvargs_pair *pair;
-	uint32_t i;
-
-	for (i = 0; i < mkvlist->kvlist->count; ++i) {
-		pair = &mkvlist->kvlist->pairs[i];
-		if (strcmp(pair->key, key) == 0 && mkvlist->is_used[i])
-			return true;
-	}
-	return false;
-}
-
 /**
  * Parse user device parameters and adjust them according to device
@@ -1541,6 +1502,4 @@ mlx5_shared_dev_ctx_args_config(struct mlx5_dev_ctx_shared *sh,
 	size_t alignment = rte_mem_page_size();
 	uint32_t max_queue_umem_size = MLX5_WQE_SIZE * mlx5_dev_get_max_wq_size(sh);
-	bool hws_is_supported = mlx5_hws_is_supported(sh);
-	bool sws_is_supported = mlx5_sws_is_any_supported(sh);
 
 	if (alignment == (size_t)-1) {
@@ -1551,15 +1510,8 @@ mlx5_shared_dev_ctx_args_config(struct mlx5_dev_ctx_shared *sh,
 	/* Default configuration. */
 	memset(config, 0, sizeof(*config));
+	mlx5_os_default_flow_config(config, sh);
 	config->vf_nl_en = 1;
 	config->dv_esw_en = 1;
-	if (!sws_is_supported && hws_is_supported)
-		config->dv_flow_en = 2;
-	else
-		config->dv_flow_en = 1;
 	config->decap_en = 1;
-	if (config->dv_flow_en == 2)
-		config->allow_duplicate_pattern = 0;
-	else
-		config->allow_duplicate_pattern = 1;
 	config->fdb_def_rule = 1;
 	config->cnt_svc.cycle_time = MLX5_CNT_SVC_CYCLE_TIME_DEFAULT;
@@ -1577,28 +1529,5 @@ mlx5_shared_dev_ctx_args_config(struct mlx5_dev_ctx_shared *sh,
 	}
 	/* Adjust parameters according to device capabilities. */
-	if (config->dv_flow_en && !sh->dev_cap.dv_flow_en) {
-		DRV_LOG(WARNING, "DV flow is not supported.");
-		config->dv_flow_en = 0;
-	}
-	/* Inform user if DV flow is not supported. */
-	if (config->dv_flow_en == 1 && !sws_is_supported && hws_is_supported) {
-		DRV_LOG(WARNING, "DV flow is not supported. Changing to HWS mode.");
-		config->dv_flow_en = 2;
-	}
-	/* Handle allow_duplicate_pattern based on final dv_flow_en mode.
-	 * HWS mode (dv_flow_en=2) doesn't support duplicate patterns.
-	 * Warn only if user explicitly requested an incompatible setting.
-	 */
-	bool allow_dup_pattern_set = mkvlist != NULL &&
-		mlx5_kvargs_is_used(mkvlist, MLX5_ALLOW_DUPLICATE_PATTERN);
-	if (config->dv_flow_en == 2) {
-		if (config->allow_duplicate_pattern == 1 && allow_dup_pattern_set)
-			DRV_LOG(WARNING, "Duplicate pattern is not supported with HWS. Disabling it.");
-		config->allow_duplicate_pattern = 0;
-	} else if (!allow_dup_pattern_set) {
-		/* Non-HWS mode: set default to 1 only if not explicitly set by user */
-		config->allow_duplicate_pattern = 1;
-	}
-
+	mlx5_fixup_flow_config(config, sh, mkvlist);
 	if (config->dv_esw_en && !sh->dev_cap.dv_esw_en) {
 		DRV_LOG(DEBUG, "E-Switch DV flow is not supported.");
@@ -3803,4 +3732,29 @@ mlx5_read_queue_counter(struct mlx5_devx_obj *q_counter, const char *ctr_name,
 }
 
+/**
+ * Fix up shared configuration passed by user based on device capabilities.
+ *
+ * @param[in] config
+ *   Pointer to shared configuration.
+ * @param[in] sh
+ *   Pointer to shared device context.
+ * @param[in] mkvlist
+ *   Key/value list of passed options
+ */
+void
+mlx5_fixup_flow_config(struct mlx5_sh_config *config,
+		       struct mlx5_dev_ctx_shared *sh,
+		       struct mlx5_kvargs_ctrl *mkvlist)
+{
+	if (config->dv_flow_en && !sh->dev_cap.dv_flow_en) {
+		DRV_LOG(WARNING, "DV flow is not supported.");
+		config->dv_flow_en = 0;
+	}
+
+	/* Apply platform-dependent logic. */
+	mlx5_os_fixup_flow_en(config, sh);
+	mlx5_os_fixup_duplicate_pattern(config, mkvlist, MLX5_ALLOW_DUPLICATE_PATTERN);
+}
+
 /**
  * Callback to remove a device.
diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h
index 752a856b65..ba10ac5bc0 100644
--- a/drivers/net/mlx5/mlx5.h
+++ b/drivers/net/mlx5/mlx5.h
@@ -2314,4 +2314,7 @@ mlx5_get_locked_physical_device(struct mlx5_priv *priv);
 void mlx5_unlock_physical_device(void);
 int mlx5_read_queue_counter(struct mlx5_devx_obj *q_counter, const char *ctr_name, uint64_t *stat);
+void mlx5_fixup_flow_config(struct mlx5_sh_config *config,
+			    struct mlx5_dev_ctx_shared *sh,
+			    struct mlx5_kvargs_ctrl *mkvlist);
 
 /* mlx5_ethdev.c */
@@ -2621,4 +2624,10 @@ int mlx5_os_set_nonblock_channel_fd(int fd);
 void mlx5_os_mac_addr_flush(struct rte_eth_dev *dev);
 void mlx5_os_net_cleanup(void);
+void mlx5_os_default_flow_config(struct mlx5_sh_config *config, struct mlx5_dev_ctx_shared *sh);
+void mlx5_os_fixup_flow_en(struct mlx5_sh_config *config,
+			   struct mlx5_dev_ctx_shared *sh);
+void mlx5_os_fixup_duplicate_pattern(struct mlx5_sh_config *config,
+				     struct mlx5_kvargs_ctrl *mkvlist,
+				     const char *key);
 
 /* mlx5_txpp.c */
diff --git a/drivers/net/mlx5/windows/mlx5_os.c b/drivers/net/mlx5/windows/mlx5_os.c
index 37a6bdfe9a..55a3bf599f 100644
--- a/drivers/net/mlx5/windows/mlx5_os.c
+++ b/drivers/net/mlx5/windows/mlx5_os.c
@@ -893,2 +893,25 @@ mlx5_os_net_cleanup(void)
 
 const struct mlx5_flow_driver_ops mlx5_flow_verbs_drv_ops = {0};
+
+void
+mlx5_os_default_flow_config(struct mlx5_sh_config *config __rte_unused,
+			    struct mlx5_dev_ctx_shared *sh __rte_unused)
+{
+	config->dv_flow_en = 1;
+	config->allow_duplicate_pattern = 1;
+}
+
+void
+mlx5_os_fixup_flow_en(struct mlx5_sh_config *config __rte_unused,
+		      struct mlx5_dev_ctx_shared *sh __rte_unused)
+{
+	/* Nothing to fix up */
+}
+
+void
+mlx5_os_fixup_duplicate_pattern(struct mlx5_sh_config *config __rte_unused,
+				struct mlx5_kvargs_ctrl *mkvlist __rte_unused,
+				const char *key __rte_unused)
+{
+	/* Nothing to fix up */
+}
-- 
2.53.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2026-03-19 10:01:08.159086661 +0000
+++ 0035-net-mlx5-fix-default-flow-engine-on-Windows.patch	2026-03-19 10:01:07.103331261 +0000
@@ -1 +1 @@
-From b8744d9e39444fcf04e3864cb4b4f93e584f9742 Mon Sep 17 00:00:00 2001
+From 04be793d954f41171a4720951524c2850f60ddce Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit b8744d9e39444fcf04e3864cb4b4f93e584f9742 ]
+
@@ -25 +26,0 @@
-Cc: stable at dpdk.org
@@ -39 +40 @@
-index 63325ae845..a717191002 100644
+index a1285a2345..2f1e7b10b9 100644
@@ -42 +43 @@
-@@ -3512,2 +3512,100 @@ mlx5_os_mac_addr_flush(struct rte_eth_dev *dev)
+@@ -3497,2 +3497,100 @@ mlx5_os_mac_addr_flush(struct rte_eth_dev *dev)
@@ -153 +154 @@
-index 4e0bc26754..e795948187 100644
+index c6c639a800..66d74739e1 100644
@@ -285 +286 @@
-index f69db11735..4da184eb47 100644
+index 752a856b65..ba10ac5bc0 100644
@@ -288 +289 @@
-@@ -2299,4 +2299,7 @@ mlx5_get_locked_physical_device(struct mlx5_priv *priv);
+@@ -2314,4 +2314,7 @@ mlx5_get_locked_physical_device(struct mlx5_priv *priv);
@@ -296 +297 @@
-@@ -2606,4 +2609,10 @@ int mlx5_os_set_nonblock_channel_fd(int fd);
+@@ -2621,4 +2624,10 @@ int mlx5_os_set_nonblock_channel_fd(int fd);
@@ -308 +309 @@
-index 55b647eddc..4952b674c0 100644
+index 37a6bdfe9a..55a3bf599f 100644



More information about the stable mailing list