DPDK patches and discussions
 help / color / mirror / Atom feed
From: Erez Shitrit <erezsh@nvidia.com>
To: <erezsh@nvidia.com>, <valex@nvidia.com>, <viacheslavo@nvidia.com>,
	<thomas@monjalon.net>, Matan Azrad <matan@nvidia.com>
Cc: <dev@dpdk.org>, Yevgeny Kliteynik <kliteyn@nvidia.com>
Subject: [PATCH V1 06/11] net/mlx5/hws: added allow-other-vhca-access command
Date: Mon, 19 Dec 2022 10:24:11 +0200	[thread overview]
Message-ID: <20221219082416.2223812-7-erezsh@nvidia.com> (raw)
In-Reply-To: <20221219082416.2223812-1-erezsh@nvidia.com>

From: Yevgeny Kliteynik <kliteyn@nvidia.com>


Added FW command to allow creation of alias objects.

Signed-off-by: Yevgeny Kliteynik <kliteyn@nvidia.com>
Reviewed-by: Alex Vesker <valex@nvidia.com>
---
 drivers/common/mlx5/mlx5_prm.h    | 23 +++++++++++++++++++++++
 drivers/net/mlx5/hws/mlx5dr_cmd.c | 28 ++++++++++++++++++++++++++++
 drivers/net/mlx5/hws/mlx5dr_cmd.h |  9 +++++++++
 3 files changed, 60 insertions(+)

