[ofw] [PATCH] dapl: quick fix for wrong private data size

Sean Hefty sean.hefty at intel.com
Sat Jan 23 00:12:24 PST 2010


DAPL expects the private data size to be up to 256 bytes, but
on windows the private data size is limited to 56 bytes.  As
a result, DAPL can access memory beyond the end of what's
allocated.

A more 'correct' fix is being submitted upstream to dapl.  This
is a simpler fix for the Windows 2.2 release only.

Signed-off-by: Sean Hefty <sean.hefty at intel.com>
---
This is for 2.2 only.

 trunk/ulp/dapl2/dapl/openib_cma/cm.c |   30 +-----------------------------
 1 files changed, 1 insertions(+), 29 deletions(-)

diff --git a/trunk/ulp/dapl2/dapl/openib_cma/cm.c b/trunk/ulp/dapl2/dapl/openib_cma/cm.c
index c52e716..0212c0e 100644
--- a/trunk/ulp/dapl2/dapl/openib_cma/cm.c
+++ b/trunk/ulp/dapl2/dapl/openib_cma/cm.c
@@ -1023,35 +1023,7 @@ dapls_ib_cm_remote_addr(IN DAT_HANDLE dat_handle, OUT DAT_SOCK_ADDR6 * raddr)
 int dapls_ib_private_data_size(IN DAPL_PRIVATE * prd_ptr,
 			       IN DAPL_PDATA_OP conn_op, IN DAPL_HCA * hca_ptr)
 {
-	int size;
-
-	if (hca_ptr->ib_hca_handle->device->transport_type
-	    == IBV_TRANSPORT_IWARP)
-		return (IWARP_MAX_PDATA_SIZE - sizeof(struct dapl_pdata_hdr));
-
-	switch (conn_op) {
-
-	case DAPL_PDATA_CONN_REQ:
-		size = IB_MAX_REQ_PDATA_SIZE;
-		break;
-	case DAPL_PDATA_CONN_REP:
-		size = IB_MAX_REP_PDATA_SIZE;
-		break;
-	case DAPL_PDATA_CONN_REJ:
-		size = IB_MAX_REJ_PDATA_SIZE - sizeof(struct dapl_pdata_hdr);
-		break;
-	case DAPL_PDATA_CONN_DREQ:
-		size = IB_MAX_DREQ_PDATA_SIZE;
-		break;
-	case DAPL_PDATA_CONN_DREP:
-		size = IB_MAX_DREP_PDATA_SIZE;
-		break;
-	default:
-		size = 0;
-
-	}			/* end case */
-
-	return size;
+	return RDMA_MAX_PRIVATE_DATA;
 }
 
 /*






More information about the ofw mailing list