DPDK patches and discussions
 help / color / mirror / Atom feed
From: Gregory Etelson <getelson@nvidia.com>
To: <dev@dpdk.org>
Cc: <getelson@nvidia.com>, <mkashani@nvidia.com>,
	<rasland@nvidia.com>, "Ori Kam" <orika@nvidia.com>,
	Matan Azrad <matan@nvidia.com>,
	Viacheslav Ovsiienko <viacheslavo@nvidia.com>,
	Suanming Mou <suanmingm@nvidia.com>
Subject: [PATCH 03/13] net/mlx5/hws: Definer, use flow_hw_get_reg_id_from_ctx function call
Date: Sun, 29 Oct 2023 20:22:50 +0200	[thread overview]
Message-ID: <20231029182300.227879-4-getelson@nvidia.com> (raw)
In-Reply-To: <20231029182300.227879-1-getelson@nvidia.com>

New function call `flow_hw_get_reg_id_from_ctx()` matches REG_C
register to input DR5 context.

Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
---
 drivers/net/mlx5/hws/mlx5dr_definer.c | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/drivers/net/mlx5/hws/mlx5dr_definer.c b/drivers/net/mlx5/hws/mlx5dr_definer.c
index 5d6ff516b3..7e1a92d78a 100644
--- a/drivers/net/mlx5/hws/mlx5dr_definer.c
+++ b/drivers/net/mlx5/hws/mlx5dr_definer.c
@@ -1541,7 +1541,9 @@ mlx5dr_definer_conv_item_tag(struct mlx5dr_definer_conv_data *cd,
 		return 0;
 
 	if (item->type == RTE_FLOW_ITEM_TYPE_TAG)
-		reg = flow_hw_get_reg_id(RTE_FLOW_ITEM_TYPE_TAG, v->index);
+		reg = flow_hw_get_reg_id_from_ctx(cd->ctx,
+						  RTE_FLOW_ITEM_TYPE_TAG,
+						  v->index);
 	else
 		reg = (int)v->index;
 
@@ -1601,7 +1603,9 @@ mlx5dr_definer_conv_item_quota(struct mlx5dr_definer_conv_data *cd,
 			       __rte_unused struct rte_flow_item *item,
 			       int item_idx)
 {
-	int mtr_reg = flow_hw_get_reg_id(RTE_FLOW_ITEM_TYPE_METER_COLOR, 0);
+	int mtr_reg =
+	flow_hw_get_reg_id_from_ctx(cd->ctx, RTE_FLOW_ITEM_TYPE_METER_COLOR,
+				    0);
 	struct mlx5dr_definer_fc *fc;
 
 	if (mtr_reg < 0) {
@@ -1631,7 +1635,7 @@ mlx5dr_definer_conv_item_metadata(struct mlx5dr_definer_conv_data *cd,
 	if (!m)
 		return 0;
 
-	reg = flow_hw_get_reg_id(RTE_FLOW_ITEM_TYPE_META, -1);
+	reg = flow_hw_get_reg_id_from_ctx(cd->ctx, RTE_FLOW_ITEM_TYPE_META, -1);
 	if (reg <= 0) {
 		DR_LOG(ERR, "Invalid register for item metadata");
 		rte_errno = EINVAL;
@@ -1939,7 +1943,8 @@ mlx5dr_definer_conv_item_conntrack(struct mlx5dr_definer_conv_data *cd,
 	if (!m)
 		return 0;
 
-	reg = flow_hw_get_reg_id(RTE_FLOW_ITEM_TYPE_CONNTRACK, -1);
+	reg = flow_hw_get_reg_id_from_ctx(cd->ctx, RTE_FLOW_ITEM_TYPE_CONNTRACK,
+					  -1);
 	if (reg <= 0) {
 		DR_LOG(ERR, "Invalid register for item conntrack");
 		rte_errno = EINVAL;
@@ -2080,7 +2085,8 @@ mlx5dr_definer_conv_item_meter_color(struct mlx5dr_definer_conv_data *cd,
 	if (!m)
 		return 0;
 
-	reg = flow_hw_get_reg_id(RTE_FLOW_ITEM_TYPE_METER_COLOR, 0);
+	reg = flow_hw_get_reg_id_from_ctx(cd->ctx,
+					  RTE_FLOW_ITEM_TYPE_METER_COLOR, 0);
 	MLX5_ASSERT(reg > 0);
 
 	fc = mlx5dr_definer_get_register_fc(cd, reg);
-- 
2.39.2


  parent reply	other threads:[~2023-10-29 18:23 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-29 18:22 [PATCH 00/13] net/mlx5: support more REG C registers Gregory Etelson
2023-10-29 18:22 ` [PATCH 01/13] net/mlx5/hws: Definer, add mlx5dr context to definer_conv_data Gregory Etelson
2023-10-29 18:22 ` [PATCH 02/13] net/mlx5: add flow_hw_get_reg_id_from_ctx() Gregory Etelson
2023-10-29 18:22 ` Gregory Etelson [this message]
2023-10-29 18:22 ` [PATCH 04/13] net/mlx5: add rte_device parameter to locate HWS registers Gregory Etelson
2023-10-29 18:22 ` [PATCH 05/13] net/mlx5: separate port REG_C registers usage Gregory Etelson
2023-10-29 18:22 ` [PATCH 06/13] net/mlx5: merge REG_C aliases Gregory Etelson
2023-10-29 18:22 ` [PATCH 07/13] net/mlx5: initialize HWS flow tags registers in shared dev context Gregory Etelson
2023-10-29 18:22 ` [PATCH 08/13] net/mlx5/hws: adding method to query rule hash Gregory Etelson
2023-10-30  6:23   ` Ori Kam
2023-10-29 18:22 ` [PATCH 09/13] net/mlx5: add support for calc hash Gregory Etelson
2023-10-30  8:23   ` Dariusz Sosnowski
2023-10-29 18:22 ` [PATCH 10/13] net/mlx5: fix insert by index Gregory Etelson
2023-10-30  8:25   ` Dariusz Sosnowski
2023-10-29 18:22 ` [PATCH 11/13] net/mlx5: fix query for NIC flow cap Gregory Etelson
2023-10-30  8:26   ` Dariusz Sosnowski
2023-10-29 18:22 ` [PATCH 12/13] net/mlx5: add support for more registers Gregory Etelson
2023-10-30  8:27   ` Dariusz Sosnowski
2023-10-29 18:23 ` [PATCH 13/13] net/mlx5: add validation support for tags Gregory Etelson
2023-10-30  8:28   ` Dariusz Sosnowski
2023-10-30  8:37 ` [PATCH 00/13] net/mlx5: support more REG C registers Suanming Mou
2023-10-30 17:11   ` 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=20231029182300.227879-4-getelson@nvidia.com \
    --to=getelson@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=matan@nvidia.com \
    --cc=mkashani@nvidia.com \
    --cc=orika@nvidia.com \
    --cc=rasland@nvidia.com \
    --cc=suanmingm@nvidia.com \
    --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).