From: Dennis Dalessandro <dennis.dalessandro-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
To: dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Harish Chegondi
<harish.chegondi-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Subject: [RFC PATCH 20/27] IB/hfi1: Remove query_device function
Date: Sat, 09 Jan 2016 07:18:30 -0800 [thread overview]
Message-ID: <20160109151829.30800.64555.stgit@scvm10.sc.intel.com> (raw)
In-Reply-To: <20160109151020.30800.82395.stgit-9QXIwq+3FY+1XWohqUldA0EOCMrvLtNR@public.gmane.org>
From: Harish Chegondi <harish.chegondi-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Removed hfi1 query_device function to use rdmavt rvt_query_device function
The rvt dev info device attributes still need to be filled in by the driver
Reviewed-by: Dennis Dalessandro <dennis.dalessandro-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Signed-off-by: Harish Chegondi <harish.chegondi-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
drivers/staging/rdma/hfi1/verbs.c | 101 +++++++++++++++++--------------------
1 files changed, 47 insertions(+), 54 deletions(-)
diff --git a/drivers/staging/rdma/hfi1/verbs.c b/drivers/staging/rdma/hfi1/verbs.c
index 0bdc77d..8cd9a87 100644
--- a/drivers/staging/rdma/hfi1/verbs.c
+++ b/drivers/staging/rdma/hfi1/verbs.c
@@ -1373,55 +1373,49 @@ int hfi1_verbs_send(struct rvt_qp *qp, struct ahg_ib_header *ahdr,
return ret;
}
-static int query_device(struct ib_device *ibdev,
- struct ib_device_attr *props,
- struct ib_udata *uhw)
+/**
+ * hfi1_fill_device_attr - Fill in rvt dev info device attributes.
+ * @dd: the device data structure
+ */
+static void hfi1_fill_device_attr(struct hfi1_devdata *dd)
{
- struct hfi1_devdata *dd = dd_from_ibdev(ibdev);
- struct hfi1_ibdev *dev = to_idev(ibdev);
-
- if (uhw->inlen || uhw->outlen)
- return -EINVAL;
- memset(props, 0, sizeof(*props));
-
- props->device_cap_flags = IB_DEVICE_BAD_PKEY_CNTR |
- IB_DEVICE_BAD_QKEY_CNTR | IB_DEVICE_SHUTDOWN_PORT |
- IB_DEVICE_SYS_IMAGE_GUID | IB_DEVICE_RC_RNR_NAK_GEN |
- IB_DEVICE_PORT_ACTIVE_EVENT | IB_DEVICE_SRQ_RESIZE;
-
- props->page_size_cap = PAGE_SIZE;
- props->vendor_id =
- dd->oui1 << 16 | dd->oui2 << 8 | dd->oui3;
- props->vendor_part_id = dd->pcidev->device;
- props->hw_ver = dd->minrev;
- props->sys_image_guid = ib_hfi1_sys_image_guid;
- props->max_mr_size = ~0ULL;
- props->max_qp = hfi1_max_qps;
- props->max_qp_wr = hfi1_max_qp_wrs;
- props->max_sge = hfi1_max_sges;
- props->max_sge_rd = hfi1_max_sges;
- props->max_cq = hfi1_max_cqs;
- props->max_ah = hfi1_max_ahs;
- props->max_cqe = hfi1_max_cqes;
- props->max_mr = dev->rdi.lkey_table.max;
- props->max_fmr = dev->rdi.lkey_table.max;
- props->max_map_per_fmr = 32767;
- props->max_pd = dev->rdi.dparms.props.max_pd;
- props->max_qp_rd_atom = HFI1_MAX_RDMA_ATOMIC;
- props->max_qp_init_rd_atom = 255;
- /* props->max_res_rd_atom */
- props->max_srq = hfi1_max_srqs;
- props->max_srq_wr = hfi1_max_srq_wrs;
- props->max_srq_sge = hfi1_max_srq_sges;
- /* props->local_ca_ack_delay */
- props->atomic_cap = IB_ATOMIC_GLOB;
- props->max_pkeys = hfi1_get_npkeys(dd);
- props->max_mcast_grp = hfi1_max_mcast_grps;
- props->max_mcast_qp_attach = hfi1_max_mcast_qp_attached;
- props->max_total_mcast_qp_attach = props->max_mcast_qp_attach *
- props->max_mcast_grp;
-
- return 0;
+ struct rvt_dev_info *rdi = &dd->verbs_dev.rdi;
+
+ memset(&rdi->dparms.props, 0, sizeof(rdi->dparms.props));
+
+ rdi->dparms.props.device_cap_flags = IB_DEVICE_BAD_PKEY_CNTR |
+ IB_DEVICE_BAD_QKEY_CNTR | IB_DEVICE_SHUTDOWN_PORT |
+ IB_DEVICE_SYS_IMAGE_GUID | IB_DEVICE_RC_RNR_NAK_GEN |
+ IB_DEVICE_PORT_ACTIVE_EVENT | IB_DEVICE_SRQ_RESIZE;
+ rdi->dparms.props.page_size_cap = PAGE_SIZE;
+ rdi->dparms.props.vendor_id = dd->oui1 << 16 | dd->oui2 << 8 | dd->oui3;
+ rdi->dparms.props.vendor_part_id = dd->pcidev->device;
+ rdi->dparms.props.hw_ver = dd->minrev;
+ rdi->dparms.props.sys_image_guid = ib_hfi1_sys_image_guid;
+ rdi->dparms.props.max_mr_size = ~0ULL;
+ rdi->dparms.props.max_qp = hfi1_max_qps;
+ rdi->dparms.props.max_qp_wr = hfi1_max_qp_wrs;
+ rdi->dparms.props.max_sge = hfi1_max_sges;
+ rdi->dparms.props.max_sge_rd = hfi1_max_sges;
+ rdi->dparms.props.max_cq = hfi1_max_cqs;
+ rdi->dparms.props.max_ah = hfi1_max_ahs;
+ rdi->dparms.props.max_cqe = hfi1_max_cqes;
+ rdi->dparms.props.max_mr = rdi->lkey_table.max;
+ rdi->dparms.props.max_fmr = rdi->lkey_table.max;
+ rdi->dparms.props.max_map_per_fmr = 32767;
+ rdi->dparms.props.max_pd = hfi1_max_pds;
+ rdi->dparms.props.max_qp_rd_atom = HFI1_MAX_RDMA_ATOMIC;
+ rdi->dparms.props.max_qp_init_rd_atom = 255;
+ rdi->dparms.props.max_srq = hfi1_max_srqs;
+ rdi->dparms.props.max_srq_wr = hfi1_max_srq_wrs;
+ rdi->dparms.props.max_srq_sge = hfi1_max_srq_sges;
+ rdi->dparms.props.atomic_cap = IB_ATOMIC_GLOB;
+ rdi->dparms.props.max_pkeys = hfi1_get_npkeys(dd);
+ rdi->dparms.props.max_mcast_grp = hfi1_max_mcast_grps;
+ rdi->dparms.props.max_mcast_qp_attach = hfi1_max_mcast_qp_attached;
+ rdi->dparms.props.max_total_mcast_qp_attach =
+ rdi->dparms.props.max_mcast_qp_attach *
+ rdi->dparms.props.max_mcast_grp;
}
static inline u16 opa_speed_to_ib(u16 in)
@@ -1808,7 +1802,7 @@ int hfi1_register_ib_device(struct hfi1_devdata *dd)
ibdev->phys_port_cnt = dd->num_pports;
ibdev->num_comp_vectors = 1;
ibdev->dma_device = &dd->pcidev->dev;
- ibdev->query_device = query_device;
+ ibdev->query_device = NULL;
ibdev->modify_device = modify_device;
ibdev->query_port = query_port;
ibdev->modify_port = modify_port;
@@ -1865,13 +1859,12 @@ int hfi1_register_ib_device(struct hfi1_devdata *dd)
dd->verbs_dev.rdi.driver_f.get_pci_dev = get_pci_dev;
dd->verbs_dev.rdi.driver_f.check_ah = hfi1_check_ah;
dd->verbs_dev.rdi.driver_f.notify_new_ah = hfi1_notify_new_ah;
- dd->verbs_dev.rdi.dparms.props.max_ah = hfi1_max_ahs;
- dd->verbs_dev.rdi.dparms.props.max_pd = hfi1_max_pds;
- dd->verbs_dev.rdi.dparms.props.max_sge = hfi1_max_sges;
+ /*
+ * Fill in rvt info device attributes.
+ */
+ hfi1_fill_device_attr(dd);
/* queue pair */
- dd->verbs_dev.rdi.dparms.props.max_qp = hfi1_max_qps;
- dd->verbs_dev.rdi.dparms.props.max_qp_wr = hfi1_max_qp_wrs;
dd->verbs_dev.rdi.dparms.qp_table_size = hfi1_qp_table_size;
dd->verbs_dev.rdi.dparms.qpn_start = 0;
dd->verbs_dev.rdi.dparms.qpn_inc = 1;
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2016-01-09 15:18 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-09 15:16 [RFC PATCH 00/27] IB/hfi1: Add rdmavt support to hfi1 Dennis Dalessandro
[not found] ` <20160109151020.30800.82395.stgit-9QXIwq+3FY+1XWohqUldA0EOCMrvLtNR@public.gmane.org>
2016-01-09 15:16 ` [RFC PATCH 01/27] IB/hfi1: Begin to use rdmavt for verbs Dennis Dalessandro
2016-01-09 15:16 ` [RFC PATCH 02/27] IB/hfi1: Add basic rdmavt capability flags for hfi1 Dennis Dalessandro
2016-01-09 15:16 ` [RFC PATCH 03/27] IB/hfi1: Consolidate dma ops " Dennis Dalessandro
2016-01-09 15:17 ` [RFC PATCH 04/27] IB/hfi1: Use rdmavt protection domain Dennis Dalessandro
2016-01-09 15:17 ` [RFC PATCH 05/27] IB/hfi1: Remove MR data structures from hfi1 Dennis Dalessandro
2016-01-09 15:17 ` [RFC PATCH 06/27] IB/hfi1: Remove driver specific members from hfi1 qp type Dennis Dalessandro
2016-01-09 15:17 ` [RFC PATCH 07/27] IB/hfi1: Add device specific info prints Dennis Dalessandro
2016-01-09 15:17 ` [RFC PATCH 08/27] IB/hfi1: Use correct rdmavt header files after move Dennis Dalessandro
2016-01-09 15:17 ` [RFC PATCH 09/27] IB/hfi1: Use address handle in rdmavt and remove from hfi1 Dennis Dalessandro
2016-01-09 15:17 ` [RFC PATCH 10/27] IB/hfi1: Implement hfi1 support for AH notification Dennis Dalessandro
2016-01-09 15:17 ` [RFC PATCH 11/27] IB/hfi1: Remove hfi1 MR and hfi1 specific qp type Dennis Dalessandro
2016-01-09 15:17 ` [RFC PATCH 12/27] IB/hfi1: Remove srq from hfi1 Dennis Dalessandro
2016-01-09 15:17 ` [RFC PATCH 13/27] IB/hfi1: Remove ibport and use rdmavt version Dennis Dalessandro
2016-01-09 15:17 ` [RFC PATCH 14/27] IB/hfi1: Remove mmap from hfi1 Dennis Dalessandro
2016-01-09 15:18 ` [RFC PATCH 15/27] IB/hfi1: Use rdmavt pkey verbs function Dennis Dalessandro
2016-01-09 15:18 ` [RFC PATCH 16/27] IB/hfi1: Remove user context allocation and de-alloction functions Dennis Dalessandro
2016-01-09 15:18 ` [RFC PATCH 17/27] IB/hfi1: Use rdmavt send flags and recv flags Dennis Dalessandro
2016-01-09 15:18 ` [RFC PATCH 18/27] IB/hfi1: Remove qpdev and qpn table from hfi1 Dennis Dalessandro
2016-01-09 15:18 ` [RFC PATCH 19/27] IB/hfi1: Remove create_qp functionality Dennis Dalessandro
2016-01-09 15:18 ` Dennis Dalessandro [this message]
2016-01-09 15:18 ` [RFC PATCH 21/27] IB/hfi1: Remove CQ data structures and functions from hfi1 Dennis Dalessandro
2016-01-09 15:18 ` [RFC PATCH 22/27] IB/hfi1: Use rdmavt version of post_send Dennis Dalessandro
2016-01-09 15:18 ` [RFC PATCH 23/27] IB/hfi1: Remove modify queue pair from hfi1 Dennis Dalessandro
2016-01-09 15:18 ` [RFC PATCH 24/27] IB/hfi1: Remove destroy qp verb Dennis Dalessandro
2016-01-09 15:18 ` [RFC PATCH 25/27] IB/hfi1: Remove post_recv and use rdmavt version Dennis Dalessandro
2016-01-09 15:19 ` [RFC PATCH 26/27] IB/hfi1: Remove multicast verbs functions Dennis Dalessandro
2016-01-09 15:19 ` [RFC PATCH 27/27] IB/hfi1: Clean up register device Dennis Dalessandro
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=20160109151829.30800.64555.stgit@scvm10.sc.intel.com \
--to=dennis.dalessandro-ral2jqcrhueavxtiumwx3w@public.gmane.org \
--cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=harish.chegondi-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
/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).