diff mbox

[libibverbs,1/3] libibverbs: Add CQ ignore overrun creation flag

Message ID 1450610564-17279-2-git-send-email-leon@leon.nu (mailing list archive)
State Changes Requested
Headers show

Commit Message

Leon Romanovsky Dec. 20, 2015, 11:22 a.m. UTC
From: Leon Romanovsky <leonro@mellanox.com>

A CQ overrun is checked while posting a completion, and if
encountered, the QP is transferred to the appropriate error
state.

CQ update (and error discovery) are not synchronized with
WQE execution. Thus, a positive acknowledgement can be sent
to the remote request, and subsequently a CQ overrun may be
detected. Hardware may not write the CQE as a result of the
error, and the CQ will be transitioned to an error state as
well as the QP that caused the CQ error.

To avoid these errors, software usually ensures that the
number of WQEs posted to a QP does not exceed the number
of entries in the CQ associated with this QP. When multiple
QPs post completions into the same CQ, this check is cumulative.

CQ ignore overrun flag instructs the HW doesn't ring doorbells
on updates of CQ consumer counter (poll for completion) or
request completion notifications (Arm CQ).

Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
---
 include/infiniband/verbs.h |  7 ++++---
 man/ibv_create_cq_ex.3     | 10 ++++++++--
 2 files changed, 12 insertions(+), 5 deletions(-)
diff mbox

Patch

diff --git a/include/infiniband/verbs.h b/include/infiniband/verbs.h
index c3e863850d4e..d8069d52ae13 100644
--- a/include/infiniband/verbs.h
+++ b/include/infiniband/verbs.h
@@ -1201,12 +1201,13 @@  struct ibv_context {
 };
 
 enum ibv_create_cq_attr {
-	IBV_CREATE_CQ_ATTR_FLAGS	= 1 << 0,
-	IBV_CREATE_CQ_ATTR_RESERVED	= 1 << 1
+	IBV_CREATE_CQ_ATTR_FLAGS        = 1 << 0,
+	IBV_CREATE_CQ_ATTR_RESERVED     = 1 << 1
 };
 
 enum ibv_create_cq_attr_flags {
-	IBV_CREATE_CQ_ATTR_COMPLETION_TIMESTAMP	= 1 << 0,
+	IBV_CREATE_CQ_ATTR_COMPLETION_TIMESTAMP = 1 << 0,
+	IBV_CREATE_CQ_ATTR_IGNORE_OVERRUN       = 1 << 1
 };
 
 struct ibv_create_cq_attr_ex {
diff --git a/man/ibv_create_cq_ex.3 b/man/ibv_create_cq_ex.3
index 9f9e049b0d43..8670bd0a828b 100644
--- a/man/ibv_create_cq_ex.3
+++ b/man/ibv_create_cq_ex.3
@@ -42,13 +42,19 @@  enum ibv_wc_flags_ex {
         IBV_WC_EX_WITH_SLID                  = 1 << 7,  /* Require slid in WC */
         IBV_WC_EX_WITH_SL                    = 1 << 8,  /* Require sl in WC */
         IBV_WC_EX_WITH_DLID_PATH_BITS        = 1 << 9,  /* Require dlid path bits in WC */
-        IBV_WC_EX_WITH_COMPLETION_TIMESTAMP  = 1 << 10, /* Require completion timestamp in WC /*
+        IBV_WC_EX_WITH_COMPLETION_TIMESTAMP  = 1 << 10, /* Require completion timestamp in WC */
 };
 
+enum ibv_create_cq_attr_flags {
+	IBV_CREATE_CQ_ATTR_COMPLETION_TIMESTAMP	= 1 << 0,
+	IBV_CREATE_CQ_ATTR_IGNORE_OVERRUN	= 1 << 1
+};
 
 enum ibv_create_cq_attr {
-        IBV_CREATE_CQ_ATTR_FLAGS             = 1 << 0,
+	IBV_CREATE_CQ_ATTR_FLAGS	= 1 << 0,
+	IBV_CREATE_CQ_ATTR_RESERVED	= 1 << 1
 };
+
 .SH "RETURN VALUE"
 .B ibv_create_cq_ex()
 returns a pointer to the CQ, or NULL if the request fails.