From: Sean Hefty Date: Wed, 7 Apr 2010 00:22:33 +0000 (-0700) Subject: rdma/cm: add support for AF_IB to cma_get_service_id X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=a39f80e238bbf15eafc1846b862c67de2ad50e97;p=~shefty%2Frdma-dev.git rdma/cm: 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 --- diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c index 922b92b83ae..0b06b113654 100644 --- a/drivers/infiniband/core/cma.c +++ b/drivers/infiniband/core/cma.c @@ -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))); }