Currently the Windows implementation hardcodes match criteria to
MLX5_MATCH_OUTER_HEADERS when creating flow rules, which prevents
matching on inner headers and other criteria types like NVGRE.
The fix uses the matcher's match_criteria_enable attribute instead
of hardcoding OUTER_HEADERS, and moves the assignment outside the
action switch block to apply to all cases.
NVGRE item type is also added to the supported items list.
Fixes: 1d194496b9d1 ("net/mlx5: create flow rule on Windows")
Cc: [email protected]
Signed-off-by: Itai Sharoni <[email protected]>
Acked-by: Bing Zhao <[email protected]>
---
v2:
- Added documentation for NVGRE tunnel support on Windows
- Noted requirement for DevX dynamic insertion mode
.mailmap | 1 +
doc/guides/nics/mlx5.rst | 4 ++++
drivers/net/mlx5/windows/mlx5_flow_os.c | 4 ++--
drivers/net/mlx5/windows/mlx5_flow_os.h | 1 +
4 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/.mailmap b/.mailmap
index 50a59a596a..83c2ea91a4 100644
--- a/.mailmap
+++ b/.mailmap
@@ -639,6 +639,7 @@ Intiyaz Basha <[email protected]>
Ioana Ciornei <[email protected]>
Isaac Boukris <[email protected]>
Itamar Gozlan <[email protected]>
+Itai Sharoni <[email protected]>
Itsuro Oda <[email protected]>
Ivan Boule <[email protected]>
Ivan Dyukov <[email protected]>
diff --git a/doc/guides/nics/mlx5.rst b/doc/guides/nics/mlx5.rst
index e0ec3e4f6f..9efd4726df 100644
--- a/doc/guides/nics/mlx5.rst
+++ b/doc/guides/nics/mlx5.rst
@@ -1233,6 +1233,10 @@ On Windows, the features are limited:
- IPv4/TCP with CVLAN filtering
- L4 steering rules for port RSS of IP, UDP, TCP
+- Tunnel protocol support:
+
+ - NVGRE (requires DevX dynamic insertion mode)
+
.. _mlx5_multiproc:
diff --git a/drivers/net/mlx5/windows/mlx5_flow_os.c
b/drivers/net/mlx5/windows/mlx5_flow_os.c
index 7a625fb880..15c6fc5613 100644
--- a/drivers/net/mlx5/windows/mlx5_flow_os.c
+++ b/drivers/net/mlx5/windows/mlx5_flow_os.c
@@ -219,9 +219,9 @@ mlx5_flow_os_create_flow(void *matcher, void *match_value,
default:
break;
}
- MLX5_SET(devx_fs_rule_add_in, in, match_criteria_enable,
- MLX5_MATCH_OUTER_HEADERS);
}
+ MLX5_SET(devx_fs_rule_add_in, in, match_criteria_enable,
+ mlx5_matcher->attr.match_criteria_enable);
*flow = mlx5_glue->devx_fs_rule_add(mlx5_matcher->ctx, in, sizeof(in));
return (*flow) ? 0 : -1;
}
diff --git a/drivers/net/mlx5/windows/mlx5_flow_os.h
b/drivers/net/mlx5/windows/mlx5_flow_os.h
index 2cd4e95325..c087bca4be 100644
--- a/drivers/net/mlx5/windows/mlx5_flow_os.h
+++ b/drivers/net/mlx5/windows/mlx5_flow_os.h
@@ -47,6 +47,7 @@ mlx5_flow_os_item_supported(int item)
case RTE_FLOW_ITEM_TYPE_IPV6:
case RTE_FLOW_ITEM_TYPE_VLAN:
case RTE_FLOW_ITEM_TYPE_ESP:
+ case RTE_FLOW_ITEM_TYPE_NVGRE:
return true;
default:
return false;
--
2.28.0.windows.1