Skip to contentSkip to conversation

libcxgb4: fixes for debug build

PATCH Applied Steve Wise 3 participants 4 messages Dec 15, 2016 2 messages not in the archive InfiniBand

lore
Share & tools
lore

Steve Wise

author
#0 lore raw

PATCH 1/1 libcxgb4: fixes for debug build

---
 providers/cxgb4/dev.c      | 14 +++++++-------
 providers/cxgb4/libcxgb4.h |  2 +-
 2 files changed, 8 insertions(+), 8 deletions(-)
providers/cxgb4/dev.c +7 -7
index 69b04ac..3d903e8 100644
@@ -239,7 +239,7 @@ static void dump_cq(struct c4iw_cq *chp)
                 chp->cq.cqid, chp->cq.queue, chp->cq.cidx,
 	 	chp->cq.sw_queue, chp->cq.sw_cidx, chp->cq.sw_pidx, chp->cq.sw_in_use,
                 chp->cq.size, chp->cq.error, chp->cq.gen, chp->cq.cidx_inc, be64_to_cpu(chp->cq.bits_type_ts),
-		t4_cq_notempty(&chp->cq) || (chp->iq ? t4_iq_notempty(chp->iq) : 0));
+		t4_cq_notempty(&chp->cq));
 
 	for (i=0; i < chp->cq.size; i++) {
 		u64 *p = (u64 *)(chp->cq.queue + i);
@@ -310,10 +310,10 @@ static void dump_qp(struct c4iw_qp *qhp)
 			swsqe->opcode,
 			swsqe->complete,
 			swsqe->signaled,
-			cpu_to_be64(swsqe->cqe.u.flits[0]),
-			cpu_to_be64(swsqe->cqe.u.flits[1]),
-			cpu_to_be64((u64)swsqe->cqe.reserved),
-			cpu_to_be64(swsqe->cqe.bits_type_ts));
+			cpu_to_be64(((uint64_t *)&swsqe->cqe)[0]),
+			cpu_to_be64(((uint64_t *)&swsqe->cqe)[1]),
+			cpu_to_be64(((uint64_t *)&swsqe->cqe)[2]),
+			cpu_to_be64(((uint64_t *)&swsqe->cqe)[3]));
 		if (++cidx == qhp->wq.sq.size)
 			cidx = 0;
 	}
@@ -359,7 +359,7 @@ static void dump_qp(struct c4iw_qp *qhp)
 	}
 }
 
-void dump_state()
+void dump_state(void)
 {
 	struct c4iw_dev *dev;
 	int i;
@@ -462,7 +462,7 @@ found:
 	}
 
 	PDBG("%s found vendor %d device %d type %d\n",
-	     __FUNCTION__, vendor, device, hca_table[i].chip_version);
+	     __FUNCTION__, vendor, device, CHELSIO_CHIP_VERSION(hca_table[i].device >> 8));
 
 	dev = calloc(1, sizeof *dev);
 	if (!dev) {
providers/cxgb4/libcxgb4.h +1 -1
index 9a4bc98..3b75661 100644
@@ -260,7 +260,7 @@ extern struct c4iw_stats c4iw_stats;
 #endif
 
 #ifdef STALL_DETECTION
-void dump_state();
+void dump_state(void);
 extern int stall_to;
 #endif
 
Signature · 6 lines
1.8.3.1

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Applied
#2 lore raw
In reply to a message not in the archive
Quoted 58 lines · Steve Wise
---
 providers/cxgb4/dev.c      | 14 +++++++-------
 providers/cxgb4/libcxgb4.h |  2 +-
 2 files changed, 8 insertions(+), 8 deletions(-)
providers/cxgb4/dev.c +7 -7
index 69b04ac..3d903e8 100644
@@ -239,7 +239,7 @@ static void dump_cq(struct c4iw_cq *chp)
                 chp->cq.cqid, chp->cq.queue, chp->cq.cidx,
 	 	chp->cq.sw_queue, chp->cq.sw_cidx, chp->cq.sw_pidx, chp->cq.sw_in_use,
                 chp->cq.size, chp->cq.error, chp->cq.gen, chp->cq.cidx_inc, be64_to_cpu(chp->cq.bits_type_ts),
-		t4_cq_notempty(&chp->cq) || (chp->iq ? t4_iq_notempty(chp->iq) : 0));
+		t4_cq_notempty(&chp->cq));
 
 	for (i=0; i < chp->cq.size; i++) {
 		u64 *p = (u64 *)(chp->cq.queue + i);
@@ -310,10 +310,10 @@ static void dump_qp(struct c4iw_qp *qhp)
 			swsqe->opcode,
 			swsqe->complete,
 			swsqe->signaled,
-			cpu_to_be64(swsqe->cqe.u.flits[0]),
-			cpu_to_be64(swsqe->cqe.u.flits[1]),
-			cpu_to_be64((u64)swsqe->cqe.reserved),
-			cpu_to_be64(swsqe->cqe.bits_type_ts));
+			cpu_to_be64(((uint64_t *)&swsqe->cqe)[0]),
+			cpu_to_be64(((uint64_t *)&swsqe->cqe)[1]),
+			cpu_to_be64(((uint64_t *)&swsqe->cqe)[2]),
+			cpu_to_be64(((uint64_t *)&swsqe->cqe)[3]));
 		if (++cidx == qhp->wq.sq.size)
 			cidx = 0;
 	}
