]> git.openfabrics.org - ~shefty/rdma-dev.git/commitdiff
rdma/cm: add support for AF_IB to cma_get_service_id
authorSean Hefty <sean.hefty@intel.com>
Wed, 7 Apr 2010 00:22:33 +0000 (17:22 -0700)
committerSean Hefty <sean.hefty@intel.com>
Thu, 13 May 2010 01:05:38 +0000 (18:05 -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>
drivers/infiniband/core/cma.c

index 922b92b83ae9cd1062f1fb7dec6582d43db82c89..0b06b11365458e70cff0445c29ae8cddab333504 100644 (file)
@@ -1265,6 +1265,9 @@ out:
 
 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)));
 }