[PATCH] net/mlx5: fix ESP item validation in Verbs interface
From: Maayan Kashani <hidden>
Date: 2023-02-05 15:40:21
Subsystem:
networking drivers, the rest · Maintainers:
Andrew Lunn, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds
while added ESP item support in Verbs interface,
mlx5_flow_os_validate_item_esp routine in windows/mlx5_flow_os.c was
changed. all changes should be in mlx5_flow_verbs.c only.
If ESP is not supported in verbs, return default "Item not supported
error" during item validation stage.
Also, updated mlx5.rst file regarding ESP SPI match support following
further debug.
Fixes: c1d039e ("net/mlx5: support ESP item in Verbs interface")
Cc: stable@dpdk.org
Signed-off-by: Maayan Kashani <redacted>
Acked-by: Matan Azrad <redacted>
---
doc/guides/nics/mlx5.rst | 4 ++--
drivers/net/mlx5/mlx5_flow_verbs.c | 2 ++
drivers/net/mlx5/windows/mlx5_flow_os.c | 9 ++-------
3 files changed, 6 insertions(+), 9 deletions(-)
diff --git a/doc/guides/nics/mlx5.rst b/doc/guides/nics/mlx5.rst
index f137f156f9..772dfa58ef 100644
--- a/doc/guides/nics/mlx5.rst
+++ b/doc/guides/nics/mlx5.rst@@ -599,8 +599,8 @@ Limitations - The NIC egress flow rules on representor port are not supported. -- When using DV/verbs flow engine (``dv_flow_en`` = 1/0 respectively), Match on SPI field - in ESP header for group 0 needs MLNX_OFED 5.6+. +- When using DV/verbs flow engine (``dv_flow_en`` = 1/0 respectively), + Match on SPI field in ESP header for group 0 is supported from connectX-7. Statistics
diff --git a/drivers/net/mlx5/mlx5_flow_verbs.c b/drivers/net/mlx5/mlx5_flow_verbs.c
index 46a6c8e16f..99c60c2096 100644
--- a/drivers/net/mlx5/mlx5_flow_verbs.c
+++ b/drivers/net/mlx5/mlx5_flow_verbs.c@@ -1330,6 +1330,7 @@ flow_verbs_validate(struct rte_eth_dev *dev, int ret = 0; switch (items->type) { +#ifdef HAVE_IBV_FLOW_SPEC_ESP case RTE_FLOW_ITEM_TYPE_ESP: ret = mlx5_flow_os_validate_item_esp(items, item_flags, next_protocol,
@@ -1338,6 +1339,7 @@ flow_verbs_validate(struct rte_eth_dev *dev, return ret; last_item = MLX5_FLOW_ITEM_ESP; break; +#endif case RTE_FLOW_ITEM_TYPE_VOID: break; case RTE_FLOW_ITEM_TYPE_ETH:
diff --git a/drivers/net/mlx5/windows/mlx5_flow_os.c b/drivers/net/mlx5/windows/mlx5_flow_os.c
index b9c767ee14..5013e9f012 100644
--- a/drivers/net/mlx5/windows/mlx5_flow_os.c
+++ b/drivers/net/mlx5/windows/mlx5_flow_os.c@@ -419,8 +419,8 @@ mlx5_flow_os_set_specific_workspace(struct mlx5_flow_workspace *data) int mlx5_flow_os_validate_item_esp(const struct rte_flow_item *item, - uint64_t item_flags __rte_unused, - uint8_t target_protocol __rte_unused, + uint64_t item_flags, + uint8_t target_protocol, struct rte_flow_error *error) { const struct rte_flow_item_esp *mask = item->mask;
@@ -432,11 +432,6 @@ mlx5_flow_os_validate_item_esp(const struct rte_flow_item *item, MLX5_FLOW_LAYER_OUTER_L4; int ret; -#ifndef HAVE_IBV_FLOW_SPEC_ESP - return rte_flow_error_set(error, ENOTSUP, - RTE_FLOW_ERROR_TYPE_ITEM, item, - "ESP item not supported"); -#endif if (!(item_flags & l3m)) return rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ITEM, item,
--
2.21.0