DPDK patches and discussions
 help / color / mirror / Atom feed
From: Jiawei Wang <jiaweiw@nvidia.com>
To: viacheslavo@nvidia.com, matan@nvidia.com, orika@nvidia.com
Cc: dev@dpdk.org, rasland@nvidia.com
Subject: [dpdk-dev] [PATCH v2 1/5] common/mlx5: query register c preserve capability via DevX
Date: Tue, 12 Jan 2021 12:29:15 +0200	[thread overview]
Message-ID: <1610447359-411658-2-git-send-email-jiaweiw@nvidia.com> (raw)
In-Reply-To: <1610447359-411658-1-git-send-email-jiaweiw@nvidia.com>

Update function mlx5_devx_cmd_query_hca_attr() to add the
reg_c_preserve bit query.

The stored metadata in register C may be lost in NIC Tx and
FDB egress while doing one of the following operations:
 - packet encapsulation.
 - packet mirroring (multiple processing paths).
 - packet sampling (using Flow Sampler).

If the reg_c_preserve bit is set to 1, then the above
limitation is obsolete, the all metadata registers Cx
preserve their values even through the operations mentioned
above.

Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
---
 drivers/common/mlx5/mlx5_devx_cmds.c | 2 ++
 drivers/common/mlx5/mlx5_devx_cmds.h | 1 +
 drivers/common/mlx5/mlx5_prm.h       | 4 +++-
 3 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/common/mlx5/mlx5_devx_cmds.c b/drivers/common/mlx5/mlx5_devx_cmds.c
index 3bf5279..a1b4910 100644
--- a/drivers/common/mlx5/mlx5_devx_cmds.c
+++ b/drivers/common/mlx5/mlx5_devx_cmds.c
@@ -728,6 +728,8 @@ struct mlx5_devx_obj *
 	attr->log_max_pd = MLX5_GET(cmd_hca_cap, hcattr, log_max_pd);
 	attr->log_max_srq = MLX5_GET(cmd_hca_cap, hcattr, log_max_srq);
 	attr->log_max_srq_sz = MLX5_GET(cmd_hca_cap, hcattr, log_max_srq_sz);
+	attr->reg_c_preserve =
+		MLX5_GET(cmd_hca_cap, hcattr, reg_c_preserve);
 	if (attr->qos.sup) {
 		MLX5_SET(query_hca_cap_in, in, op_mod,
 			 MLX5_GET_HCA_CAP_OP_MOD_QOS_CAP |
diff --git a/drivers/common/mlx5/mlx5_devx_cmds.h b/drivers/common/mlx5/mlx5_devx_cmds.h
index 94e9bbb..e0fa595 100644
--- a/drivers/common/mlx5/mlx5_devx_cmds.h
+++ b/drivers/common/mlx5/mlx5_devx_cmds.h
@@ -114,6 +114,7 @@ struct mlx5_hca_attr {
 	uint32_t scatter_fcs_w_decap_disable:1;
 	uint32_t flow_hit_aso:1; /* General obj type FLOW_HIT_ASO supported. */
 	uint32_t regex:1;
+	uint32_t reg_c_preserve:1;
 	uint32_t regexp_num_of_engines;
 	uint32_t log_max_ft_sampler_num:8;
 	struct mlx5_hca_qos_attr qos;
diff --git a/drivers/common/mlx5/mlx5_prm.h b/drivers/common/mlx5/mlx5_prm.h
index 7d5cf96..712f698 100644
--- a/drivers/common/mlx5/mlx5_prm.h
+++ b/drivers/common/mlx5/mlx5_prm.h
@@ -1130,7 +1130,9 @@ struct mlx5_ifc_cmd_hca_cap_bits {
 	u8 regexp[0x1];
 	u8 reserved_at_a1[0x3];
 	u8 regexp_num_of_engines[0x4];
-	u8 reserved_at_a8[0x3];
+	u8 reserved_at_a8[0x1];
+	u8 reg_c_preserve[0x1];
+	u8 reserved_at_aa[0x1];
 	u8 log_max_srq[0x5];
 	u8 reserved_at_b0[0x3];
 	u8 regexp_log_crspace_size[0x5];
-- 
1.8.3.1


  reply	other threads:[~2021-01-12 10:29 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-10 11:06 [dpdk-dev] [PATCH 0/5] Add the E-Switch mirroring and jump supports Jiawei Wang
2021-01-10 11:06 ` [dpdk-dev] [PATCH 1/5] common/mlx5: query register c preserve capability via DevX Jiawei Wang
2021-01-10 11:06 ` [dpdk-dev] [PATCH 2/5] net/mlx5: support E-Switch mirroring and jump in one flow Jiawei Wang
2021-01-10 11:06 ` [dpdk-dev] [PATCH 3/5] net/mlx5: extend the skip scale flag Jiawei Wang
2021-01-10 11:06 ` [dpdk-dev] [PATCH 4/5] net/mlx5: supports modify one port in E-Switch mirroring Jiawei Wang
2021-01-10 11:06 ` [dpdk-dev] [PATCH 5/5] doc: update the advanced E-switch mirroring supports Jiawei Wang
2021-01-12 10:29 ` [dpdk-dev] [PATCH v2 0/5] Add the E-Switch mirroring and jump supports Jiawei Wang
2021-01-12 10:29   ` Jiawei Wang [this message]
2021-01-12 10:29   ` [dpdk-dev] [PATCH v2 2/5] net/mlx5: support E-Switch mirroring and jump in one flow Jiawei Wang
2021-01-12 10:29   ` [dpdk-dev] [PATCH v2 3/5] net/mlx5: extend the skip scale flag Jiawei Wang
2021-01-12 10:29   ` [dpdk-dev] [PATCH v2 4/5] net/mlx5: update modify actions support for E-Switch mirror Jiawei Wang
2021-01-12 10:29   ` [dpdk-dev] [PATCH v2 5/5] doc: update the advanced E-switch mirroring supports Jiawei Wang
2021-01-22 12:37     ` Ferruh Yigit
2021-01-20 15:05   ` [dpdk-dev] [PATCH v2 0/5] Add the E-Switch mirroring and jump supports 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=1610447359-411658-2-git-send-email-jiaweiw@nvidia.com \
    --to=jiaweiw@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=matan@nvidia.com \
    --cc=orika@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).