DPDK patches and discussions
 help / color / mirror / Atom feed
From: Maayan Kashani <mkashani@nvidia.com>
To: <dev@dpdk.org>
Cc: <mkashani@nvidia.com>, <matan@nvidia.com>, <rasland@nvidia.com>,
	<stable@dpdk.org>, Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Subject: [PATCH] net/mlx5: fix ESP item validation in Verbs interface
Date: Sun, 5 Feb 2023 17:39:52 +0200	[thread overview]
Message-ID: <20230205153955.1372-1-mkashani@nvidia.com> (raw)

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 <mkashani@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 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


             reply	other threads:[~2023-02-05 15:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-05 15:39 Maayan Kashani [this message]
2023-02-26 11:08 ` Raslan Darawsheh

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=20230205153955.1372-1-mkashani@nvidia.com \
    --to=mkashani@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=matan@nvidia.com \
    --cc=rasland@nvidia.com \
    --cc=stable@dpdk.org \
    --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).