]> git.openfabrics.org - ~shefty/rdma-win.git/commitdiff
[IPoIB] Avoid the SM (3/4)
authorleonidk <leonidk@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Wed, 24 Sep 2008 19:25:07 +0000 (19:25 +0000)
committerleonidk <leonidk@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Wed, 24 Sep 2008 19:25:07 +0000 (19:25 +0000)
This patch changes the NetworkDirect CM proxy to take a path as input for the REQ IOCTL rather than a GID pair.  The IOCTL handler checks if the DLID in the path is zero and if so performs a path query using the SGID and DGID from the path (same code path as it used to take when the IOCTL provided a GID pair.)

Signed-off-by: Fab Tillier <ftillier@microsoft.com>
git-svn-id: svn://openib.tc.cornell.edu/gen1@1612 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

branches/WOF2-0/trunk/core/al/al_dev.h
branches/WOF2-0/trunk/core/al/kernel/al_ndi_cm.c
branches/WOF2-0/trunk/inc/iba/ib_al_ioctl.h

index ea3c7908138b9c112404f5956ac40586170cc236..c67630f82c49b591dd088ebb1d58f62a0dcb4db3 100644 (file)
@@ -55,7 +55,7 @@
 #define AL_DEVICE_NAME L"\\Device\\ibal"\r
 #define        ALDEV_KEY               (0x3B)  /* Matches FILE_DEVICE_INFINIBAND from wdm.h */\r
 \r
-#define AL_IOCTL_VERSION                       (10)\r
+#define AL_IOCTL_VERSION                       (11)\r
 \r
 /* max number of devices with non-default pkey */\r
 #define        MAX_NUM_PKEY    16\r
index 948b8152a4af5bfa776dffb59985f859f08c76a8..47e11ea2d7f231052c6541118912d8cfc3796edc 100644 (file)
@@ -986,11 +986,12 @@ __ndi_send_req(
 \r
        p_irp->Tail.Overlay.DriverContext[1] = NULL;\r
 \r
-       if( h_qp->p_irp_queue->state != NDI_CM_CONNECTING_QPR_SENT )\r
+       if( h_qp->p_irp_queue->state != NDI_CM_CONNECTING_QPR_SENT &&\r
+               h_qp->p_irp_queue->state != NDI_CM_IDLE )\r
        {\r
                AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                        ("Unexpected state: %d\n", h_qp->p_irp_queue->state) );\r
-               return STATUS_CONNECTION_ABORTED;\r
+               return STATUS_CONNECTION_ACTIVE;\r
        }\r
 \r
        /* Get a CEP and bind it to the QP. */\r
@@ -1181,6 +1182,7 @@ __ndi_pr_query(
        ual_ndi_req_cm_ioctl_in_t *p_req = \r
                (ual_ndi_req_cm_ioctl_in_t*)cl_ioctl_in_buf( p_irp );\r
        ib_qp_handle_t h_qp = (ib_qp_handle_t)p_irp->Tail.Overlay.DriverContext[0];\r
+    ib_gid_pair_t gids;\r
 \r
        AL_ENTER( AL_DBG_NDI );\r
 \r
@@ -1192,8 +1194,11 @@ __ndi_pr_query(
                return STATUS_CONNECTION_ACTIVE;\r
        }\r
 \r
+    gids.src_gid = p_req->path.sgid;\r
+    gids.dest_gid = p_req->path.dgid;\r
+\r
        query_req.query_type = IB_QUERY_PATH_REC_BY_GIDS;\r
-       query_req.p_query_input = &p_req->gids;\r
+       query_req.p_query_input = &gids;\r
        query_req.port_guid = p_req->guid;\r
        query_req.timeout_ms = g_sa_timeout;\r
        query_req.retry_cnt = g_sa_retries;\r
@@ -1203,7 +1208,7 @@ __ndi_pr_query(
 \r
        AL_PRINT( TRACE_LEVEL_INFORMATION, AL_DBG_NDI,\r
                ("Query for path from %I64x to %I64x\n",\r
-               p_req->guid, ib_gid_get_guid( &p_req->gids.dest_gid )) );\r
+               p_req->guid, ib_gid_get_guid( &p_req->path.dgid )) );\r
 \r
        ref_al_obj( &h_qp->obj );               /* take path query reference */\r
        status = ib_query( qp_get_al( h_qp ), &query_req, &h_qp->p_irp_queue->h_query );\r
@@ -1227,17 +1232,40 @@ ndi_req_cm(
        )\r
 {\r
        NTSTATUS status;\r
+       ual_ndi_req_cm_ioctl_in_t *p_req = \r
+               (ual_ndi_req_cm_ioctl_in_t*)cl_ioctl_in_buf( p_irp );\r
 \r
        AL_ENTER( AL_DBG_NDI );\r
 \r
        p_irp->Tail.Overlay.DriverContext[0] = (ib_qp_t*)h_qp;\r
 \r
-       status = IoCsqInsertIrpEx(\r
-               &h_qp->p_irp_queue->csq,\r
-               p_irp,\r
-               NULL,\r
-               (VOID*)(ULONG_PTR)NDI_CM_CONNECTING_QPR_SENT\r
-               );\r
+    if( p_req->path.dlid != 0 )\r
+    {\r
+           /* fix packet life */\r
+           uint8_t pkt_life = ib_path_rec_pkt_life( &p_req->path ) + g_pkt_life_modifier;\r
+           if( pkt_life > 0x1F )\r
+                   pkt_life = 0x1F;\r
+\r
+           p_req->path.pkt_life &= IB_PATH_REC_SELECTOR_MASK;\r
+           p_req->path.pkt_life |= pkt_life;\r
+\r
+           p_irp->Tail.Overlay.DriverContext[1] = &p_req->path;\r
+           status = IoCsqInsertIrpEx(\r
+                   &h_qp->p_irp_queue->csq,\r
+                   p_irp,\r
+                   NULL,\r
+                   (VOID*)(ULONG_PTR)NDI_CM_CONNECTING_REQ_SENT\r
+                   );\r
+    }\r
+    else\r
+    {\r
+           status = IoCsqInsertIrpEx(\r
+                   &h_qp->p_irp_queue->csq,\r
+                   p_irp,\r
+                   NULL,\r
+                   (VOID*)(ULONG_PTR)NDI_CM_CONNECTING_QPR_SENT\r
+                   );\r
+    }\r
        if( status == STATUS_SUCCESS )\r
                status = STATUS_PENDING;\r
 \r
index 0a67f0c362a0935bb1867b92abc8bd17821316f9..0b425c1feba9bf4d98fe64a71b3c51b846710d8c 100644 (file)
@@ -3480,11 +3480,10 @@ typedef struct _ual_ndi_notify_cq_ioctl_in
 */\r
 typedef struct _ual_ndi_req_cm_ioctl_in\r
 {\r
-    ib_gid_pair_t               gids;\r
+    ib_path_rec_t               path;\r
        uint64_t                                        h_qp;\r
        net64_t                                         guid;\r
        uint16_t                                        dst_port;\r
-    uint16_t                    pkey;\r
     uint8_t                     resp_res;\r
     uint8_t                     init_depth;\r
        uint8_t                                         prot;\r
@@ -3506,8 +3505,8 @@ typedef struct _ual_ndi_req_cm_ioctl_in
 *      dst_port\r
 *              Destination port number.\r
 *\r
-*   pkey\r
-*       Partition key.\r
+*   path\r
+*       Path record for the connection.\r
 *\r
 *   resp_res\r
 *       Responder resources for the QP.\r