aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorSean Hefty <sean.hefty@intel.com>2011-05-23 20:52:46 -0400
committerRoland Dreier <roland@purestorage.com>2011-10-12 13:32:26 -0400
commit59991f94eb32e954aa767f659eb642461e9e8b37 (patch)
treedd107c1ce5faf54a4561b7e5349eed102741772b /drivers/infiniband
parent976d167615b64e14bc1491ca51d424e2ba9a5e84 (diff)
RDMA/core: Add XRC domain support
XRC ("eXtended reliable connected") is an IB transport that provides better scalability by allowing senders to specify which shared receive queue (SRQ) should be used to receive a message, which essentially allows one transport context (QP connection) to serve multiple destinations (as long as they share an adapter, of course). A few new concepts are introduced to support this. This patch adds: - A new device capability flag, IB_DEVICE_XRC, which low-level drivers set to indicate that a device supports XRC. - A new object type, XRC domains (struct ib_xrcd), and new verbs ib_alloc_xrcd()/ib_dealloc_xrcd(). XRCDs are used to limit which XRC SRQs an incoming message can target. This patch is derived from work by Jack Morgenstein <jackm@dev.mellanox.co.il>. Signed-off-by: Sean Hefty <sean.hefty@intel.com> Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/core/verbs.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/drivers/infiniband/core/verbs.c b/drivers/infiniband/core/verbs.c
index af7a8b08b2e9..5e03ab78fc8e 100644
--- a/drivers/infiniband/core/verbs.c
+++ b/drivers/infiniband/core/verbs.c
@@ -920,3 +920,29 @@ int ib_detach_mcast(struct ib_qp *qp, union ib_gid *gid, u16 lid)
920 return qp->device->detach_mcast(qp, gid, lid); 920 return qp->device->detach_mcast(qp, gid, lid);
921} 921}
922EXPORT_SYMBOL(ib_detach_mcast); 922EXPORT_SYMBOL(ib_detach_mcast);
923
924struct ib_xrcd *ib_alloc_xrcd(struct ib_device *device)
925{
926 struct ib_xrcd *xrcd;
927
928 if (!device->alloc_xrcd)
929 return ERR_PTR(-ENOSYS);
930
931 xrcd = device->alloc_xrcd(device, NULL, NULL);
932 if (!IS_ERR(xrcd)) {
933 xrcd->device = device;
934 atomic_set(&xrcd->usecnt, 0);
935 }
936
937 return xrcd;
938}
939EXPORT_SYMBOL(ib_alloc_xrcd);
940
941int ib_dealloc_xrcd(struct ib_xrcd *xrcd)
942{
943 if (atomic_read(&xrcd->usecnt))
944 return -EBUSY;
945
946 return xrcd->device->dealloc_xrcd(xrcd);
947}
948EXPORT_SYMBOL(ib_dealloc_xrcd);