linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] libocrdma bug-fixes
@ 2015-11-02  6:37 Devesh Sharma
       [not found] ` <1446446245-534-1-git-send-email-devesh.sharma-1wcpHE2jlwO1Z/+hSey0Gg@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Devesh Sharma @ 2015-11-02  6:37 UTC (permalink / raw)
  To: linux-rdma-u79uwXL29TY76Z2rM5mHXA; +Cc: Devesh Sharma

Bug fix series of user-space rdma driver for Emulex
devices.

Devesh Sharma (3):
  RDMA/libocrdma: set vlan present bit for UD
  RDMA/libocrdma: Prevent CQ-Doorbell floods
  RDMA/libocrdma: update libocrdma version string

Padmanabh Ratnakar (1):
  RDMA/libocrdma:sync qp-state with hw state

 configure.in       |  4 ++--
 src/ocrdma_abi.h   |  7 ++++---
 src/ocrdma_main.h  |  7 +++++++
 src/ocrdma_verbs.c | 50 ++++++++++++++++++++++++++++----------------------
 4 files changed, 41 insertions(+), 27 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] 5+ messages in thread

* [PATCH 1/4] RDMA/libocrdma:sync qp-state with hw state
       [not found] ` <1446446245-534-1-git-send-email-devesh.sharma-1wcpHE2jlwO1Z/+hSey0Gg@public.gmane.org>
@ 2015-11-02  6:37   ` Devesh Sharma
  2015-11-02  6:37   ` [PATCH 2/4] RDMA/libocrdma: set vlan present bit for UD Devesh Sharma
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Devesh Sharma @ 2015-11-02  6:37 UTC (permalink / raw)
  To: linux-rdma-u79uwXL29TY76Z2rM5mHXA; +Cc: Padmanabh Ratnakar, Devesh Sharma

From: Padmanabh Ratnakar <padmanabh.ratnakar-1wcpHE2jlwO1Z/+hSey0Gg@public.gmane.org>

This patch sync up the QP state with the underlying h/w
QP state and reports the same to user application.

Signed-off-by: Padmanabh Ratnakar <padmanabh.ratnakar-1wcpHE2jlwO1Z/+hSey0Gg@public.gmane.org>
Signed-off-by: Devesh Sharma <devesh.sharma-1wcpHE2jlwO1Z/+hSey0Gg@public.gmane.org>
---
 src/ocrdma_verbs.c | 33 +++++++++++++++++++--------------
 1 file changed, 19 insertions(+), 14 deletions(-)

diff --git a/src/ocrdma_verbs.c b/src/ocrdma_verbs.c
index cf2ecd2..ab90b4f 100644
--- a/src/ocrdma_verbs.c
+++ b/src/ocrdma_verbs.c
@@ -651,20 +651,6 @@ mbx_err:
 	return NULL;
 }
 
