DPDK patches and discussions
 help / color / mirror / Atom feed
From: Suanming Mou <suanmingm@nvidia.com>
To: viacheslavo@nvidia.com, matan@nvidia.com
Cc: rasland@nvidia.com, dev@dpdk.org
Subject: [dpdk-dev] [PATCH] net/mlx5: fix counter offset support discover
Date: Thu, 12 Nov 2020 16:51:43 +0800	[thread overview]
Message-ID: <1605171103-312387-1-git-send-email-suanmingm@nvidia.com> (raw)

Currently, the counter offset support is discovered by creating the
rule with invalid offset counter and jump action in root table. If
the rule creation fails with EINVAL errno, that mean counter offset
is not supported in root table.

However, jump action may not be supported in some rdma-core version.
In this case, the discover code will not work properly.

This commits changes the jump action to generic drop action. That
makes the discover code to be more compatible.

Fixes: 994829e695c0 ("net/mlx5: remove single counter container")

Signed-off-by: Suanming Mou <suanmingm@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 drivers/net/mlx5/mlx5_flow_dv.c | 22 +++++-----------------
 1 file changed, 5 insertions(+), 17 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index 78c710f..bb2898f 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -12294,19 +12294,15 @@ struct mlx5_cache_entry *
 		.match_mask = (void *)&mask,
 	};
 	void *actions[2] = { 0 };
-	struct mlx5_flow_tbl_resource *tbl = NULL, *dest_tbl = NULL;
+	struct mlx5_flow_tbl_resource *tbl = NULL;
 	struct mlx5_devx_obj *dcs = NULL;
 	void *matcher = NULL;
 	void *flow = NULL;
-	int i, ret = -1;
+	int ret = -1;
 
 	tbl = flow_dv_tbl_resource_get(dev, 0, 0, 0, false, NULL, 0, 0, NULL);
 	if (!tbl)
 		goto err;
-	dest_tbl = flow_dv_tbl_resource_get(dev, 1, 0, 0, false,
-					    NULL, 0, 0, NULL);
-	if (!dest_tbl)
-		goto err;
 	dcs = mlx5_devx_cmd_flow_counter_alloc(priv->sh->ctx, 0x4);
 	if (!dcs)
 		goto err;
@@ -12314,10 +12310,7 @@ struct mlx5_cache_entry *
 						    &actions[0]);
 	if (ret)
 		goto err;
-	ret = mlx5_flow_os_create_flow_action_dest_flow_tbl
-				(dest_tbl->obj, &actions[1]);
-	if (ret)
-		goto err;
+	actions[1] = priv->drop_queue.hrxq->action;
 	dv_attr.match_criteria_enable = flow_dv_matcher_enable(mask.buf);
 	ret = mlx5_flow_os_create_flow_matcher(sh->ctx, &dv_attr, tbl->obj,
 					       &matcher);
@@ -12346,17 +12339,12 @@ struct mlx5_cache_entry *
 				     "support detection");
 		ret = 0;
 	}
-	for (i = 0; i < 2; i++) {
-		if (actions[i])
-			claim_zero(mlx5_flow_os_destroy_flow_action
-				   (actions[i]));
-	}
+	if (actions[0])
+		claim_zero(mlx5_flow_os_destroy_flow_action(actions[0]));
 	if (matcher)
 		claim_zero(mlx5_flow_os_destroy_flow_matcher(matcher));
 	if (tbl)
 		flow_dv_tbl_resource_release(MLX5_SH(dev), tbl);
-	if (dest_tbl)
-		flow_dv_tbl_resource_release(MLX5_SH(dev), dest_tbl);
 	if (dcs)
 		claim_zero(mlx5_devx_cmd_destroy(dcs));
 	return ret;
-- 
1.8.3.1


             reply	other threads:[~2020-11-12  8:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-12  8:51 Suanming Mou [this message]
2020-11-13 19:13 ` Thomas Monjalon

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=1605171103-312387-1-git-send-email-suanmingm@nvidia.com \
    --to=suanmingm@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=matan@nvidia.com \
    --cc=rasland@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).