diff --git a/drivers/common/mlx5/mlx5_prm.h b/drivers/common/mlx5/mlx5_prm.h
index dfa25c2b49..9d36645949 100644
--- a/drivers/common/mlx5/mlx5_prm.h
+++ b/drivers/common/mlx5/mlx5_prm.h
@@ -1133,6 +1133,7 @@ enum {
 	MLX5_CMD_SET_REGEX_REGISTERS = 0xb06,
 	MLX5_CMD_QUERY_REGEX_REGISTERS = 0xb07,
 	MLX5_CMD_OP_ACCESS_REGISTER_USER = 0xb0c,
+	MLX5_CMD_OP_ALLOW_OTHER_VHCA_ACCESS = 0xb16,
 };
 
 enum {
@@ -3150,6 +3151,28 @@ struct mlx5_ifc_general_obj_out_cmd_hdr_bits {
 	u8 reserved_at_60[0x20];
 };
 
+struct mlx5_ifc_allow_other_vhca_access_in_bits {
+	u8 opcode[0x10];
+	u8 uid[0x10];
+	u8 reserved_at_20[0x10];
+	u8 op_mod[0x10];
+	u8 reserved_at_40[0x50];
+	u8 object_type_to_be_accessed[0x10];
+	u8 object_id_to_be_accessed[0x20];
+	u8 reserved_at_c0[0x40];
+	union {
+		u8 access_key_raw[0x100];
+		u8 access_key[8][0x20];
+	};
+};
+
+struct mlx5_ifc_allow_other_vhca_access_out_bits {
+	u8 status[0x8];
+	u8 reserved_at_8[0x18];
+	u8 syndrome[0x20];
+	u8 reserved_at_40[0x40];
+};
+
 struct mlx5_ifc_virtio_q_counters_bits {
 	u8 modify_field_select[0x40];
 	u8 reserved_at_40[0x40];
diff --git a/drivers/net/mlx5/hws/mlx5dr_cmd.c b/drivers/net/mlx5/hws/mlx5dr_cmd.c
index 2156fd6643..b120be2d88 100644
--- a/drivers/net/mlx5/hws/mlx5dr_cmd.c
+++ b/drivers/net/mlx5/hws/mlx5dr_cmd.c
@@ -716,6 +716,34 @@ int mlx5dr_cmd_sq_modify_rdy(struct mlx5dr_devx_obj *devx_obj)
 	return ret;
 }
 
+int mlx5dr_cmd_allow_other_vhca_access(struct ibv_context *ctx,
+				       struct mlx5dr_cmd_allow_other_vhca_access_attr *attr)
+{
+	uint32_t out[MLX5_ST_SZ_DW(allow_other_vhca_access_out)] = {0};
+	uint32_t in[MLX5_ST_SZ_DW(allow_other_vhca_access_in)] = {0};
+	void *key;
+	int ret;
+
+	MLX5_SET(allow_other_vhca_access_in,
+		 in, opcode, MLX5_CMD_OP_ALLOW_OTHER_VHCA_ACCESS);
+	MLX5_SET(allow_other_vhca_access_in,
+		 in, object_type_to_be_accessed, attr->obj_type);
+	MLX5_SET(allow_other_vhca_access_in,
+		 in, object_id_to_be_accessed, attr->obj_id);
+
+	key = MLX5_ADDR_OF(allow_other_vhca_access_in, in, access_key);
+	memcpy(key, attr->access_key, sizeof(attr->access_key));
+
+	ret = mlx5_glue->devx_general_cmd(ctx, in, sizeof(in), out, sizeof(out));
+	if (ret) {
+		DR_LOG(ERR, "Failed to execute ALLOW_OTHER_VHCA_ACCESS command");
+		rte_errno = errno;
+		return rte_errno;
+	}
+
+	return 0;
+}
+
 int mlx5dr_cmd_query_caps(struct ibv_context *ctx,
 			  struct mlx5dr_cmd_query_caps *caps)
 {
diff --git a/drivers/net/mlx5/hws/mlx5dr_cmd.h b/drivers/net/mlx5/hws/mlx5dr_cmd.h
index ab61e27fd8..ea6ced9d27 100644
--- a/drivers/net/mlx5/hws/mlx5dr_cmd.h
+++ b/drivers/net/mlx5/hws/mlx5dr_cmd.h
@@ -124,6 +124,12 @@ struct mlx5dr_cmd_sq_create_attr {
 	uint32_t ts_format;
 };
 
+struct mlx5dr_cmd_allow_other_vhca_access_attr {
+	uint16_t obj_type;
+	uint32_t obj_id;
+	uint8_t access_key[32];
+};
+
 struct mlx5dr_cmd_query_ft_caps {
 	uint8_t max_level;
 	uint8_t reparse;
@@ -230,4 +236,7 @@ void mlx5dr_cmd_set_attr_connect_miss_tbl(struct mlx5dr_context *ctx,
 					  uint32_t fw_ft_type,
 					  enum mlx5dr_table_type type,
 					  struct mlx5dr_cmd_ft_modify_attr *ft_attr);
+
+int mlx5dr_cmd_allow_other_vhca_access(struct ibv_context *ctx,
+				       struct mlx5dr_cmd_allow_other_vhca_access_attr *attr);
 #endif /* MLX5DR_CMD_H_ */
-- 
2.18.2


  parent reply	other threads:[~2022-12-19  8:25 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-19  8:24 [PATCH V1 00/11] Support resource sharing among ibv_devices Erez Shitrit
2022-12-19  8:24 ` [PATCH V1 01/11] mailmap: add new contributors to the list Erez Shitrit
2022-12-19  8:24 ` [PATCH V1 02/11] net/mlx5/hws: add capabilities fields for vhca access Erez Shitrit
2022-12-27 15:47   ` Slava Ovsiienko
2023-01-05 13:02   ` [PATCH v2 00/10] Support resource sharing among ibv_devices Erez Shitrit
2023-01-05 13:02     ` [PATCH v2 01/10] net/mlx5/hws: add capabilities fields for vhca access Erez Shitrit
2023-01-05 13:02     ` [PATCH v2 02/10] net/mlx5/hws: remove wrong PRM capability macros Erez Shitrit
2023-01-05 13:02     ` [PATCH v2 03/10] net/mlx5/hws: add PRM definitions for cross-vhca capabilities Erez Shitrit
2023-01-05 13:02     ` [PATCH v2 04/10] net/mlx5/hws: read " Erez Shitrit
2023-01-05 13:02     ` [PATCH v2 05/10] net/mlx5/hws: added allow-other-vhca-access command Erez Shitrit
2023-01-05 13:02     ` [PATCH v2 06/10] net/mlx5/hws: added command to create alias objects Erez Shitrit
2023-01-05 13:03     ` [PATCH v2 07/10] net/mlx5/hws: add vhca identifier ID to the caps Erez Shitrit
2023-01-05 13:03     ` [PATCH v2 08/10] net/mlx5/hws: support shared ibv-context with local one Erez Shitrit
2023-01-05 13:03     ` [PATCH v2 09/10] net/mlx5/hws: support actions while shared resources is used Erez Shitrit
2023-01-05 13:03     ` [PATCH v2 10/10] net/mlx5/hws: add debug details for cross gvmi Erez Shitrit
2023-01-10  9:01     ` [PATCH v2 00/10] Support resource sharing among ibv_devices Raslan Darawsheh
2022-12-19  8:24 ` [PATCH V1 03/11] net/mlx5/hws: remove wrong PRM capability macros Erez Shitrit
2022-12-27 15:47   ` Slava Ovsiienko
2022-12-19  8:24 ` [PATCH V1 04/11] net/mlx5/hws: add PRM definitions for cross-vhca capabilities Erez Shitrit
2022-12-27 15:47   ` Slava Ovsiienko
2022-12-19  8:24 ` [PATCH V1 05/11] net/mlx5/hws: read " Erez Shitrit
2022-12-27 15:47   ` Slava Ovsiienko
2022-12-19  8:24 ` Erez Shitrit [this message]
2022-12-27 15:48   ` [PATCH V1 06/11] net/mlx5/hws: added allow-other-vhca-access command Slava Ovsiienko
2022-12-19  8:24 ` [PATCH V1 07/11] net/mlx5/hws: added command to create alias objects Erez Shitrit
2022-12-27 15:48   ` Slava Ovsiienko
2022-12-19  8:24 ` [PATCH V1 08/11] net/mlx5/hws: add vhca identifier ID to the caps Erez Shitrit
2022-12-27 15:48   ` Slava Ovsiienko
2022-12-19  8:24 ` [PATCH V1 09/11] net/mlx5/hws: support shared ibv-context with local one Erez Shitrit
2022-12-27 15:49   ` Slava Ovsiienko
2022-12-19  8:24 ` [PATCH V1 10/11] net/mlx5/hws: support actions while shared resources is used Erez Shitrit
2022-12-27 15:49   ` Slava Ovsiienko
2022-12-19  8:24 ` [PATCH V1 11/11] net/mlx5/hws: add debug details for cross gvmi Erez Shitrit
2022-12-27 15:48   ` Slava Ovsiienko
  -- strict thread matches above, loose matches on Subject: below --
2022-12-18 15:08 [PATCH V1 00/11] Support resource sharing among ibv_devices Erez Shitrit
2022-12-18 15:08 ` [PATCH V1 06/11] net/mlx5/hws: added allow-other-vhca-access command Erez Shitrit

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=20221219082416.2223812-7-erezsh@nvidia.com \
    --to=erezsh@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=kliteyn@nvidia.com \
    --cc=matan@nvidia.com \
    --cc=thomas@monjalon.net \
    --cc=valex@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).