DPDK-dev Archive mirror
 help / color / mirror / Atom feed
From: Gavin Li <gavinl@nvidia.com>
To: <matan@nvidia.com>, <viacheslavo@nvidia.com>, <orika@nvidia.com>,
	<thomas@monjalon.net>, Dariusz Sosnowski <dsosnowski@nvidia.com>,
	"Suanming Mou" <suanmingm@nvidia.com>,
	Itamar Gozlan <igozlan@nvidia.com>
Cc: <dev@dpdk.org>, <rasland@nvidia.com>, Bing Zhao <bingz@nvidia.com>
Subject: [PATCH] net/mlx5: fix HWS support for item NSH
Date: Thu, 9 May 2024 15:44:47 +0300	[thread overview]
Message-ID: <20240509124448.1524385-1-gavinl@nvidia.com> (raw)

Allow item NSH in HWS and set item_flags.

Fixes: f6164649a8 ("net/mlx5/hws: support VXLAN-GPE matching")
Signed-off-by: Gavin Li <gavinl@nvidia.com>
Reviewed-by: Bing Zhao <bingz@nvidia.com>
---
 drivers/net/mlx5/hws/mlx5dr_definer.c |  3 +++
 drivers/net/mlx5/mlx5_flow_hw.c       | 13 +++++++++++++
 2 files changed, 16 insertions(+)

diff --git a/drivers/net/mlx5/hws/mlx5dr_definer.c b/drivers/net/mlx5/hws/mlx5dr_definer.c
index a0f95c6923..867393e282 100644
--- a/drivers/net/mlx5/hws/mlx5dr_definer.c
+++ b/drivers/net/mlx5/hws/mlx5dr_definer.c
@@ -3198,6 +3198,9 @@ mlx5dr_definer_conv_items_to_hl(struct mlx5dr_context *ctx,
 			item_flags |= MLX5_FLOW_ITEM_COMPARE;
 			matcher->flags |= MLX5DR_MATCHER_FLAGS_COMPARE;
 			break;
+		case RTE_FLOW_ITEM_TYPE_NSH:
+			item_flags |= MLX5_FLOW_ITEM_NSH;
+			break;
 		case RTE_FLOW_ITEM_TYPE_VOID:
 			break;
 		default:
diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c
index 9ebbe664d1..4587d04cb6 100644
--- a/drivers/net/mlx5/mlx5_flow_hw.c
+++ b/drivers/net/mlx5/mlx5_flow_hw.c
@@ -7475,6 +7475,14 @@ flow_hw_validate_item_compare(const struct rte_flow_item *item,
 	return 0;
 }
 
+static inline int
+mlx5_hw_validate_item_nsh(struct rte_eth_dev *dev,
+			  const struct rte_flow_item *item,
+			  struct rte_flow_error *error)
+{
+	return mlx5_flow_validate_item_nsh(dev, item, error);
+}
+
 static int
 flow_hw_pattern_validate(struct rte_eth_dev *dev,
 			 const struct rte_flow_pattern_template_attr *attr,
@@ -7671,6 +7679,11 @@ flow_hw_pattern_validate(struct rte_eth_dev *dev,
 			 * template and item spec in flow rule.
 			 */
 			break;
+		case RTE_FLOW_ITEM_TYPE_NSH:
+			ret = mlx5_hw_validate_item_nsh(dev, &items[i], error);
+			if (ret < 0)
+				return ret;
+			break;
 		case RTE_FLOW_ITEM_TYPE_END:
 			items_end = true;
 			break;
-- 
2.34.1


             reply	other threads:[~2024-05-09 12:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-09 12:44 Gavin Li [this message]
2024-05-13 13:02 ` [PATCH] net/mlx5: fix HWS support for item NSH Dariusz Sosnowski

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=20240509124448.1524385-1-gavinl@nvidia.com \
    --to=gavinl@nvidia.com \
    --cc=bingz@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=dsosnowski@nvidia.com \
    --cc=igozlan@nvidia.com \
    --cc=matan@nvidia.com \
    --cc=orika@nvidia.com \
    --cc=rasland@nvidia.com \
    --cc=suanmingm@nvidia.com \
    --cc=thomas@monjalon.net \
    --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 read-only IMAP folder(s) and NNTP newsgroup(s).