linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [rdma-core 0/3] libbnxt_re bug fixes
@ 2018-01-31 14:51 Devesh Sharma
       [not found] ` <1517410311-23623-1-git-send-email-devesh.sharma-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Devesh Sharma @ 2018-01-31 14:51 UTC (permalink / raw)
  To: dledford-H+wXaHxf7aLQT0dZR+AlfA, jgg-VPRAkNaXOzVWk0Htik3J/w,
	leon-DgEjT+Ai2ygdnm+yROfE0A
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Devesh Sharma

This patch series contains important bug fixes.
Patch 1 addresses a latency test failure. Patch 2
improves the f/w version display. Patch 3 updates
the PCI-ID table.

Devesh Sharma (2):
  libbnxt_re: Fix lat test failure in event mode
  libbnxt_re: Update and sort device pci-id table

Selvin Xavier (1):
  libbnxt_re: Display FW version using ibv_devinfo

 providers/bnxt_re/main.c  | 17 +++++++++++------
 providers/bnxt_re/main.h  |  3 +++
 providers/bnxt_re/verbs.c | 19 ++++++++++++++++---
 3 files changed, 30 insertions(+), 9 deletions(-)

-- 
1.8.3.1

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [rdma-core 1/3] libbnxt_re: Fix lat test failure in event mode
       [not found] ` <1517410311-23623-1-git-send-email-devesh.sharma-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
