[04/13] net/mlx5/hws: remove unused capabilities and fields

Message ID 20240314114220.203241-4-igozlan@nvidia.com (mailing list archive)
State Superseded
Delegated to: Raslan Darawsheh
Headers
Series [01/13] net/mlx5/hws: move warn into debug level when needed |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Itamar Gozlan March 14, 2024, 11:42 a.m. UTC
  From: Yevgeny Kliteynik <kliteyn@nvidia.com>

The following caps were never in use:
 - wire_regc
 - metadata_c
 - metadata_c_mask
Also send ring's reg_addr field wasn't in use.

Removing these caps and fields from structs and removing
the code that queried them.

Signed-off-by: Yevgeny Kliteynik <kliteyn@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 drivers/net/mlx5/hws/mlx5dr_cmd.c  | 11 ++---------
 drivers/net/mlx5/hws/mlx5dr_cmd.h  |  3 ---
 drivers/net/mlx5/hws/mlx5dr_send.c |  1 -
 drivers/net/mlx5/hws/mlx5dr_send.h |  1 -
 4 files changed, 2 insertions(+), 14 deletions(-)
  

Patch

diff --git a/drivers/net/mlx5/hws/mlx5dr_cmd.c b/drivers/net/mlx5/hws/mlx5dr_cmd.c
index 0e0cc479a6..666d678b42 100644
--- a/drivers/net/mlx5/hws/mlx5dr_cmd.c
+++ b/drivers/net/mlx5/hws/mlx5dr_cmd.c
@@ -1344,12 +1344,10 @@  int mlx5dr_cmd_query_caps(struct ibv_context *ctx,
 	strlcpy(caps->fw_ver, attr_ex.orig_attr.fw_ver, sizeof(caps->fw_ver));
 
 	port_info = flow_hw_get_wire_port(ctx);
-	if (port_info) {
-		caps->wire_regc = port_info->regc_value;
+	if (port_info)
 		caps->wire_regc_mask = port_info->regc_mask;
-	} else {
+	else
 		DR_LOG(INFO, "Failed to query wire port regc value");
-	}
 
 	return ret;
 }
@@ -1374,10 +1372,5 @@  int mlx5dr_cmd_query_ib_port(struct ibv_context *ctx,
 	vport_caps->vport_num = port_info.vport_id;
 	vport_caps->esw_owner_vhca_id = port_info.esw_owner_vhca_id;
 
-	if (port_info.query_flags & MLX5_PORT_QUERY_REG_C0) {
-		vport_caps->metadata_c = port_info.vport_meta_tag;
-		vport_caps->metadata_c_mask = port_info.vport_meta_mask;
-	}
-
 	return 0;
 }
diff --git a/drivers/net/mlx5/hws/mlx5dr_cmd.h b/drivers/net/mlx5/hws/mlx5dr_cmd.h
index 9d385fc57f..ea5d346d8e 100644
--- a/drivers/net/mlx5/hws/mlx5dr_cmd.h
+++ b/drivers/net/mlx5/hws/mlx5dr_cmd.h
@@ -194,8 +194,6 @@  struct mlx5dr_cmd_query_ft_caps {
 struct mlx5dr_cmd_query_vport_caps {
 	uint16_t vport_num;
 	uint16_t esw_owner_vhca_id;
-	uint32_t metadata_c;
-	uint32_t metadata_c_mask;
 };
 
 struct mlx5dr_cmd_generate_wqe_attr {
@@ -207,7 +205,6 @@  struct mlx5dr_cmd_generate_wqe_attr {
 };
 
 struct mlx5dr_cmd_query_caps {
-	uint32_t wire_regc;
 	uint32_t wire_regc_mask;
 	uint32_t flex_protocols;
 	uint8_t wqe_based_update;
diff --git a/drivers/net/mlx5/hws/mlx5dr_send.c b/drivers/net/mlx5/hws/mlx5dr_send.c
index f749401c6f..d58fdb108f 100644
--- a/drivers/net/mlx5/hws/mlx5dr_send.c
+++ b/drivers/net/mlx5/hws/mlx5dr_send.c
@@ -729,7 +729,6 @@  static int mlx5dr_send_ring_open_sq(struct mlx5dr_context *ctx,
 	buf_sz = queue->num_entries * MAX_WQES_PER_RULE;
 	sq_log_buf_sz = log2above(buf_sz);
 	sq_buf_sz = 1 << (sq_log_buf_sz + log2above(MLX5_SEND_WQE_BB));
-	sq->reg_addr = queue->uar->reg_addr;
 
 	page_size = sysconf(_SC_PAGESIZE);
 	buf_aligned = align(sq_buf_sz, page_size);
diff --git a/drivers/net/mlx5/hws/mlx5dr_send.h b/drivers/net/mlx5/hws/mlx5dr_send.h
index 0c89faa8a7..48593adbed 100644
--- a/drivers/net/mlx5/hws/mlx5dr_send.h
+++ b/drivers/net/mlx5/hws/mlx5dr_send.h
@@ -114,7 +114,6 @@  struct mlx5dr_send_ring_sq {
 	char *buf;
 	uint32_t sqn;
 	__be32 *db;
-	void *reg_addr;
 	uint16_t cur_post;
 	uint16_t buf_mask;
 	struct mlx5dr_send_ring_priv *wr_priv;