aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/core/ucma.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/infiniband/core/ucma.c')
-rw-r--r--drivers/infiniband/core/ucma.c22
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
639static 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
639static ssize_t ucma_query_route(struct ucma_file *file, 649static 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
686out: 704out: