summaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw
diff options
context:
space:
mode:
authorDennis Dalessandro <dennis.dalessandro@intel.com>2016-02-03 14:20:44 -0800
committerDoug Ledford <dledford@redhat.com>2016-03-10 20:37:34 -0500
commit2366754632d3e52a97bf607a22bcca592a46f3f9 (patch)
tree948f5a1a851dd622d50dbce647a4041be2ce72e0 /drivers/infiniband/hw
parent8e4c066634aa35e7da08981439f4f1b6693fd9fb (diff)
downloadblackbird-op-linux-2366754632d3e52a97bf607a22bcca592a46f3f9.tar.gz
blackbird-op-linux-2366754632d3e52a97bf607a22bcca592a46f3f9.zip
IB/qib: Support query gid in rdmavt
Query gid is in rdmavt, but still relies on the driver to maintain the guid table. Add the necessary driver call back and remove the existing verb handler. Reviewed-by: Harish Chegondi <harish.chegondi@intel.com> Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/hw')
-rw-r--r--drivers/infiniband/hw/qib/qib_verbs.c32
1 files changed, 12 insertions, 20 deletions
diff --git a/drivers/infiniband/hw/qib/qib_verbs.c b/drivers/infiniband/hw/qib/qib_verbs.c
index e534355c37db..a3a13a52876d 100644
--- a/drivers/infiniband/hw/qib/qib_verbs.c
+++ b/drivers/infiniband/hw/qib/qib_verbs.c
@@ -1421,28 +1421,20 @@ static int qib_modify_port(struct ib_device *ibdev, u8 port,
return 0;
}
-static int qib_query_gid(struct ib_device *ibdev, u8 port,
- int index, union ib_gid *gid)
+static int qib_get_guid_be(struct rvt_dev_info *rdi, struct rvt_ibport *rvp,
+ int guid_index, __be64 *guid)
{
- struct qib_devdata *dd = dd_from_ibdev(ibdev);
- int ret = 0;
-
- if (!port || port > dd->num_pports)
- ret = -EINVAL;
- else {
- struct qib_ibport *ibp = to_iport(ibdev, port);
- struct qib_pportdata *ppd = ppd_from_ibp(ibp);
+ struct qib_ibport *ibp = container_of(rvp, struct qib_ibport, rvp);
+ struct qib_pportdata *ppd = ppd_from_ibp(ibp);
- gid->global.subnet_prefix = ibp->rvp.gid_prefix;
- if (index == 0)
- gid->global.interface_id = ppd->guid;
- else if (index < QIB_GUIDS_PER_PORT)
- gid->global.interface_id = ibp->guids[index - 1];
- else
- ret = -EINVAL;
- }
+ if (guid_index == 0)
+ *guid = ppd->guid;
+ else if (guid_index < QIB_GUIDS_PER_PORT)
+ *guid = ibp->guids[guid_index - 1];
+ else
+ return -EINVAL;
- return ret;
+ return 0;
}
int qib_check_ah(struct ib_device *ibdev, struct ib_ah_attr *ah_attr)
@@ -1696,7 +1688,6 @@ int qib_register_ib_device(struct qib_devdata *dd)
ibdev->modify_device = qib_modify_device;
ibdev->query_port = qib_query_port;
ibdev->modify_port = qib_modify_port;
- ibdev->query_gid = qib_query_gid;
ibdev->process_mad = qib_process_mad;
ibdev->get_port_immutable = qib_port_immutable;
@@ -1727,6 +1718,7 @@ int qib_register_ib_device(struct qib_devdata *dd)
dd->verbs_dev.rdi.driver_f.get_pmtu_from_attr = get_pmtu_from_attr;
dd->verbs_dev.rdi.dparms.max_rdma_atomic = QIB_MAX_RDMA_ATOMIC;
+ dd->verbs_dev.rdi.driver_f.get_guid_be = qib_get_guid_be;
dd->verbs_dev.rdi.dparms.lkey_table_size = qib_lkey_table_size;
dd->verbs_dev.rdi.dparms.qp_table_size = ib_qib_qp_table_size;
dd->verbs_dev.rdi.dparms.qpn_start = 1;
OpenPOWER on IntegriCloud