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>, <suanmingm@nvidia.com>,
	Matan Azrad <matan@nvidia.com>
Cc: <dev@dpdk.org>, <orika@nvidia.com>,
	Yevgeny Kliteynik <kliteyn@nvidia.com>
Subject: [PATCH V1 05/11] net/mlx5/hws: read cross-vhca capabilities
Date: Sun, 18 Dec 2022 17:08:46 +0200	[thread overview]
Message-ID: <20221218150853.2167280-6-erezsh@nvidia.com> (raw)
In-Reply-To: <20221218150853.2167280-1-erezsh@nvidia.com>

From: Yevgeny Kliteynik <kliteyn@nvidia.com>


And keep them for future processing.

Signed-off-by: Yevgeny Kliteynik <kliteyn@nvidia.com>
Reviewed-by: Alex Vesker <valex@nvidia.com>
---
 drivers/net/mlx5/hws/mlx5dr_cmd.c | 24 ++++++++++++++++++++++++
 drivers/net/mlx5/hws/mlx5dr_cmd.h |  1 +
 2 files changed, 25 insertions(+)

diff --git a/drivers/net/mlx5/hws/mlx5dr_cmd.c b/drivers/net/mlx5/hws/mlx5dr_cmd.c
index 721376b8da..2156fd6643 100644
--- a/drivers/net/mlx5/hws/mlx5dr_cmd.c
+++ b/drivers/net/mlx5/hws/mlx5dr_cmd.c
@@ -723,6 +723,7 @@ int mlx5dr_cmd_query_caps(struct ibv_context *ctx,
 	uint32_t in[MLX5_ST_SZ_DW(query_hca_cap_in)] = {0};
 	const struct flow_hw_port_info *port_info;
 	struct ibv_device_attr_ex attr_ex;
+	u32 res;
 	int ret;
 
 	MLX5_SET(query_hca_cap_in, in, opcode, MLX5_CMD_OP_QUERY_HCA_CAP);
@@ -798,6 +799,23 @@ int mlx5dr_cmd_query_caps(struct ibv_context *ctx,
 						     capability.cmd_hca_cap_2.
 						     format_select_dw_gtpu_first_ext_dw_0);
 
+	/* check cross-VHCA support in cap2 */
+	res =
+	MLX5_GET(query_hca_cap_out, out,
+		capability.cmd_hca_cap_2.cross_vhca_object_to_object_supported);
+
+	caps->cross_vhca_resources = (res & MLX5_CROSS_VHCA_OBJ_TO_OBJ_TYPE_STC_TO_TIR) &&
+				     (res & MLX5_CROSS_VHCA_OBJ_TO_OBJ_TYPE_STC_TO_FT) &&
+				     (res & MLX5_CROSS_VHCA_OBJ_TO_OBJ_TYPE_FT_TO_RTC);
+
+	res =
+	MLX5_GET(query_hca_cap_out, out,
+		capability.cmd_hca_cap_2.allowed_object_for_other_vhca_access);
+
+	caps->cross_vhca_resources &= (res & MLX5_CROSS_VHCA_ALLOWED_OBJS_TIR) &&
+				      (res & MLX5_CROSS_VHCA_ALLOWED_OBJS_FT) &&
+				      (res & MLX5_CROSS_VHCA_ALLOWED_OBJS_RTC);
+
 	MLX5_SET(query_hca_cap_in, in, op_mod,
 		 MLX5_GET_HCA_CAP_OP_MOD_NIC_FLOW_TABLE |
 		 MLX5_HCA_CAP_OPMOD_GET_CUR);
@@ -817,6 +835,12 @@ int mlx5dr_cmd_query_caps(struct ibv_context *ctx,
 					capability.flow_table_nic_cap.
 					flow_table_properties_nic_receive.reparse);
 
+	/* check cross-VHCA support in flow table properties */
+	res =
+	MLX5_GET(query_hca_cap_out, out,
+		capability.flow_table_nic_cap.flow_table_properties_nic_receive.cross_vhca_object);
+	caps->cross_vhca_resources &= res;
+
 	if (caps->wqe_based_update) {
 		MLX5_SET(query_hca_cap_in, in, op_mod,
 			 MLX5_GET_HCA_CAP_OP_MOD_WQE_BASED_FLOW_TABLE |
diff --git a/drivers/net/mlx5/hws/mlx5dr_cmd.h b/drivers/net/mlx5/hws/mlx5dr_cmd.h
index 2b3b47f473..ab61e27fd8 100644
--- a/drivers/net/mlx5/hws/mlx5dr_cmd.h
+++ b/drivers/net/mlx5/hws/mlx5dr_cmd.h
@@ -163,6 +163,7 @@ struct mlx5dr_cmd_query_caps {
 	uint8_t sq_ts_format;
 	uint64_t definer_format_sup;
 	uint32_t trivial_match_definer;
+	bool cross_vhca_resources;
 	char fw_ver[64];
 };
 
-- 
2.18.2


  parent reply	other threads:[~2022-12-21 10:18 UTC|newest]

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

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=20221218150853.2167280-6-erezsh@nvidia.com \
    --to=erezsh@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=kliteyn@nvidia.com \
    --cc=matan@nvidia.com \
    --cc=orika@nvidia.com \
    --cc=suanmingm@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).