@ 2018-01-31 14:51   ` Devesh Sharma
  2018-01-31 14:51   ` [rdma-core 2/3] libbnxt_re: Display FW version using ibv_devinfo Devesh Sharma
  2018-01-31 14:51   ` [rdma-core 3/3] libbnxt_re: Update and sort device pci-id table Devesh Sharma
  2 siblings, 0 replies; 4+ messages in thread
From: Devesh Sharma @ 2018-01-31 14:51 UTC (permalink / raw)
  To: dledford-H+wXaHxf7aLQT0dZR+AlfA, jgg-VPRAkNaXOzVWk0Htik3J/w,
	leon-DgEjT+Ai2ygdnm+yROfE0A
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Devesh Sharma, Somnath Kotur,
	Selvin Xavier

The application assumes that, when CQ is armed, it gives interrupt
for the new CQEs generated and not for the existing CQEs. This is
in-line with the IB-Spec. However, Broadcom HW generates an interrupt
for any unread CQEs not just new ones. This results in a scenario
where the application is expecting a completion for a SEND operation
but it receives a completion for a prior incoming-send/RQE that was
not yet consumed as per the HW thereby leading to failure.
Workaround this by deferring the ARM-ing of the CQ when invoked in
the notify_cq hook to 'poll_cq' so that the CQ is armed after all
completions are consumed.

Signed-off-by: Devesh Sharma <devesh.sharma-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
Signed-off-by: Somnath Kotur <somnath.kotur-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
Signed-off-by: Selvin Xavier <selvin.xavier-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
---
 providers/bnxt_re/main.h  |  3 +++
 providers/bnxt_re/verbs.c | 13 ++++++++++++-
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/providers/bnxt_re/main.h b/providers/bnxt_re/main.h
index affe24f..08aa277 100644
--- a/providers/bnxt_re/main.h
+++ b/providers/bnxt_re/main.h
@@ -76,6 +76,9 @@ struct bnxt_re_cq {
 	struct list_head rfhead;
 	uint32_t cqe_size;
 	uint8_t  phase;
+	int deferred_arm_flags;
+	bool first_arm;
+	bool deferred_arm;
 };
 
 struct bnxt_re_srq {
diff --git a/providers/bnxt_re/verbs.c b/providers/bnxt_re/verbs.c
index 09ac333..2e88304 100644
--- a/providers/bnxt_re/verbs.c
+++ b/providers/bnxt_re/verbs.c
@@ -202,6 +202,7 @@ struct ibv_cq *bnxt_re_create_cq(struct ibv_context *ibvctx, int ncqe,
 	cq->phase = resp.phase;
 	cq->cqq.tail = resp.tail;
 	cq->udpi = &cntx->udpi;
+	cq->first_arm = true;
 
 	list_head_init(&cq->sfhead);
 	list_head_init(&cq->rfhead);
@@ -654,6 +655,11 @@ int bnxt_re_poll_cq(struct ibv_cq *ibvcq, int nwc, struct ibv_wc *wc)
 
 	pthread_spin_lock(&cq->cqq.qlock);
 	dqed = bnxt_re_poll_one(cq, nwc, wc);
+	if (cq->deferred_arm) {
+		bnxt_re_ring_cq_arm_db(cq, cq->deferred_arm_flags);
+		cq->deferred_arm = false;
+		cq->deferred_arm_flags = 0;
+	}
 	pthread_spin_unlock(&cq->cqq.qlock);
 	/* Check if anything is there to flush. */
 	pthread_spin_lock(&cntx->fqlock);
@@ -718,7 +724,12 @@ int bnxt_re_arm_cq(struct ibv_cq *ibvcq, int flags)
 	pthread_spin_lock(&cq->cqq.qlock);
 	flags = !flags ? BNXT_RE_QUE_TYPE_CQ_ARMALL :
 			 BNXT_RE_QUE_TYPE_CQ_ARMSE;
-	bnxt_re_ring_cq_arm_db(cq, flags);
+	if (cq->first_arm) {
+		bnxt_re_ring_cq_arm_db(cq, flags);
+		cq->first_arm = false;
+	}
+	cq->deferred_arm = true;
+	cq->deferred_arm_flags = flags;
 	pthread_spin_unlock(&cq->cqq.qlock);
 
 	return 0;
-- 
1.8.3.1

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [rdma-core 2/3] libbnxt_re: Display FW version using ibv_devinfo
       [not found] ` <1517410311-23623-1-git-send-email-devesh.sharma-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
  2018-01-31 14:51   ` [rdma-core 1/3] libbnxt_re: Fix lat test failure in event mode Devesh Sharma
@ 2018-01-31 14:51   ` Devesh Sharma
  2018-01-31 14:51   ` [rdma-core 3/3] libbnxt_re: Update and sort device pci-id table Devesh Sharma
  2 siblings, 0 replies; 4+ messages in thread
From: Devesh Sharma @ 2018-01-31 14:51 UTC (permalink / raw)
  To: dledford-H+wXaHxf7aLQT0dZR+AlfA, jgg-VPRAkNaXOzVWk0Htik3J/w,
	leon-DgEjT+Ai2ygdnm+yROfE0A
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Selvin Xavier, Devesh Sharma

From: Selvin Xavier <selvin.xavier-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>

Need to expose the 64bit fw version received as an o/p
of ibv_cmd_query_device as a string. Fixing this in the query_device
verb.

Signed-off-by: Devesh Sharma <devesh.sharma-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
---
 providers/bnxt_re/verbs.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/providers/bnxt_re/verbs.c b/providers/bnxt_re/verbs.c
index 2e88304..6c07646 100644
--- a/providers/bnxt_re/verbs.c
+++ b/providers/bnxt_re/verbs.c
@@ -58,12 +58,14 @@ int bnxt_re_query_device(struct ibv_context *ibvctx,
 			 struct ibv_device_attr *dev_attr)
 {
 	struct ibv_query_device cmd;
-	uint64_t fw_ver;
+	uint8_t fw_ver[8];
 	int status;
 
 	memset(dev_attr, 0, sizeof(struct ibv_device_attr));
-	status = ibv_cmd_query_device(ibvctx, dev_attr, &fw_ver,
+	status = ibv_cmd_query_device(ibvctx, dev_attr, (uint64_t *)&fw_ver,
 				      &cmd, sizeof(cmd));
+	snprintf(dev_attr->fw_ver, 64, "%d.%d.%d.%d",
+		 fw_ver[0], fw_ver[1], fw_ver[2], fw_ver[3]);
 	return status;
 }
 
-- 
1.8.3.1

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [rdma-core 3/3] libbnxt_re: Update and sort device pci-id table
       [not found] ` <1517410311-23623-1-git-send-email-devesh.sharma-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
  2018-01-31 14:51   ` [rdma-core 1/3] libbnxt_re: Fix lat test failure in event mode Devesh Sharma
  2018-01-31 14:51   ` [rdma-core 2/3] libbnxt_re: Display FW version using ibv_devinfo Devesh Sharma
