diff options
author | Steve Wise <swise@opengridcomputing.com> | 2011-01-20 22:40:46 -0500 |
---|---|---|
committer | Roland Dreier <roland@purestorage.com> | 2011-01-28 19:34:05 -0500 |
commit | e86f8b06f5fa884a84c22b2dcd0df37ed0a75827 (patch) | |
tree | 4aaf6a46755752417f6eff901dcaf5afe0fbec15 /drivers/infiniband/core | |
parent | a25cecce88194b2edf38b8c3b1665e9318eb2d22 (diff) |
RDMA/ucma: Copy iWARP route information on queries
For iWARP rdma_cm ids, the "route" information is the L2 src and
next hop addresses.
Signed-off-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband/core')
-rw-r--r-- | drivers/infiniband/core/ucma.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/drivers/infiniband/core/ucma.c b/drivers/infiniband/core/ucma.c index ca12acf38379..ec1e9da1488b 100644 --- a/drivers/infiniband/core/ucma.c +++ b/drivers/infiniband/core/ucma.c | |||
@@ -636,6 +636,16 @@ static void ucma_copy_iboe_route(struct rdma_ucm_query_route_resp *resp, | |||
636 | } | 636 | } |
637 | } | 637 | } |
638 | 638 | ||
639 | static void ucma_copy_iw_route(struct rdma_ucm_query_route_resp *resp, | ||
640 | struct rdma_route *route) | ||
641 | { | ||
642 | struct rdma_dev_addr *dev_addr; | ||
643 | |||
644 | dev_addr = &route->addr.dev_addr; | ||
645 | rdma_addr_get_dgid(dev_addr, (union ib_gid *) &resp->ib_route[0].dgid); | ||
646 | rdma_addr_get_sgid(dev_addr, (union ib_gid *) &resp->ib_route[0].sgid); | ||
647 | } | ||
648 | |||
639 | static ssize_t ucma_query_route(struct ucma_file *file, | 649 | static ssize_t ucma_query_route(struct ucma_file *file, |
640 | const char __user *inbuf, | 650 | const char __user *inbuf, |
641 | int in_len, int out_len) | 651 | int in_len, int out_len) |
@@ -670,8 +680,10 @@ static ssize_t ucma_query_route(struct ucma_file *file, | |||
670 | 680 | ||
671 | resp.node_guid = (__force __u64) ctx->cm_id->device->node_guid; | 681 | resp.node_guid = (__force __u64) ctx->cm_id->device->node_guid; |
672 | resp.port_num = ctx->cm_id->port_num; | 682 | resp.port_num = ctx->cm_id->port_num; |
673 | if (rdma_node_get_transport(ctx->cm_id->device->node_type) == RDMA_TRANSPORT_IB) { | 683 | switch (rdma_node_get_transport(ctx->cm_id->device->node_type)) { |
674 | switch (rdma_port_get_link_layer(ctx->cm_id->device, ctx->cm_id->port_num)) { | 684 | case RDMA_TRANSPORT_IB: |
685 | switch (rdma_port_get_link_layer(ctx->cm_id->device, | ||
686 | ctx->cm_id->port_num)) { | ||
675 | case IB_LINK_LAYER_INFINIBAND: | 687 | case IB_LINK_LAYER_INFINIBAND: |
676 | ucma_copy_ib_route(&resp, &ctx->cm_id->route); | 688 | ucma_copy_ib_route(&resp, &ctx->cm_id->route); |
677 | break; | 689 | break; |
@@ -681,6 +693,12 @@ static ssize_t ucma_query_route(struct ucma_file *file, | |||
681 | default: | 693 | default: |
682 | break; | 694 | break; |
683 | } | 695 | } |
696 | break; | ||
697 | case RDMA_TRANSPORT_IWARP: | ||
698 | ucma_copy_iw_route(&resp, &ctx->cm_id->route); | ||
699 | break; | ||
700 | default: | ||
701 | break; | ||
684 | } | 702 | } |
685 | 703 | ||
686 | out: | 704 | out: |