From patchwork Tue Oct 27 16:51:39 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matan Barak X-Patchwork-Id: 7498811 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 AC354BEEA4 for ; Tue, 27 Oct 2015 16:54:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CA60520661 for ; Tue, 27 Oct 2015 16:54:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4C05B208CE for ; Tue, 27 Oct 2015 16:54:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932602AbbJ0Qyk (ORCPT ); Tue, 27 Oct 2015 12:54:40 -0400 Received: from [193.47.165.129] ([193.47.165.129]:51658 "EHLO mellanox.co.il" rhost-flags-FAIL-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S932595AbbJ0Qyi (ORCPT ); Tue, 27 Oct 2015 12:54:38 -0400 Received: from Internal Mail-Server by MTLPINE1 (envelope-from matanb@mellanox.com) with ESMTPS (AES256-SHA encrypted); 27 Oct 2015 18:54:01 +0200 Received: from rsws33.mtr.labs.mlnx (dev-r-vrt-064.mtr.labs.mlnx [10.212.64.1]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id t9RGs0aS018446; Tue, 27 Oct 2015 18:54:01 +0200 From: Matan Barak To: Doug Ledford Cc: linux-rdma@vger.kernel.org, Matan Barak , Eran Ben Elisha , Jason Gunthorpe , Christoph Lameter Subject: [PATCH libibverbs 4/5] Add completion timestmap support for ibv_poll_cq_ex Date: Tue, 27 Oct 2015 18:51:39 +0200 Message-Id: <1445964700-13235-5-git-send-email-matanb@mellanox.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1445964700-13235-1-git-send-email-matanb@mellanox.com> References: <1445964700-13235-1-git-send-email-matanb@mellanox.com> 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.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, 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 Add support for raw completion timestamp through ibv_poll_cq_ex. Signed-off-by: Matan Barak --- include/infiniband/verbs.h | 7 ++++++- man/ibv_poll_cq_ex.3 | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/include/infiniband/verbs.h b/include/infiniband/verbs.h index f80126a..3d66726 100644 --- a/include/infiniband/verbs.h +++ b/include/infiniband/verbs.h @@ -391,6 +391,7 @@ enum ibv_wc_flags_ex { IBV_WC_EX_WITH_SLID = 1 << 7, IBV_WC_EX_WITH_SL = 1 << 8, IBV_WC_EX_WITH_DLID_PATH_BITS = 1 << 9, + IBV_WC_EX_WITH_COMPLETION_TIMESTAMP = 1 << 10, }; enum { @@ -409,6 +410,10 @@ enum { }; /* fields order in wc_ex + * // Raw timestamp of completion. A raw timestamp is implementation + * // defined and can not be relied upon to have any ordering value + * // between more than one HCA or driver. + * uint64_t completion_timestamp; * uint32_t byte_len, * uint32_t imm_data; // in network byte order * uint32_t qp_num; @@ -420,7 +425,7 @@ enum { */ enum { - IBV_WC_EX_WITH_64BIT_FIELDS = 0 + IBV_WC_EX_WITH_64BIT_FIELDS = IBV_WC_EX_WITH_COMPLETION_TIMESTAMP }; enum { diff --git a/man/ibv_poll_cq_ex.3 b/man/ibv_poll_cq_ex.3 index 8f336bc..3eb9bc0 100644 --- a/man/ibv_poll_cq_ex.3 +++ b/man/ibv_poll_cq_ex.3 @@ -54,12 +54,14 @@ IBV_WC_EX_WITH_PKEY_INDEX = 1 << 6, /* The returned wc_ex contain IBV_WC_EX_WITH_SLID = 1 << 7, /* The returned wc_ex contains slid field */ IBV_WC_EX_WITH_SL = 1 << 8, /* The returned wc_ex contains sl field */ IBV_WC_EX_WITH_DLID_PATH_BITS = 1 << 9, /* The returned wc_ex contains dlid_path_bits field */ +IBV_WC_EX_WITH_COMPLETION_TIMESTAMP = 1 << 10, /* The returned wc_ex contains completion_timestmap field */ .in -8 }; .fi wc_flags describes which of the fields in buffer[0] have a valid value. The order of these fields and sizes are always the following: .nf +uint64_t completion_timestamp; /* Raw timestamp of completion. Implementation defined. Can't be relied upon to have any ordering value between more than one driver/hca */ uint32_t byte_len, uint32_t imm_data; /* in network byte order */ uint32_t qp_num;