patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Ophir Munk <ophirmu@nvidia.com>
To: dev@dpdk.org, Raslan Darawsheh <rasland@nvidia.com>
Cc: Ophir Munk <ophirmu@nvidia.com>, Matan Azrad <matan@nvidia.com>,
	Tal Shnaiderman <talshn@nvidia.com>,
	Thomas Monjalon <thomas@monjalon.net>,
	stable@dpdk.org
Subject: [dpdk-stable] [PATCH v1 01/72] mlx5: fix relaxed ordering DevX flow
Date: Tue, 27 Oct 2020 23:22:24 +0000
Message-ID: <20201027232335.31427-2-ophirmu@nvidia.com> (raw)
In-Reply-To: <20201027232335.31427-1-ophirmu@nvidia.com>

From: Tal Shnaiderman <talshn@nvidia.com>

The current DevX implementation of the relaxed ordering feature is
enabling relaxed ordering usage only if both relaxed ordering read AND
write are supported.  In that case both relaxed ordering read and write
are activated.

This commit will optimize the usage of relaxed ordering by enabling it
when the read OR write features are supported.  Each relaxed ordering
type will be activated according to it's own capability bit.

This will align the DevX flow with the verbs implementation of
ibv_reg_mr when using the flag IBV_ACCESS_RELAXED_ORDERING

Fixes: 53ac93f71ad1 ("net/mlx5: create relaxed ordering memory regions")
Fixes: d4322061770b ("net/mlx5: synchronize flow counter pool creation")
Cc: stable@dpdk.org

Signed-off-by: Tal Shnaiderman <talshn@nvidia.com>
---
 drivers/common/mlx5/mlx5_devx_cmds.c |  8 ++++----
 drivers/common/mlx5/mlx5_devx_cmds.h |  3 ++-
 drivers/net/mlx5/linux/mlx5_os.c     | 12 ++++++++----
 drivers/net/mlx5/mlx5.h              |  3 ++-
 drivers/net/mlx5/mlx5_flow.c         |  3 ++-
 drivers/vdpa/mlx5/mlx5_vdpa_lm.c     |  3 ++-
 drivers/vdpa/mlx5/mlx5_vdpa_mem.c    |  3 ++-
 7 files changed, 22 insertions(+), 13 deletions(-)

