aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/core/cma.c
diff options
context:
space:
mode:
authorSean Hefty <sean.hefty@intel.com>2013-05-29 10:09:19 -0700
committerRoland Dreier <roland@purestorage.com>2013-06-20 13:08:05 -0700
commit496ce3ce17f4b4f1b5f6edf9d2aedc4787a31c2f (patch)
tree674f11dcba2f7ee8bdf2c2531c7e80656441b7f3 /drivers/infiniband/core/cma.c
parentRDMA/cma: Add support for AF_IB to rdma_resolve_route() (diff)
downloadlinux-dev-496ce3ce17f4b4f1b5f6edf9d2aedc4787a31c2f.tar.xz
linux-dev-496ce3ce17f4b4f1b5f6edf9d2aedc4787a31c2f.zip
RDMA/cma: Add support for AF_IB to cma_get_service_id()
cma_get_service_id() forms the service ID based on the port space and port number of the rdma_cm_id. Extend the call to support AF_IB, which contains the service ID directly. This will be needed to support any arbitrary SID. Signed-off-by: Sean Hefty <sean.hefty@intel.com> Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband/core/cma.c')
-rw-r--r--drivers/infiniband/core/cma.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c
index 66cb043ddd49..f1dd0ca34d83 100644
--- a/drivers/infiniband/core/cma.c
+++ b/drivers/infiniband/core/cma.c
@@ -1379,6 +1379,9 @@ err1:
static __be64 cma_get_service_id(enum rdma_port_space ps, struct sockaddr *addr)
{
+ if (addr->sa_family == AF_IB)
+ return ((struct sockaddr_ib *) addr)->sib_sid;
+
return cpu_to_be64(((u64)ps << 16) + be16_to_cpu(cma_port(addr)));
}