All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: <linux-rdma@vger.kernel.org>, Bob Pearson <rpearsonhpe@gmail.com>
Subject: [PATCH 8/9] verbs: Remove dead code
Date: Mon, 16 Nov 2020 16:23:09 -0400	[thread overview]
Message-ID: <8-v1-34e141ddf17e+89-query_device_ex_jgg@nvidia.com> (raw)
In-Reply-To: <0-v1-34e141ddf17e+89-query_device_ex_jgg@nvidia.com>

Remove the old query_device support code, it is now replaced by
ibv_cmd_query_device_any()

Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
---
 libibverbs/cmd.c             | 99 ------------------------------------
 libibverbs/driver.h          |  8 ---
 libibverbs/libibverbs.map.in |  1 -
 3 files changed, 108 deletions(-)

diff --git a/libibverbs/cmd.c b/libibverbs/cmd.c
index a439f8c06481dd..ec9750e7c04eb4 100644
--- a/libibverbs/cmd.c
+++ b/libibverbs/cmd.c
@@ -44,7 +44,6 @@
 #include <infiniband/cmd_write.h>
 #include "ibverbs.h"
 #include <ccan/minmax.h>
-#include <util/util.h>
 
 bool verbs_allow_disassociate_destroy;
 
@@ -113,104 +112,6 @@ int ibv_cmd_query_device(struct ibv_context *context,
 	return 0;
 }
 
-int ibv_cmd_query_device_ex(struct ibv_context *context,
-			    const struct ibv_query_device_ex_input *input,
-			    struct ibv_device_attr_ex *attr, size_t attr_size,
-			    uint64_t *raw_fw_ver,
-			    struct ibv_query_device_ex *cmd,
-			    size_t cmd_size,
-			    struct ib_uverbs_ex_query_device_resp *resp,
-			    size_t resp_size)
-{
-	int err;
-
-	if (input && input->comp_mask)
-		return EINVAL;
-
-	if (attr_size < offsetof(struct ibv_device_attr_ex, comp_mask) +
-			sizeof(attr->comp_mask))
-		return EINVAL;
-
-	cmd->comp_mask = 0;
-	cmd->reserved = 0;
-	memset(attr->orig_attr.fw_ver, 0, sizeof(attr->orig_attr.fw_ver));
-	memset(&attr->comp_mask, 0, attr_size - sizeof(attr->orig_attr));
-
-	err = execute_cmd_write_ex(context, IB_USER_VERBS_EX_CMD_QUERY_DEVICE,
-				   cmd, cmd_size, resp, resp_size);
-	if (err)
-		return err;
-
-	copy_query_dev_fields(&attr->orig_attr, &resp->base, raw_fw_ver);
-	/* Report back supported comp_mask bits. For now no comp_mask bit is
-	 * defined */
-	attr->comp_mask = resp->comp_mask & 0;
-
-#define CAN_COPY(_ibv_attr, _uverbs_attr)                                      \
-	(attr_size >= offsetofend(struct ibv_device_attr_ex, _ibv_attr) &&     \
-	 resp->response_length >=                                              \
-		 offsetofend(struct ib_uverbs_ex_query_device_resp,            \
-			     _uverbs_attr))
-
-	if (CAN_COPY(odp_caps, odp_caps)) {
-		attr->odp_caps.general_caps = resp->odp_caps.general_caps;
-		attr->odp_caps.per_transport_caps.rc_odp_caps =
-			resp->odp_caps.per_transport_caps.rc_odp_caps;
-		attr->odp_caps.per_transport_caps.uc_odp_caps =
-			resp->odp_caps.per_transport_caps.uc_odp_caps;
-		attr->odp_caps.per_transport_caps.ud_odp_caps =
-			resp->odp_caps.per_transport_caps.ud_odp_caps;
-	}
-
-	if (CAN_COPY(completion_timestamp_mask, timestamp_mask))
-		attr->completion_timestamp_mask = resp->timestamp_mask;
-
-	if (CAN_COPY(hca_core_clock, hca_core_clock))
-		attr->hca_core_clock = resp->hca_core_clock;
-
-	if (CAN_COPY(device_cap_flags_ex, device_cap_flags_ex))
-		attr->device_cap_flags_ex = resp->device_cap_flags_ex;
-
-	if (CAN_COPY(rss_caps, rss_caps)) {
-		attr->rss_caps.supported_qpts = resp->rss_caps.supported_qpts;
-		attr->rss_caps.max_rwq_indirection_tables =
-			resp->rss_caps.max_rwq_indirection_tables;
-		attr->rss_caps.max_rwq_indirection_table_size =
-			resp->rss_caps.max_rwq_indirection_table_size;
-	}
-
-	if (CAN_COPY(max_wq_type_rq, max_wq_type_rq))
-		attr->max_wq_type_rq = resp->max_wq_type_rq;
-
-	if (CAN_COPY(raw_packet_caps, raw_packet_caps))
-		attr->raw_packet_caps = resp->raw_packet_caps;
-
-	if (CAN_COPY(tm_caps, tm_caps)) {
-		attr->tm_caps.max_rndv_hdr_size =
-			resp->tm_caps.max_rndv_hdr_size;
-		attr->tm_caps.max_num_tags = resp->tm_caps.max_num_tags;
-		attr->tm_caps.flags = resp->tm_caps.flags;
-		attr->tm_caps.max_ops = resp->tm_caps.max_ops;
-		attr->tm_caps.max_sge = resp->tm_caps.max_sge;
-	}
-
-	if (CAN_COPY(cq_mod_caps, cq_moderation_caps)) {
-		attr->cq_mod_caps.max_cq_count =
-			resp->cq_moderation_caps.max_cq_moderation_count;
-		attr->cq_mod_caps.max_cq_period =
-			resp->cq_moderation_caps.max_cq_moderation_period;
-	}
-
-	if (CAN_COPY(max_dm_size, max_dm_size))
-		attr->max_dm_size = resp->max_dm_size;
-
-	if (CAN_COPY(xrc_odp_caps, xrc_odp_caps))
-		attr->xrc_odp_caps = resp->xrc_odp_caps;
-#undef CAN_COPY
-
-	return 0;
-}
-
 int ibv_cmd_alloc_pd(struct ibv_context *context, struct ibv_pd *pd,
 		     struct ibv_alloc_pd *cmd, size_t cmd_size,
 		     struct ib_uverbs_alloc_pd_resp *resp, size_t resp_size)
