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: [PATCH 5/7] IB/rdmavt: Add query gid support.
Date: Wed, 03 Feb 2016 14:15:11 -0800 [thread overview]
Message-ID: <20160203221508.1765.36622.stgit@scvm10.sc.intel.com> (raw)
In-Reply-To: <20160203221136.1765.8947.stgit-9QXIwq+3FY+1XWohqUldA0EOCMrvLtNR@public.gmane.org>
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-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
drivers/infiniband/sw/rdmavt/vt.c | 17 ++++++++++++++---
include/rdma/rdma_vt.h | 2 ++
2 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/drivers/infiniband/sw/rdmavt/vt.c b/drivers/infiniband/sw/rdmavt/vt.c
index 9f9cb9a..e017117 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 {
diff --git a/include/rdma/rdma_vt.h b/include/rdma/rdma_vt.h
index 5d1c694..dabf4d5 100644
--- a/include/rdma/rdma_vt.h
+++ b/include/rdma/rdma_vt.h
@@ -248,6 +248,8 @@ struct rvt_driver_provided {
u32 (*mtu_from_qp)(struct rvt_dev_info *rdi, struct rvt_qp *qp,
u32 pmtu);
int (*mtu_to_path_mtu)(u32 mtu);
+ int (*get_guid_be)(struct rvt_dev_info *rdi, struct rvt_ibport *rvp,
+ int guid_index, __be64 *guid);
/*--------------------*/
/* Optional functions */
--
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-02-03 22:15 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-03 22:14 [PATCH 0/7] IB/rdmavt: Finish adding core verbs support Dennis Dalessandro
[not found] ` <20160203221136.1765.8947.stgit-9QXIwq+3FY+1XWohqUldA0EOCMrvLtNR@public.gmane.org>
2016-02-03 22:14 ` [PATCH 1/7] IB/rdmavt: Add srq functionality to rdmavt Dennis Dalessandro
2016-02-03 22:14 ` [PATCH 2/7] IB/rdmavt: Add hardware driver send work request check Dennis Dalessandro
2016-02-03 22:14 ` [PATCH 3/7] IB/rdmavt: Add Mem affinity support Dennis Dalessandro
2016-02-03 22:15 ` [PATCH 4/7] IB/rdmavt: Clean up distinction between port number and index Dennis Dalessandro
2016-02-03 22:15 ` Dennis Dalessandro [this message]
2016-02-03 22:15 ` [PATCH 6/7] IB/rdmavt: Add support for query_port, modify_port and get_port_immutable Dennis Dalessandro
2016-02-03 22:15 ` [PATCH 7/7] IB/rdmavt: Properly pass gfp to hw driver function 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=20160203221508.1765.36622.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 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.