Skip to content

Commit

Permalink
RDMA/cma: Add support for AF_IB to cma_get_service_id()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Roland Dreier <[email protected]>
  • Loading branch information
shefty authored and rolandd committed Jun 20, 2013
1 parent f68194c commit 496ce3c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/infiniband/core/cma.c
Original file line number Diff line number Diff line change
Expand Up @@ -1379,6 +1379,9 @@ static int cma_req_handler(struct ib_cm_id *cm_id, struct ib_cm_event *ib_event)

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)));
}

Expand Down

0 comments on commit 496ce3c

Please sign in to comment.