diff --git a/libibverbs/driver.h b/libibverbs/driver.h
index e54db0ea6413e8..33998e227c98ec 100644
--- a/libibverbs/driver.h
+++ b/libibverbs/driver.h
@@ -465,14 +465,6 @@ int ibv_cmd_query_device_any(struct ibv_context *context,
 			     struct ibv_device_attr_ex *attr, size_t attr_size,
 			     struct ib_uverbs_ex_query_device_resp *resp,
 			     size_t *resp_size);
-int ibv_cmd_query_device_ex(struct ibv_context *context,
-			    const struct ibv_query_device_ex_input *input,
-			    struct ibv_device_attr_ex *attr, size_t attr_size,
-			    uint64_t *raw_fw_ver,
-			    struct ibv_query_device_ex *cmd,
-			    size_t cmd_size,
-			    struct ib_uverbs_ex_query_device_resp *resp,
-			    size_t resp_size);
 int ibv_cmd_query_port(struct ibv_context *context, uint8_t port_num,
 		       struct ibv_port_attr *port_attr,
 		       struct ibv_query_port *cmd, size_t cmd_size);
diff --git a/libibverbs/libibverbs.map.in b/libibverbs/libibverbs.map.in
index c1f7e09b240ab0..672717a6fa551e 100644
--- a/libibverbs/libibverbs.map.in
+++ b/libibverbs/libibverbs.map.in
@@ -205,7 +205,6 @@ IBVERBS_PRIVATE_@IBVERBS_PABI_VERSION@ {
 		ibv_cmd_query_context;
 		ibv_cmd_query_device;
 		ibv_cmd_query_device_any;
-		ibv_cmd_query_device_ex;
 		ibv_cmd_query_mr;
 		ibv_cmd_query_port;
 		ibv_cmd_query_qp;
-- 
2.29.2


  parent reply	other threads:[~2020-11-16 20:23 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-16 20:23 [PATCH 0/9] Simplify query_device() in libibverbs Jason Gunthorpe
2020-11-16 20:23 ` [PATCH 1/9] verbs: Simplify query_device_ex Jason Gunthorpe
2020-11-16 20:23 ` [PATCH 2/9] verbs: Add ibv_cmd_query_device_any() Jason Gunthorpe
2020-11-18 12:43   ` Gal Pressman
2020-11-18 12:45     ` Jason Gunthorpe
2020-11-16 20:23 ` [PATCH 3/9] mlx5: Move context initialization out of mlx5_query_device_ex() Jason Gunthorpe
2020-11-17 17:24   ` Yishai Hadas
2020-11-17 19:08     ` Jason Gunthorpe
2020-11-16 20:23 ` [PATCH 4/9] efa: Move the context intialization out of efa_query_device_ex() Jason Gunthorpe
2020-11-18  7:39   ` Gal Pressman
2020-11-18  8:07   ` Gal Pressman
2020-11-18 12:45   ` Gal Pressman
2020-11-18 20:59     ` Jason Gunthorpe
2020-11-16 20:23 ` [PATCH 5/9] mlx4: Move the context intialization out of mlx4_query_device_ex() Jason Gunthorpe
2020-11-16 20:23 ` [PATCH 6/9] providers: Remove normal query_device() from providers that have _ex Jason Gunthorpe
2020-11-18 12:47   ` Gal Pressman
2020-11-16 20:23 ` [PATCH 7/9] providers: Convert all providers to implement query_device_ex Jason Gunthorpe
2020-11-16 20:23 ` Jason Gunthorpe [this message]
2020-11-18 12:46   ` [PATCH 8/9] verbs: Remove dead code Gal Pressman
2020-11-18 12:53     ` Jason Gunthorpe
2020-11-16 20:23 ` [PATCH 9/9] verbs: Delete query_device() internal support Jason Gunthorpe

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=8-v1-34e141ddf17e+89-query_device_ex_jgg@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=rpearsonhpe@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.