@@ -359,7 +359,7 @@ static void dump_qp(struct c4iw_qp *qhp)
 	}
 }
 
-void dump_state()
+void dump_state(void)
 {
 	struct c4iw_dev *dev;
 	int i;
@@ -462,7 +462,7 @@ found:
 	}
 
 	PDBG("%s found vendor %d device %d type %d\n",
-	     __FUNCTION__, vendor, device, hca_table[i].chip_version);
+	     __FUNCTION__, vendor, device, CHELSIO_CHIP_VERSION(hca_table[i].device >> 8));
 
 	dev = calloc(1, sizeof *dev);
 	if (!dev) {
providers/cxgb4/libcxgb4.h +0 -0
index 9a4bc98..3b75661 100644

providers/cxgb4/libcxgb4.h extern struct c4iw_stats c4iw_stats; · line 266

Quoted 8 lines
providers/cxgb4/libcxgb4.h +1 -1
@@ -260,7 +260,7 @@ extern struct c4iw_stats c4iw_stats;
 #endif
 
 #ifdef STALL_DETECTION
-void dump_state();
+void dump_state(void);
 extern int stall_to;
 #endif
 

Thanks, applied.

Signature · 2 lines
Doug Ledford <[email protected]>
    GPG Key ID: 0E572FDD
#3 lore raw
In reply to a message not in the archive

providers/cxgb4/dev.c found: · line 465

Quoted 4 lines
providers/cxgb4/dev.c +1 -1
 	PDBG("%s found vendor %d device %d type %d\n",
-	     __FUNCTION__, vendor, device, hca_table[i].chip_version);
+	     __FUNCTION__, vendor, device, CHELSIO_CHIP_VERSION(hca_table[i].device >> 8));

Don't #define debug macros to {} to avoid this kind of bug

see b60ae256e7d1541edc8fd6a072a17c143ce70b4a

Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

author
#5 lore raw
In reply to a message not in the archive
Quoted 7 lines

providers/cxgb4/dev.c found:

Quoted 5 lines
providers/cxgb4/dev.c +1 -1
 	PDBG("%s found vendor %d device %d type %d\n",
-	     __FUNCTION__, vendor, device, hca_table[i].chip_version);
+	     __FUNCTION__, vendor, device,

CHELSIO_CHIP_VERSION(hca_table[i].device >> 8));

Quoted 5 lines

Don't #define debug macros to {} to avoid this kind of bug

see b60ae256e7d1541edc8fd6a072a17c143ce70b4a

Jason

Thanks Jason, I'll fix this at some point. I don't see a way to open a github issue to track this. Is that not enabled for rdma-core?

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html