From patchwork Sun Dec 20 11:22:42 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leon Romanovsky X-Patchwork-Id: 7891751 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id C1728BEEE5 for ; Sun, 20 Dec 2015 11:24:05 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D1ED72047B for ; Sun, 20 Dec 2015 11:24:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A2D7020481 for ; Sun, 20 Dec 2015 11:24:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932453AbbLTLYC (ORCPT ); Sun, 20 Dec 2015 06:24:02 -0500 Received: from mail-wm0-f47.google.com ([74.125.82.47]:34525 "EHLO mail-wm0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754330AbbLTLYB (ORCPT ); Sun, 20 Dec 2015 06:24:01 -0500 Received: by mail-wm0-f47.google.com with SMTP id l126so36892431wml.1 for ; Sun, 20 Dec 2015 03:24:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leon-nu.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=BBnZdEaugQzz3DlWmIJn0rWIMV4nsJVvzG4MU+qqGvo=; b=h+Rg0Pp8LDuRsSdz412zZHHLUkLYeBGN5XqV4VGh96KXt68cMtCYVFg7SKEUm7TewN qD3vCJd8cvCBv4CX6b5nXXJLfh+EfCv4fYAblMjF5b0CQQuUe5sy0YKRdI4q2KjVr3Ef 7ZTg2x+eDFHULoREEvEEir7TKmvzIdp/01vbn4tztFlCbUtWBzcK5bE2lgxYq/QyIE7g tbyWtL4sPMGkA4si+ZvKCA82Ogwvg9JdHWG0Px5tBkIm4AfU58IMBJkIUTezWlY8CdfE +ur9aG9ZEtcJ94Y4a+jhyKUkw7RvfD7s3GZ7N+bHu8rLce2qtd4hPUZOdoso1kcZ3+1x FWIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=BBnZdEaugQzz3DlWmIJn0rWIMV4nsJVvzG4MU+qqGvo=; b=g7iVVVbR8rEdZp/CqrdNkDhoJ5JVQ26CezBWQ8KvZCKWq0if0/djW4NBsIBXqJDGgv tzAwlE+b7LtChzj1KvVjqhIgjXGMykSXaSJpYfdwc/V5udhbizL4Q8Qy30o6aLwtbG9t r9wNZYRQI9jooV8UdzD1oYHdKIV2eqjz89yItxpjDr73Uc3qxKJqJHXoh2zGOpQnrU+y Y8tBlOb0OcCY9oL5iNslRuFYloTOSRg/Z7MeH7fI+s0950K7gLTD1U3AzhGqUnZTwpUE dQQkR46lHJ2ICqn3IgcGtMYucRa+KFPzq9mioT0pqk+yo8CPAP7oM5olm3OjuHgGn+Zp D6Tw== X-Gm-Message-State: ALoCoQlkJxXpMxKYq9fTJFdsfpLKQ1SocYyUaBobtt9gF4kE7OvOZDPKbjjdf6AO79zbBWL2k3l19XCfbErZP4nyjIZD5ezJtw== X-Received: by 10.194.216.100 with SMTP id op4mr940260wjc.85.1450610640320; Sun, 20 Dec 2015 03:24:00 -0800 (PST) Received: from localhost ([213.57.247.249]) by smtp.gmail.com with ESMTPSA id u4sm23009245wjz.4.2015.12.20.03.23.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 20 Dec 2015 03:23:59 -0800 (PST) From: Leon Romanovsky To: dledford@redhat.com Cc: linux-rdma@vger.kernel.org, Leon Romanovsky Subject: [PATCH libibverbs 1/3] libibverbs: Add CQ ignore overrun creation flag Date: Sun, 20 Dec 2015 13:22:42 +0200 Message-Id: <1450610564-17279-2-git-send-email-leon@leon.nu> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1450610564-17279-1-git-send-email-leon@leon.nu> References: <1450610564-17279-1-git-send-email-leon@leon.nu> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Leon Romanovsky 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 --- include/infiniband/verbs.h | 7 ++++--- man/ibv_create_cq_ex.3 | 10 ++++++++-- 2 files changed, 12 insertions(+), 5 deletions(-) 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.