RDMA/cma: Add support for AF_IB to cma_get_service_id()
authorSean Hefty <sean.hefty@intel.com>
Wed, 29 May 2013 17:09:19 +0000 (10:09 -0700)
committerRoland Dreier <roland@purestorage.com>
Thu, 20 Jun 2013 20:08:05 +0000 (13:08 -0700)
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>
drivers/infiniband/core/cma.c

index 66cb043ddd49d8b3389505ede540302cc8777367..f1dd0ca34d833f971065a1f348cc03c99790b31a 100644 (file)
@@ -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)));
 }