From patchwork Sun May 13 15:37:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yishai Hadas X-Patchwork-Id: 10396273 X-Patchwork-Delegate: leon@leon.nu Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 81D06602B1 for ; Sun, 13 May 2018 15:38:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 67AD528646 for ; Sun, 13 May 2018 15:38:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5900E286DA; Sun, 13 May 2018 15:38:21 +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 C415428646 for ; Sun, 13 May 2018 15:38:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751690AbeEMPiS (ORCPT ); Sun, 13 May 2018 11:38:18 -0400 Received: from mail-il-dmz.mellanox.com ([193.47.165.129]:42820 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751489AbeEMPiS (ORCPT ); Sun, 13 May 2018 11:38:18 -0400 Received: from Internal Mail-Server by MTLPINE1 (envelope-from yishaih@mellanox.com) with ESMTPS (AES256-SHA encrypted); 13 May 2018 18:40:02 +0300 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 w4DFcF7W029791; Sun, 13 May 2018 18:38:15 +0300 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 w4DFcF1o002141; Sun, 13 May 2018 18:38:15 +0300 Received: (from yishaih@localhost) by vnc17.mtl.labs.mlnx (8.13.8/8.13.8/Submit) id w4DFcFsg002140; Sun, 13 May 2018 18:38:15 +0300 From: Yishai Hadas To: linux-rdma@vger.kernel.org Cc: yishaih@mellanox.com, artemyko@mellanox.com, Alexr@mellanox.com, Alex Rosenbaum Subject: [PATCH rdma-core 1/2] verbs: Expose IBV_PORT_GRH_REQUIRED port capability Date: Sun, 13 May 2018 18:37:56 +0300 Message-Id: <1526225877-2050-2-git-send-email-yishaih@mellanox.com> X-Mailer: git-send-email 1.8.2.3 In-Reply-To: <1526225877-2050-1-git-send-email-yishaih@mellanox.com> References: <1526225877-2050-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: Alex Rosenbaum RDMA applications require an indication they are operating in an environment which is based on GID addressing, such as SR-IOV IB Virtualization. In this mode, all sent traffic must include a GRH. This patch exposes a new port capability flag: IBV_PORT_GRH_REQUIRED. When this port capability flag is set, the applications must create all AH with GRH configured. Meaning calling ibv_create_ah() and ibv_modify_qp() with 'struct ibv_ah_attr { is_global = 1 }' Signed-off-by: Alex Rosenbaum Signed-off-by: Artemy Kovalyov Signed-off-by: Yishai Hadas --- libibverbs/man/ibv_create_ah.3 | 4 ++++ libibverbs/man/ibv_modify_qp.3 | 5 +++++ libibverbs/verbs.h | 3 ++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/libibverbs/man/ibv_create_ah.3 b/libibverbs/man/ibv_create_ah.3 index 0ca2198..b645ea3 100644 --- a/libibverbs/man/ibv_create_ah.3 +++ b/libibverbs/man/ibv_create_ah.3 @@ -53,6 +53,10 @@ destroys the AH .SH "RETURN VALUE" .B ibv_create_ah() returns a pointer to the created AH, or NULL if the request fails. +.SH "NOTES" +If port cap flag IBV_PORT_GRH_REQUIRED is set then +.B ibv_create_ah() +must be created with definition of 'struct ibv_ah_attr { .is_global = 1; .grh = {...}; }'. .PP .B ibv_destroy_ah() returns 0 on success, or the value of errno on failure (which indicates the failure reason). diff --git a/libibverbs/man/ibv_modify_qp.3 b/libibverbs/man/ibv_modify_qp.3 index 487aa94..33b4a48 100644 --- a/libibverbs/man/ibv_modify_qp.3 +++ b/libibverbs/man/ibv_modify_qp.3 @@ -172,6 +172,11 @@ Init \fB IBV_QP_STATE, IBV_QP_PORT\fR RTR \fB IBV_QP_STATE\fR RTS \fB IBV_QP_STATE\fR .fi +.PP +If port cap flag IBV_PORT_GRH_REQUIRED is set then +ah_attr and alt_ah_attr +must be passed with definition of 'struct ibv_ah_attr { .is_global = 1; .grh = {...}; }'. +.PP .SH "SEE ALSO" .BR ibv_create_qp (3), .BR ibv_destroy_qp (3), diff --git a/libibverbs/verbs.h b/libibverbs/verbs.h index eb57824..ddeeace 100644 --- a/libibverbs/verbs.h +++ b/libibverbs/verbs.h @@ -356,7 +356,8 @@ enum ibv_port_cap_flags { IBV_PORT_BOOT_MGMT_SUP = 1 << 23, IBV_PORT_LINK_LATENCY_SUP = 1 << 24, IBV_PORT_CLIENT_REG_SUP = 1 << 25, - IBV_PORT_IP_BASED_GIDS = 1 << 26 + IBV_PORT_IP_BASED_GIDS = 1 << 26, + IBV_PORT_GRH_REQUIRED = 1 << 27, }; struct ibv_port_attr {