[Openib-windows] [PATCH] Make MTHCA build

Fab Tillier ftillier at silverstorm.com
Fri Mar 24 15:58:05 PST 2006


Hi Leonid,

Attached is a patch that remaps RDD/EEC WC status values to IB_WCS_GENERIC_ERR,
and that removes the use of the qp_num field in the ib_wc_t structure.  This is
needed to let the driver build.

- Fab

Index: hw/mthca/kernel/mthca_cmd.c
===================================================================
--- hw/mthca/kernel/mthca_cmd.c	(revision 251)
+++ hw/mthca/kernel/mthca_cmd.c	(working copy)
@@ -1707,6 +1707,9 @@
 	u32 in_modifier = port;
 	u8 op_modifier = 0;
 
+	ASSERT( !in_wc );
+	UNREFERENCED_PARAMETER( in_grh );
+
 #define MAD_IFC_BOX_SIZE      0x400
 #define MAD_IFC_MY_QPN_OFFSET 0x100
 #define MAD_IFC_RQPN_OFFSET   0x104
@@ -1738,32 +1741,6 @@
 	if (ignore_bkey || !in_wc)
 		op_modifier |= 0x2;
 
-	if (in_wc) {
-		u8 val;
-
-		RtlZeroMemory(inbox + 256, 256);
-
-		MTHCA_PUT(inbox, in_wc->qp_num,     MAD_IFC_MY_QPN_OFFSET);
-		MTHCA_PUT(inbox, in_wc->recv.ud.remote_qp,
MAD_IFC_RQPN_OFFSET);
-
-		val = in_wc->recv.ud.remote_sl << 4;
-		MTHCA_PUT(inbox, val,               MAD_IFC_SL_OFFSET);
-
-		val = in_wc->recv.ud.path_bits |
-			(in_wc->recv.ud.recv_opt & IB_RECV_OPT_GRH_VALID ? 0x80
: 0);
-		MTHCA_PUT(inbox, val,               MAD_IFC_GRH_OFFSET);
-
-		MTHCA_PUT(inbox, in_wc->recv.ud.remote_lid,
MAD_IFC_RLID_OFFSET);
-		MTHCA_PUT(inbox, in_wc->recv.ud.pkey_index,
MAD_IFC_PKEY_OFFSET);
-
-		if (in_grh)
-			memcpy(inbox + MAD_IFC_GRH_OFFSET, in_grh, 40);
-
-		op_modifier |= 0x10;
-
-		in_modifier |= in_wc->recv.ud.remote_lid << 16;
-	}
-
 	err = mthca_cmd_box(dev, inmailbox->dma, outmailbox->dma,
 			    in_modifier, op_modifier,
 			    CMD_MAD_IFC, CMD_TIME_CLASS_C, status);
Index: hw/mthca/kernel/mthca_cq.c
===================================================================
--- hw/mthca/kernel/mthca_cq.c	(revision 251)
+++ hw/mthca/kernel/mthca_cq.c	(working copy)
@@ -362,9 +362,6 @@
 	case SYNDROME_LOCAL_QP_OP_ERR:
 		entry->status = IB_WCS_LOCAL_OP_ERR;
 		break;
-	case SYNDROME_LOCAL_EEC_OP_ERR:
-		entry->status = IB_WCS_LOCAL_EEC_OP_ERR;
-		break;
 	case SYNDROME_LOCAL_PROT_ERR:
 		entry->status = IB_WCS_LOCAL_PROTECTION_ERR;
 		break;
@@ -381,7 +378,7 @@
 		entry->status = IB_WCS_LOCAL_ACCESS_ERR;
 		break;
 	case SYNDROME_REMOTE_INVAL_REQ_ERR:
-		entry->status = IB_WCS_REM_INV_REQ_ERR;
+		entry->status = IB_WCS_REM_INVALID_REQ_ERR;
 		break;
 	case SYNDROME_REMOTE_ACCESS_ERR:
 		entry->status = IB_WCS_REM_ACCESS_ERR;
@@ -395,21 +392,14 @@
 	case SYNDROME_RNR_RETRY_EXC_ERR:
 		entry->status = IB_WCS_RNR_RETRY_ERR;
 		break;