@ 2018-01-31 14:51   ` Devesh Sharma
  2 siblings, 0 replies; 4+ messages in thread
From: Devesh Sharma @ 2018-01-31 14:51 UTC (permalink / raw)
  To: dledford-H+wXaHxf7aLQT0dZR+AlfA, jgg-VPRAkNaXOzVWk0Htik3J/w,
	leon-DgEjT+Ai2ygdnm+yROfE0A
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Devesh Sharma

Sort the pci-id table in increasing order of the
device IDs. Add new PCI-ID for BCM880xx series of
devices.

Signed-off-by: Devesh Sharma <devesh.sharma-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
---
 providers/bnxt_re/main.c | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/providers/bnxt_re/main.c b/providers/bnxt_re/main.c
index 520bf57..eae50b0 100644
--- a/providers/bnxt_re/main.c
+++ b/providers/bnxt_re/main.c
@@ -54,24 +54,29 @@
 
 #define CNA(v, d) VERBS_PCI_MATCH(PCI_VENDOR_ID_##v, d, NULL)
 static const struct verbs_match_ent cna_table[] = {
+	CNA(BROADCOM, 0x1605),  /* BCM57454 NPAR */
+	CNA(BROADCOM, 0x1606),  /* BCM57454 VF */
+	CNA(BROADCOM, 0x1614),  /* BCM57454 */
 	CNA(BROADCOM, 0x16C0),  /* BCM57417 NPAR */
+	CNA(BROADCOM, 0x16C1),  /* BMC57414 VF */
 	CNA(BROADCOM, 0x16CE),  /* BMC57311 */
 	CNA(BROADCOM, 0x16CF),  /* BMC57312 */
-	CNA(BROADCOM, 0x16DF),  /* BMC57314 */
-	CNA(BROADCOM, 0x16E5),  /* BMC57314 VF */
-	CNA(BROADCOM, 0x16E2),  /* BMC57417 */
-	CNA(BROADCOM, 0x16E3),  /* BMC57416 */
 	CNA(BROADCOM, 0x16D6),  /* BMC57412*/
 	CNA(BROADCOM, 0x16D7),  /* BMC57414 */
 	CNA(BROADCOM, 0x16D8),  /* BMC57416 Cu */
 	CNA(BROADCOM, 0x16D9),  /* BMC57417 Cu */
-	CNA(BROADCOM, 0x16C1),  /* BMC57414 VF */
-	CNA(BROADCOM, 0x16EF),  /* BCM57416 NPAR */
+	CNA(BROADCOM, 0x16DF),  /* BMC57314 */
+	CNA(BROADCOM, 0x16E2),  /* BMC57417 */
+	CNA(BROADCOM, 0x16E3),  /* BMC57416 */
+	CNA(BROADCOM, 0x16E5),  /* BMC57314 VF */
 	CNA(BROADCOM, 0x16ED),  /* BCM57414 NPAR */
 	CNA(BROADCOM, 0x16EB),  /* BCM57412 NPAR */
+	CNA(BROADCOM, 0x16EF),  /* BCM57416 NPAR */
 	CNA(BROADCOM, 0x16F0),  /* BCM58730 */
 	CNA(BROADCOM, 0x16F1),  /* BCM57452 */
+	CNA(BROADCOM, 0xD800),  /* BCM880xx VF */
 	CNA(BROADCOM, 0xD802),  /* BCM58802 */
+	CNA(BROADCOM, 0xD804),   /* BCM8804 SR */
 	{}
 };
 
-- 
1.8.3.1

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-01-31 14:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-31 14:51 [rdma-core 0/3] libbnxt_re bug fixes Devesh Sharma
     [not found] ` <1517410311-23623-1-git-send-email-devesh.sharma-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
2018-01-31 14:51   ` [rdma-core 1/3] libbnxt_re: Fix lat test failure in event mode Devesh Sharma
2018-01-31 14:51   ` [rdma-core 2/3] libbnxt_re: Display FW version using ibv_devinfo Devesh Sharma
2018-01-31 14:51   ` [rdma-core 3/3] libbnxt_re: Update and sort device pci-id table Devesh Sharma

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).