[openib-general] [PATCH] libmthca: fill vendor_err in completion with error

Michael S. Tsirkin mst at mellanox.co.il
Mon Dec 26 04:10:18 PST 2005


Fill vendor_err field for completion with error.

Index: last_stable/src/userspace/libmthca/src/cq.c
===================================================================
--- last_stable.orig/src/userspace/libmthca/src/cq.c	2005-12-25 17:04:23.000000000 +0200
+++ last_stable/src/userspace/libmthca/src/cq.c	2005-12-26 13:57:00.000000000 +0200
@@ -112,12 +112,12 @@ struct mthca_err_cqe {
 	uint32_t	my_qpn;
 	uint32_t	reserved1[3];
 	uint8_t		syndrome;
-	uint8_t		reserved2;
+	uint8_t		vendor_err;
 	uint16_t	db_cnt;
-	uint32_t	reserved3;
+	uint32_t	reserved2;
 	uint32_t	wqe;
 	uint8_t		opcode;
-	uint8_t		reserved4[2];
+	uint8_t		reserved3[2];
 	uint8_t		owner;
 };
 
@@ -197,8 +197,8 @@ static int handle_error_cqe(struct mthca
 	}
 
 	/*
-	 * For completions in error, only work request ID, status (and
-	 * freed resource count for RD) have to be set.
+	 * For completions in error, only work request ID, status, vendor error
+	 * (and freed resource count for RD) have to be set.
 	 */
 	switch (cqe->syndrome) {
 	case SYNDROME_LOCAL_LENGTH_ERR:
@@ -260,6 +260,8 @@ static int handle_error_cqe(struct mthca
 		break;
 	}
 
+	wc->vendor_err = cqe->vendor_err;
+
 	/*
 	 * Mem-free HCAs always generate one CQE per WQE, even in the
 	 * error case, so we don't have to check the doorbell count, etc.

-- 
MST



More information about the general mailing list