-	case SYNDROME_LOCAL_RDD_VIOL_ERR:
-		entry->status = IB_WCS_LOCAL_RDD_VIOL_ERR;
-		break;
 	case SYNDROME_REMOTE_INVAL_RD_REQ_ERR:
 		entry->status = IB_WCS_REM_INVALID_REQ_ERR;
 		break;
 	case SYNDROME_REMOTE_ABORTED_ERR:
-		entry->status = IB_WCS_REM_ABORT_ERR;
-		break;
+	case SYNDROME_LOCAL_EEC_OP_ERR:
+	case SYNDROME_LOCAL_RDD_VIOL_ERR:
 	case SYNDROME_INVAL_EECN_ERR:
-		entry->status = IB_WCS_INV_EECN_ERR;
-		break;
 	case SYNDROME_INVAL_EEC_STATE_ERR:
-		entry->status = IB_WCS_INV_EEC_STATE_ERR;
-		break;
 	default:
 		entry->status = IB_WCS_GENERAL_ERR;
 		break;
@@ -500,8 +490,6 @@
 		}
 	}
 
-	entry->qp_num = (*cur_qp)->qpn;
-
 	if (is_send) {
 		wq = &(*cur_qp)->sq;
 		wqe_index = ((cl_ntoh32(cqe->wqe) - (*cur_qp)->send_wqe_offset)
Index: hw/mthca/user/mlnx_uvp_cq.c
===================================================================
--- hw/mthca/user/mlnx_uvp_cq.c	(revision 251)
+++ hw/mthca/user/mlnx_uvp_cq.c	(working copy)
@@ -203,9 +203,6 @@
 	case SYNDROME_LOCAL_QP_OP_ERR:
 		entry->status = IB_WCS_LOCAL_OP_ERR;
 		break;
-	case SYNDROME_LOCAL_EEC_OP_ERR:
-		entry->status = IB_WCS_LOCAL_EEC_OP_ERR;
-		break;
 	case SYNDROME_LOCAL_PROT_ERR:
 		entry->status = IB_WCS_LOCAL_PROTECTION_ERR;
 		break;
@@ -222,7 +219,7 @@
 		entry->status = IB_WCS_LOCAL_ACCESS_ERR;
 		break;
 	case SYNDROME_REMOTE_INVAL_REQ_ERR:
-		entry->status = IB_WCS_REM_INV_REQ_ERR;
+		entry->status = IB_WCS_REM_INVALID_REQ_ERR;
 		break;
 	case SYNDROME_REMOTE_ACCESS_ERR:
 		entry->status = IB_WCS_REM_ACCESS_ERR;
@@ -236,21 +233,12 @@
 	case SYNDROME_RNR_RETRY_EXC_ERR:
 		entry->status = IB_WCS_RNR_RETRY_ERR;
 		break;
+	case SYNDROME_LOCAL_EEC_OP_ERR:
 	case SYNDROME_LOCAL_RDD_VIOL_ERR:
-		entry->status = IB_WCS_LOCAL_RDD_VIOL_ERR;
-		break;
 	case SYNDROME_REMOTE_INVAL_RD_REQ_ERR:
-		entry->status = IB_WCS_REM_INVALID_REQ_ERR;
-		break;
 	case SYNDROME_REMOTE_ABORTED_ERR:
-		entry->status = IB_WCS_REM_ABORT_ERR;
-		break;
 	case SYNDROME_INVAL_EECN_ERR:
-		entry->status = IB_WCS_INV_EECN_ERR;
-		break;
 	case SYNDROME_INVAL_EEC_STATE_ERR:
-		entry->status = IB_WCS_INV_EEC_STATE_ERR;
-		break;
 	default:
 		entry->status = IB_WCS_GENERAL_ERR;
 		break;
@@ -344,8 +332,6 @@
 		}
 	}
 
-	entry->qp_num = (*cur_qp)->ibv_qp.qp_num;
-
 	if (is_send) {
 		wq = &(*cur_qp)->sq;
 		wqe_index = ((cl_ntoh32(cqe->wqe) - (*cur_qp)->send_wqe_offset)
>> wq->wqe_shift);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mthca.qp_num.patch
Type: application/octet-stream
Size: 4675 bytes
Desc: not available
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20060324/c8bab20e/attachment.obj>


More information about the ofw mailing list