From patchwork Mon Jan 28 13:56:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yishai Hadas X-Patchwork-Id: 10783711 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D6F9713BF for ; Mon, 28 Jan 2019 13:57:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C64502AD2A for ; Mon, 28 Jan 2019 13:57:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BA9EE2AD35; Mon, 28 Jan 2019 13:57:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 607232AD9C for ; Mon, 28 Jan 2019 13:57:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726750AbfA1N5A (ORCPT ); Mon, 28 Jan 2019 08:57:00 -0500 Received: from mail-il-dmz.mellanox.com ([193.47.165.129]:43499 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726714AbfA1N47 (ORCPT ); Mon, 28 Jan 2019 08:56:59 -0500 Received: from Internal Mail-Server by MTLPINE1 (envelope-from yishaih@mellanox.com) with ESMTPS (AES256-SHA encrypted); 28 Jan 2019 15:56:52 +0200 Received: from vnc17.mtl.labs.mlnx (vnc17.mtl.labs.mlnx [10.7.2.17]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id x0SDuqea028049; Mon, 28 Jan 2019 15:56:52 +0200 Received: from vnc17.mtl.labs.mlnx (vnc17.mtl.labs.mlnx [127.0.0.1]) by vnc17.mtl.labs.mlnx (8.13.8/8.13.8) with ESMTP id x0SDuqjd018432; Mon, 28 Jan 2019 15:56:52 +0200 Received: (from yishaih@localhost) by vnc17.mtl.labs.mlnx (8.13.8/8.13.8/Submit) id x0SDuqbp018431; Mon, 28 Jan 2019 15:56:52 +0200 From: Yishai Hadas To: linux-rdma@vger.kernel.org Cc: yishaih@mellanox.com, danitg@mellanox.com, monis@mellanox.com, jgg@mellanox.com, majd@mellanox.com Subject: [PATCH rdma-core 3/4] rdmacm: Add option to set ACK timeout Date: Mon, 28 Jan 2019 15:56:26 +0200 Message-Id: <1548683787-18270-4-git-send-email-yishaih@mellanox.com> X-Mailer: git-send-email 1.8.2.3 In-Reply-To: <1548683787-18270-1-git-send-email-yishaih@mellanox.com> References: <1548683787-18270-1-git-send-email-yishaih@mellanox.com> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Danit Goldberg Add new option to rdma_set_option that allows applications to override the RDMA-CM's QP ACK timeout value. Signed-off-by: Danit Goldberg Reviewed-by: Moni Shoua Signed-off-by: Yishai Hadas --- librdmacm/man/rdma_set_option.3 | 3 +++ librdmacm/rdma_cma.h | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/librdmacm/man/rdma_set_option.3 b/librdmacm/man/rdma_set_option.3 index 24b13e4..c6660c6 100644 --- a/librdmacm/man/rdma_set_option.3 +++ b/librdmacm/man/rdma_set_option.3 @@ -38,6 +38,9 @@ The expected optlen is size of int. .IP "RDMA_OPTION_IB_PATH" 12 Set IB path record data. The expected optlen is size of struct ibv_path_data[]. +.IP "RDMA_OPTION_ID_ACK_TIMEOUT" 12 +Set QP ACK timeout. +The value calculated according to the formula 4.096 * 2^(ack_timeout) usec. .SH "RETURN VALUE" Returns 0 on success, or -1 on error. If an error occurs, errno will be set to indicate the failure reason. diff --git a/librdmacm/rdma_cma.h b/librdmacm/rdma_cma.h index 2096a81..6f3f074 100644 --- a/librdmacm/rdma_cma.h +++ b/librdmacm/rdma_cma.h @@ -691,6 +691,10 @@ enum { RDMA_OPTION_ID_TOS = 0, /* uint8_t: RFC 2474 */ RDMA_OPTION_ID_REUSEADDR = 1, /* int: ~SO_REUSEADDR */ RDMA_OPTION_ID_AFONLY = 2, /* int: ~IPV6_V6ONLY */ + RDMA_OPTION_ID_ACK_TIMEOUT = 3 /* uint8_t */ +}; + +enum { RDMA_OPTION_IB_PATH = 1 /* struct ibv_path_data[] */ };