[ofw] ***SPAM*** [PATCH 3/4] Avoid the SM
Fab Tillier
ftillier at windows.microsoft.com
Thu Aug 21 09:54:13 PDT 2008
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 at microsoft.com>
diff -up -r -X trunk\docs\dontdiff.txt -I \$Id: old\core\al\al_dev.h trunk\core\al\al_dev.h
--- old\core\al\al_dev.h Thu Aug 21 08:40:23 2008
+++ trunk\core\al\al_dev.h Thu Aug 21 09:53:05 2008
@@ -55,7 +55,7 @@
#define AL_DEVICE_NAME L"\\Device\\ibal"
#define ALDEV_KEY (0x3B) /* Matches FILE_DEVICE_INFINIBAND from wdm.h */
-#define AL_IOCTL_VERSION (10)
+#define AL_IOCTL_VERSION (11)
/* max number of devices with non-default pkey */
#define MAX_NUM_PKEY 16
diff -up -r -X trunk\docs\dontdiff.txt -I \$Id: old\core\al\kernel\al_ndi_cm.c trunk\core\al\kernel\al_ndi_cm.c
--- old\core\al\kernel\al_ndi_cm.c Thu Aug 21 08:40:22 2008
+++ trunk\core\al\kernel\al_ndi_cm.c Thu Aug 21 09:53:05 2008
@@ -986,11 +986,12 @@ __ndi_send_req(
p_irp->Tail.Overlay.DriverContext[1] = NULL;
- if( h_qp->p_irp_queue->state != NDI_CM_CONNECTING_QPR_SENT )
+ if( h_qp->p_irp_queue->state != NDI_CM_CONNECTING_QPR_SENT &&
+ h_qp->p_irp_queue->state != NDI_CM_IDLE )
{
AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,
("Unexpected state: %d\n", h_qp->p_irp_queue->state) );
- return STATUS_CONNECTION_ABORTED;
+ return STATUS_CONNECTION_ACTIVE;
}
/* Get a CEP and bind it to the QP. */
@@ -1181,6 +1182,7 @@ __ndi_pr_query(
ual_ndi_req_cm_ioctl_in_t *p_req =
(ual_ndi_req_cm_ioctl_in_t*)cl_ioctl_in_buf( p_irp );
ib_qp_handle_t h_qp = (ib_qp_handle_t)p_irp->Tail.Overlay.DriverContext[0];
+ ib_gid_pair_t gids;
AL_ENTER( AL_DBG_NDI );
@@ -1192,8 +1194,11 @@ __ndi_pr_query(
return STATUS_CONNECTION_ACTIVE;
}
+ gids.src_gid = p_req->path.sgid;
+ gids.dest_gid = p_req->path.dgid;
+
query_req.query_type = IB_QUERY_PATH_REC_BY_GIDS;
- query_req.p_query_input = &p_req->gids;
+ query_req.p_query_input = &gids;
query_req.port_guid = p_req->guid;
query_req.timeout_ms = g_sa_timeout;
query_req.retry_cnt = g_sa_retries;
@@ -1203,7 +1208,7 @@ __ndi_pr_query(
AL_PRINT( TRACE_LEVEL_INFORMATION, AL_DBG_NDI,
("Query for path from %I64x to %I64x\n",
- p_req->guid, ib_gid_get_guid( &p_req->gids.dest_gid )) );
+ p_req->guid, ib_gid_get_guid( &p_req->path.dgid )) );
ref_al_obj( &h_qp->obj ); /* take path query reference */
status = ib_query( qp_get_al( h_qp ), &query_req, &h_qp->p_irp_queue->h_query );
@@ -1227,17 +1232,40 @@ ndi_req_cm(
)
{
NTSTATUS status;
+ ual_ndi_req_cm_ioctl_in_t *p_req =
+ (ual_ndi_req_cm_ioctl_in_t*)cl_ioctl_in_buf( p_irp );
AL_ENTER( AL_DBG_NDI );
p_irp->Tail.Overlay.DriverContext[0] = (ib_qp_t*)h_qp;
- status = IoCsqInsertIrpEx(
- &h_qp->p_irp_queue->csq,
- p_irp,
- NULL,
- (VOID*)(ULONG_PTR)NDI_CM_CONNECTING_QPR_SENT
- );
+ if( p_req->path.dlid != 0 )
+ {
+ /* fix packet life */
+ uint8_t pkt_life = ib_path_rec_pkt_life( &p_req->path ) + g_pkt_life_modifier;
+ if( pkt_life > 0x1F )
+ pkt_life = 0x1F;
+
+ p_req->path.pkt_life &= IB_PATH_REC_SELECTOR_MASK;
+ p_req->path.pkt_life |= pkt_life;
+
+ p_irp->Tail.Overlay.DriverContext[1] = &p_req->path;
+ status = IoCsqInsertIrpEx(
+ &h_qp->p_irp_queue->csq,
+ p_irp,
+ NULL,
+ (VOID*)(ULONG_PTR)NDI_CM_CONNECTING_REQ_SENT
+ );
+ }
+ else
+ {
+ status = IoCsqInsertIrpEx(
+ &h_qp->p_irp_queue->csq,
+ p_irp,
+ NULL,
+ (VOID*)(ULONG_PTR)NDI_CM_CONNECTING_QPR_SENT
+ );
+ }
if( status == STATUS_SUCCESS )
status = STATUS_PENDING;
diff -up -r -X trunk\docs\dontdiff.txt -I \$Id: old\inc\iba\ib_al_ioctl.h trunk\inc\iba\ib_al_ioctl.h
--- old\inc\iba\ib_al_ioctl.h Mon Jul 14 10:50:48 2008
+++ trunk\inc\iba\ib_al_ioctl.h Thu Aug 21 09:53:05 2008
@@ -3480,11 +3480,10 @@ typedef struct _ual_ndi_notify_cq_ioctl_
*/
typedef struct _ual_ndi_req_cm_ioctl_in
{
- ib_gid_pair_t gids;
+ ib_path_rec_t path;
uint64_t h_qp;
net64_t guid;
uint16_t dst_port;
- uint16_t pkey;
uint8_t resp_res;
uint8_t init_depth;
uint8_t prot;
@@ -3506,8 +3505,8 @@ typedef struct _ual_ndi_req_cm_ioctl_in
* dst_port
* Destination port number.
*
-* pkey
-* Partition key.
+* path
+* Path record for the connection.
*
* resp_res
* Responder resources for the QP.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nd_req_cm_use_path.patch
Type: application/octet-stream
Size: 4417 bytes
Desc: nd_req_cm_use_path.patch
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20080821/e062d167/attachment.obj>
More information about the ofw
mailing list