diff options
author | Dennis Dalessandro <dennis.dalessandro@intel.com> | 2016-02-04 01:15:11 +0300 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2016-03-11 04:37:32 +0300 |
commit | 1f024992ef05d1eb9b3a0becd1611ecfa21854a6 (patch) | |
tree | 74c5dcc992c00e471ee3c5298b503d834b9d40be /drivers/infiniband/sw | |
parent | f1badc716349cc2ac6e55ad50dcff598ef97bad5 (diff) | |
download | linux-1f024992ef05d1eb9b3a0becd1611ecfa21854a6.tar.xz |
IB/rdmavt: Add query gid support.
Addin query gid support. Rdmavt still relies on the driver to maintain
the gid table. Rdmavt simply calls into the driver to retrive the guid
for a particular port.
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/sw')
-rw-r--r-- | drivers/infiniband/sw/rdmavt/vt.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/drivers/infiniband/sw/rdmavt/vt.c b/drivers/infiniband/sw/rdmavt/vt.c index 9f9cb9ab170b..e017117586af 100644 --- a/drivers/infiniband/sw/rdmavt/vt.c +++ b/drivers/infiniband/sw/rdmavt/vt.c @@ -210,17 +210,28 @@ static int rvt_query_pkey(struct ib_device *ibdev, u8 port_num, u16 index, * Returns 0 on success */ static int rvt_query_gid(struct ib_device *ibdev, u8 port_num, - int index, union ib_gid *gid) + int guid_index, union ib_gid *gid) { + struct rvt_dev_info *rdi; + struct rvt_ibport *rvp; + int port_index; + /* * Driver is responsible for updating the guid table. Which will be used * to craft the return value. This will work similar to how query_pkey() * is being done. */ - if (ibport_num_to_idx(ibdev, port_num) < 0) + port_index = ibport_num_to_idx(ibdev, port_num); + if (port_index < 0) return -EINVAL; - return -EOPNOTSUPP; + rdi = ib_to_rvt(ibdev); + rvp = rdi->ports[port_index]; + + gid->global.subnet_prefix = rvp->gid_prefix; + + return rdi->driver_f.get_guid_be(rdi, rvp, guid_index, + &gid->global.interface_id); } struct rvt_ucontext { |