-/*
- * ocrdma_query_qp
- */
-int ocrdma_query_qp(struct ibv_qp *qp, struct ibv_qp_attr *attr,
-		    int attr_mask, struct ibv_qp_init_attr *init_attr)
-{
-	struct ibv_query_qp cmd;
-	int status;
-
-	status =
-	    ibv_cmd_query_qp(qp, attr, attr_mask, init_attr, &cmd, sizeof(cmd));
-	return status;
-}
-
 enum ocrdma_qp_state get_ocrdma_qp_state(enum ibv_qp_state qps)
 {
 	switch (qps) {
@@ -896,6 +882,25 @@ int ocrdma_modify_qp(struct ibv_qp *ibqp, struct ibv_qp_attr *attr,
 	return status;
 }
 
+/*
+ * ocrdma_query_qp
+ */
+int ocrdma_query_qp(struct ibv_qp *ibqp, struct ibv_qp_attr *attr,
+		    int attr_mask, struct ibv_qp_init_attr *init_attr)
+{
+	struct ibv_query_qp cmd;
+	struct ocrdma_qp *qp = get_ocrdma_qp(ibqp);
+	int status;
+
+	status = ibv_cmd_query_qp(ibqp, attr, attr_mask,
+				  init_attr, &cmd, sizeof(cmd));
+
+	if (!status)
+		ocrdma_qp_state_machine(qp, attr->qp_state);
+
+	return status;
+}
+
 static void ocrdma_srq_toggle_bit(struct ocrdma_srq *srq, int idx)
 {
 	int i = idx / 32;
-- 
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] 5+ messages in thread

* [PATCH 2/4] RDMA/libocrdma: set vlan present bit for UD
       [not found] ` <1446446245-534-1-git-send-email-devesh.sharma-1wcpHE2jlwO1Z/+hSey0Gg@public.gmane.org>
  2015-11-02  6:37   ` [PATCH 1/4] RDMA/libocrdma:sync qp-state with hw state Devesh Sharma
@ 2015-11-02  6:37   ` Devesh Sharma
  2015-11-02  6:37   ` [PATCH 3/4] RDMA/libocrdma: Prevent CQ-Doorbell floods Devesh Sharma
  2015-11-02  6:37   ` [PATCH 4/4] RDMA/libocrdma: update libocrdma version string Devesh Sharma
  3 siblings, 0 replies; 5+ messages in thread
From: Devesh Sharma @ 2015-11-02  6:37 UTC (permalink / raw)
  To: linux-rdma-u79uwXL29TY76Z2rM5mHXA; +Cc: Devesh Sharma

This patch tells f/w about the presence of VLAN tag in
the AH being supplied to the QP.

Signed-off-by: Devesh Sharma <devesh.sharma-1wcpHE2jlwO1Z/+hSey0Gg@public.gmane.org>
---
 src/ocrdma_abi.h   | 7 ++++---
 src/ocrdma_main.h  | 7 +++++++
 src/ocrdma_verbs.c | 8 ++++++--
 3 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/src/ocrdma_abi.h b/src/ocrdma_abi.h
index ad7abd4..8102c1c 100644
--- a/src/ocrdma_abi.h
+++ b/src/ocrdma_abi.h
@@ -51,14 +51,14 @@ enum {
 };
 
 #define OCRDMA_DB_CQ_RING_ID_MASK		0x3FF	/* bits 0 - 9 */
-#define OCRDMA_DB_CQ_RING_ID_EXT_MASK  0x0C00	/* bits 10-11 of qid placing at 12-11 */
-#define OCRDMA_DB_CQ_RING_ID_EXT_MASK_SHIFT  0x1	/* qid #2 msbits placing at 12-11 */
+#define OCRDMA_DB_CQ_RING_ID_EXT_MASK		0x0C00	/* bits 10-11 of qid placing at 12-11 */
+#define OCRDMA_DB_CQ_RING_ID_EXT_MASK_SHIFT	0x1	/* qid #2 msbits placing at 12-11 */
 #define OCRDMA_DB_CQ_NUM_POPPED_SHIFT		(16)	/* bits 16 - 28 */
 /* Rearm bit */
 #define OCRDMA_DB_CQ_REARM_SHIFT		(29)	/* bit 29 */
 
 /* solicited bit */
-#define OCRDMA_DB_CQ_SOLICIT_SHIFT   (31)	/* bit 31 */
+#define OCRDMA_DB_CQ_SOLICIT_SHIFT		(31)	/* bit 31 */
 
 struct ocrdma_get_context {
 	struct ibv_get_context cmd;
@@ -291,6 +291,7 @@ enum {
 	OCRDMA_FLAG_FENCE_R 	= 0x8,
 	OCRDMA_FLAG_SOLICIT	= 0x10,
 	OCRDMA_FLAG_IMM 	= 0x20,
+	OCRDMA_FLAG_AH_VLAN_PR	= 0x40,
 
 	/* Stag flags */
 	OCRDMA_LKEY_FLAG_LOCAL_WR 	= 0x1,
diff --git a/src/ocrdma_main.h b/src/ocrdma_main.h
index 5a386bb..4e7be75 100644
--- a/src/ocrdma_main.h
+++ b/src/ocrdma_main.h
@@ -211,10 +211,17 @@ struct ocrdma_qp {
 	int	signaled;	/* signaled QP */
 };
 
+enum {
+	OCRDMA_AH_ID_MASK               = 0x3FF,
+	OCRDMA_AH_VLAN_VALID_MASK       = 0x01,
+	OCRDMA_AH_VLAN_VALID_SHIFT      = 0x1F
+};
+
 struct ocrdma_ah {
 	struct ibv_ah ibv_ah;
 	struct ocrdma_pd *pd;
 	uint16_t id;
+	uint8_t isvlan;
 };
 
 #define get_ocrdma_xxx(xxx, type)				\
diff --git a/src/ocrdma_verbs.c b/src/ocrdma_verbs.c
index ab90b4f..d80ab27 100644
--- a/src/ocrdma_verbs.c
+++ b/src/ocrdma_verbs.c
@@ -1196,6 +1196,9 @@ static void ocrdma_build_ud_hdr(struct ocrdma_qp *qp,
 	ud_hdr->rsvd_dest_qpn = wr->wr.ud.remote_qpn;
 	ud_hdr->qkey = wr->wr.ud.remote_qkey;
 	ud_hdr->rsvd_ahid = ah->id;
+	if (ah->isvlan)
+		hdr->cw |= (OCRDMA_FLAG_AH_VLAN_PR <<
+			    OCRDMA_WQE_FLAGS_SHIFT);
 }
 
 static void ocrdma_build_sges(struct ocrdma_hdr_wqe *hdr,
@@ -2156,9 +2159,10 @@ struct ibv_ah *ocrdma_create_ah(struct ibv_pd *ibpd, struct ibv_ah_attr *attr)
 	if (status)
 		goto cmd_err;
 
-	ah->id = pd->uctx->ah_tbl[ahtbl_idx];
+	ah->id = pd->uctx->ah_tbl[ahtbl_idx] & OCRDMA_AH_ID_MASK;
+	ah->isvlan = (pd->uctx->ah_tbl[ahtbl_idx] >>
+			OCRDMA_AH_VLAN_VALID_SHIFT);
 	return &ah->ibv_ah;
-
 cmd_err:
 	ocrdma_free_ah_tbl_id(pd->uctx, ahtbl_idx);
 tbl_err:
-- 
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] 5+ messages in thread

* [PATCH 3/4] RDMA/libocrdma: Prevent CQ-Doorbell floods
       [not found] ` <1446446245-534-1-git-send-email-devesh.sharma-1wcpHE2jlwO1Z/+hSey0Gg@public.gmane.org>
  2015-11-02  6:37   ` [PATCH 1/4] RDMA/libocrdma:sync qp-state with hw state Devesh Sharma
  2015-11-02  6:37   ` [PATCH 2/4] RDMA/libocrdma: set vlan present bit for UD Devesh Sharma
@ 2015-11-02  6:37   ` Devesh Sharma
  2015-11-02  6:37   ` [PATCH 4/4] RDMA/libocrdma: update libocrdma version string Devesh Sharma
  3 siblings, 0 replies; 5+ messages in thread
From: Devesh Sharma @ 2015-11-02  6:37 UTC (permalink / raw)
  To: linux-rdma-u79uwXL29TY76Z2rM5mHXA; +Cc: Devesh Sharma

Changing CQ-Doorbell(DB) logic to prevent DB floods, it is supposed to be
pressed only if any hw CQE is polled. If cq-arm was requested
previously then don't bother about number of hw CQEs polled and
arm the CQ.

Signed-off-by: Devesh Sharma <devesh.sharma-1wcpHE2jlwO1Z/+hSey0Gg@public.gmane.org>
---
 src/ocrdma_verbs.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/src/ocrdma_verbs.c b/src/ocrdma_verbs.c
index d80ab27..cf6f72c 100644
--- a/src/ocrdma_verbs.c
+++ b/src/ocrdma_verbs.c
@@ -2003,14 +2003,11 @@ expand_cqe:
 	}
 stop_cqe:
 	cq->getp = cur_getp;
-	if (cq->deferred_arm) {
-		ocrdma_ring_cq_db(cq, 1, cq->deferred_sol, polled_hw_cqes);
+	if (cq->deferred_arm || polled_hw_cqes) {
+		ocrdma_ring_cq_db(cq, cq->deferred_arm,
+				  cq->deferred_sol, polled_hw_cqes);
 		cq->deferred_arm = 0;
 		cq->deferred_sol = 0;
-	} else {
-		/* We need to pop the CQE. No need to arm */
-		ocrdma_ring_cq_db(cq, 0, cq->deferred_sol, polled_hw_cqes);
-		cq->deferred_sol = 0;
 	}
 
 	return i;
-- 
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] 5+ messages in thread

* [PATCH 4/4] RDMA/libocrdma: update libocrdma version string
       [not found] ` <1446446245-534-1-git-send-email-devesh.sharma-1wcpHE2jlwO1Z/+hSey0Gg@public.gmane.org>
                     ` (2 preceding siblings ...)
  2015-11-02  6:37   ` [PATCH 3/4] RDMA/libocrdma: Prevent CQ-Doorbell floods Devesh Sharma
@ 2015-11-02  6:37   ` Devesh Sharma
  3 siblings, 0 replies; 5+ messages in thread
From: Devesh Sharma @ 2015-11-02  6:37 UTC (permalink / raw)
  To: linux-rdma-u79uwXL29TY76Z2rM5mHXA; +Cc: Devesh Sharma

version string updated from 1.0.5 to 1.0.6

Signed-off-by: Devesh Sharma <devesh.sharma-1wcpHE2jlwO1Z/+hSey0Gg@public.gmane.org>
---
 configure.in | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/configure.in b/configure.in
index 140c07b..653bc43 100644
--- a/configure.in
+++ b/configure.in
@@ -1,11 +1,11 @@
 dnl Process this file with autoconf to produce a configure script.
 
 AC_PREREQ(2.57)
-AC_INIT(libocrdma, 1.0.5, linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org)
+AC_INIT(libocrdma, 1.0.6, linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org)
 AC_CONFIG_SRCDIR([src/ocrdma_main.h])
 AC_CONFIG_AUX_DIR(config)
 AM_CONFIG_HEADER(config.h)
-AM_INIT_AUTOMAKE(libocrdma, 1.0.5)
+AM_INIT_AUTOMAKE(libocrdma, 1.0.6)
 AM_PROG_LIBTOOL
 
 AC_ARG_ENABLE(libcheck, [ --disable-libcheck    do not test for the presence of ib libraries],
-- 
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] 5+ messages in thread

end of thread, other threads:[~2015-11-02  6:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-02  6:37 [PATCH 0/4] libocrdma bug-fixes Devesh Sharma
     [not found] ` <1446446245-534-1-git-send-email-devesh.sharma-1wcpHE2jlwO1Z/+hSey0Gg@public.gmane.org>
2015-11-02  6:37   ` [PATCH 1/4] RDMA/libocrdma:sync qp-state with hw state Devesh Sharma
2015-11-02  6:37   ` [PATCH 2/4] RDMA/libocrdma: set vlan present bit for UD Devesh Sharma
2015-11-02  6:37   ` [PATCH 3/4] RDMA/libocrdma: Prevent CQ-Doorbell floods Devesh Sharma
2015-11-02  6:37   ` [PATCH 4/4] RDMA/libocrdma: update libocrdma version string 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).