diff --git a/drivers/common/mlx5/mlx5_devx_cmds.c b/drivers/common/mlx5/mlx5_devx_cmds.c
index 8aee12d..27eff5f 100644
--- a/drivers/common/mlx5/mlx5_devx_cmds.c
+++ b/drivers/common/mlx5/mlx5_devx_cmds.c
@@ -267,10 +267,10 @@ mlx5_devx_cmd_mkey_create(void *ctx,
 	MLX5_SET(mkc, mkc, pd, attr->pd);
 	MLX5_SET(mkc, mkc, mkey_7_0, attr->umem_id & 0xFF);
 	MLX5_SET(mkc, mkc, translations_octword_size, translation_size);
-	if (attr->relaxed_ordering == 1) {
-		MLX5_SET(mkc, mkc, relaxed_ordering_write, 0x1);
-		MLX5_SET(mkc, mkc, relaxed_ordering_read, 0x1);
-	}
+	MLX5_SET(mkc, mkc, relaxed_ordering_write,
+		attr->relaxed_ordering_write);
+	MLX5_SET(mkc, mkc, relaxed_ordering_read,
+		attr->relaxed_ordering_read);
 	MLX5_SET64(mkc, mkc, start_addr, attr->addr);
 	MLX5_SET64(mkc, mkc, len, attr->size);
 	mkey->obj = mlx5_glue->devx_obj_create(ctx, in, in_size_dw * 4, out,
diff --git a/drivers/common/mlx5/mlx5_devx_cmds.h b/drivers/common/mlx5/mlx5_devx_cmds.h
index abbea67..25cf12e 100644
--- a/drivers/common/mlx5/mlx5_devx_cmds.h
+++ b/drivers/common/mlx5/mlx5_devx_cmds.h
@@ -20,7 +20,8 @@ struct mlx5_devx_mkey_attr {
 	uint32_t pd;
 	uint32_t log_entity_size;
 	uint32_t pg_access:1;
-	uint32_t relaxed_ordering:1;
+	uint32_t relaxed_ordering_write:1;
+	uint32_t relaxed_ordering_read:1;
 	struct mlx5_klm *klm_array;
 	int klm_num;
 };
diff --git a/drivers/net/mlx5/linux/mlx5_os.c b/drivers/net/mlx5/linux/mlx5_os.c
index c890998..25897d9 100644
--- a/drivers/net/mlx5/linux/mlx5_os.c
+++ b/drivers/net/mlx5/linux/mlx5_os.c
@@ -1078,10 +1078,14 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev,
 			goto error;
 		}
 		/* Check relax ordering support. */
-		if (config->hca_attr.relaxed_ordering_write &&
-		    config->hca_attr.relaxed_ordering_read  &&
-		    !haswell_broadwell_cpu)
-			sh->cmng.relaxed_ordering = 1;
+		sh->cmng.relaxed_ordering_read = 0;
+		sh->cmng.relaxed_ordering_write = 0;
+		if (!haswell_broadwell_cpu) {
+			sh->cmng.relaxed_ordering_write =
+				config->hca_attr.relaxed_ordering_write;
+			sh->cmng.relaxed_ordering_read =
+				config->hca_attr.relaxed_ordering_read;
+		}
 		/* Check for LRO support. */
 		if (config->dest_tir && config->hca_attr.lro_cap &&
 		    config->dv_flow_en) {
diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h
index 88bbd31..c148e8e 100644
--- a/drivers/net/mlx5/mlx5.h
+++ b/drivers/net/mlx5/mlx5.h
@@ -455,7 +455,8 @@ struct mlx5_flow_counter_mng {
 	uint8_t pending_queries;
 	uint16_t pool_index;
 	uint8_t query_thread_on;
-	bool relaxed_ordering;
+	bool relaxed_ordering_read;
+	bool relaxed_ordering_write;
 	bool counter_fallback; /* Use counter fallback management. */
 	LIST_HEAD(mem_mngs, mlx5_counter_stats_mem_mng) mem_mngs;
 	LIST_HEAD(stat_raws, mlx5_counter_stats_raw) free_stat_raws;
diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index 082d886..89d6d70 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -7221,7 +7221,8 @@ mlx5_flow_create_counter_stat_mem_mng(struct mlx5_dev_ctx_shared *sh)
 	mkey_attr.pg_access = 0;
 	mkey_attr.klm_array = NULL;
 	mkey_attr.klm_num = 0;
-	mkey_attr.relaxed_ordering = sh->cmng.relaxed_ordering;
+	mkey_attr.relaxed_ordering_write = sh->cmng.relaxed_ordering_write;
+	mkey_attr.relaxed_ordering_read = sh->cmng.relaxed_ordering_read;
 	mem_mng->dm = mlx5_devx_cmd_mkey_create(sh->ctx, &mkey_attr);
 	if (!mem_mng->dm) {
 		mlx5_glue->devx_umem_dereg(mem_mng->umem);
diff --git a/drivers/vdpa/mlx5/mlx5_vdpa_lm.c b/drivers/vdpa/mlx5/mlx5_vdpa_lm.c
index 273c46f..6c4284f 100644
--- a/drivers/vdpa/mlx5/mlx5_vdpa_lm.c
+++ b/drivers/vdpa/mlx5/mlx5_vdpa_lm.c
@@ -43,7 +43,8 @@ mlx5_vdpa_dirty_bitmap_set(struct mlx5_vdpa_priv *priv, uint64_t log_base,
 			.pg_access = 1,
 			.klm_array = NULL,
 			.klm_num = 0,
-			.relaxed_ordering = 0,
+			.relaxed_ordering_read = 0,
+			.relaxed_ordering_write = 0,
 	};
 	struct mlx5_devx_virtq_attr attr = {
 		.type = MLX5_VIRTQ_MODIFY_TYPE_DIRTY_BITMAP_PARAMS,
diff --git a/drivers/vdpa/mlx5/mlx5_vdpa_mem.c b/drivers/vdpa/mlx5/mlx5_vdpa_mem.c
index b6c7cb8..f8861d5 100644
--- a/drivers/vdpa/mlx5/mlx5_vdpa_mem.c
+++ b/drivers/vdpa/mlx5/mlx5_vdpa_mem.c
@@ -223,7 +223,8 @@ mlx5_vdpa_mem_register(struct mlx5_vdpa_priv *priv)
 		mkey_attr.pg_access = 1;
 		mkey_attr.klm_array = NULL;
 		mkey_attr.klm_num = 0;
-		mkey_attr.relaxed_ordering = 0;
+		mkey_attr.relaxed_ordering_read = 0;
+		mkey_attr.relaxed_ordering_write = 0;
 		entry->mkey = mlx5_devx_cmd_mkey_create(priv->ctx, &mkey_attr);
 		if (!entry->mkey) {
 			DRV_LOG(ERR, "Failed to create direct Mkey.");
-- 
2.8.4


       reply	other threads:[~2020-10-27 23:24 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20201027232335.31427-1-ophirmu@nvidia.com>
2020-10-27 23:22 ` Ophir Munk [this message]
     [not found]   ` <20201210150648.8784-1-talshn@nvidia.com>
2020-12-10 15:06     ` [dpdk-stable] [PATCH v2 01/33] net/mlx5: fix folding constant array error Tal Shnaiderman
     [not found]       ` <20201213102056.11380-1-talshn@nvidia.com>
2020-12-13 10:20         ` [dpdk-stable] [PATCH v3 01/32] " Tal Shnaiderman
     [not found]           ` <20201213205005.7300-1-talshn@nvidia.com>
2020-12-13 20:49             ` [dpdk-stable] [PATCH v4 " Tal Shnaiderman
     [not found]               ` <20201228095436.14996-1-talshn@nvidia.com>
2020-12-28  9:54                 ` [dpdk-stable] [PATCH v5 " Tal Shnaiderman
2020-12-28  9:54                 ` [dpdk-stable] [PATCH v5 04/32] net/mlx5: fix freeing packet pacing Tal Shnaiderman
2020-12-28  9:54                 ` [dpdk-stable] [PATCH v5 11/32] net/mlx5: fix adding destroy flow action wrapper Tal Shnaiderman
2020-12-13 20:49             ` [dpdk-stable] [PATCH v4 04/32] net/mlx5: fix freeing packet pacing Tal Shnaiderman
2020-12-13 20:49             ` [dpdk-stable] [PATCH v4 11/32] net/mlx5: fix adding destroy flow action wrapper Tal Shnaiderman
2020-12-13 10:20         ` [dpdk-stable] [PATCH v3 04/32] net/mlx5: fix freeing packet pacing Tal Shnaiderman
2020-12-13 10:20         ` [dpdk-stable] [PATCH v3 11/32] net/mlx5: fix adding destroy flow action wrapper Tal Shnaiderman
2020-12-10 15:06     ` [dpdk-stable] [PATCH v2 04/33] net/mlx5: fix freeing packet pacing Tal Shnaiderman
2020-12-10 15:06     ` [dpdk-stable] [PATCH v2 11/33] net/mlx5: fix adding destroy flow action wrapper Tal Shnaiderman
2020-10-27 23:22 ` [dpdk-stable] [PATCH v1 02/72] net/mlx5: fix flow sample definitions Ophir Munk
2020-10-27 23:22 ` [dpdk-stable] [PATCH v1 06/72] net/mlx5: fix freeing packet pacing Ophir Munk
2020-10-27 23:23 ` [dpdk-stable] [PATCH v1 62/72] net/mlx5/linux: fix add OS dest_devx_tir action Ophir Munk
2020-10-27 23:23 ` [dpdk-stable] [PATCH v1 70/72] common/mlx5: fix Windows warnings on missing enum Ophir Munk
2020-10-27 23:23 ` [dpdk-stable] [PATCH v1 71/72] net/mlx5: fix Windows warnings on get_if_name Ophir Munk
2020-10-28  7:34   ` 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=20201027232335.31427-2-ophirmu@nvidia.com \
    --to=ophirmu@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=matan@nvidia.com \
    --cc=rasland@nvidia.com \
    --cc=stable@dpdk.org \
    --cc=talshn@nvidia.com \
    --cc=thomas@monjalon.net \
    /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

patches for DPDK stable branches

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/stable/0 stable/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 stable stable/ https://inbox.dpdk.org/stable \
		stable@dpdk.org
	public-inbox-index stable

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.stable


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git