From patchwork Wed Jan 10 19:28:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Rosenbaum X-Patchwork-Id: 10155993 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 9743660231 for ; Wed, 10 Jan 2018 19:28:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8B2FE22F3E for ; Wed, 10 Jan 2018 19:28:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7FBE028358; Wed, 10 Jan 2018 19:28:54 +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=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID 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 F35E627D4D for ; Wed, 10 Jan 2018 19:28:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753601AbeAJT2u (ORCPT ); Wed, 10 Jan 2018 14:28:50 -0500 Received: from mail-it0-f67.google.com ([209.85.214.67]:46636 "EHLO mail-it0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753950AbeAJT2f (ORCPT ); Wed, 10 Jan 2018 14:28:35 -0500 Received: by mail-it0-f67.google.com with SMTP id c16so688038itc.5 for ; Wed, 10 Jan 2018 11:28:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to:cc; bh=qDg5yU4KTRb33/lZO69E5BRvKiVsFEJIVpzZMv0dQ+0=; b=JceHfkEa4Wy2ojU8u7ugHJTviZ2YRF+b7pHRGBx5uiDecIjokBzI9orwtltkVgVssx coBYSvq621OEDCL2XmKgwrdiKDKBMm8hKd6ovtp5nhl9YzDnh/3vtMPKjRGsDMO6+2Kd JXyMPPyT7mOrYPBLCPyQ9o0tnkioXQD0PipguG8+PuMUE7lxjPNALoM4yvXImIfRJV3V FZdg4TmgOtkStARKqhlT/S3PIipF2VP7zC0j88BtTtfjMt/rwJLUmV534YsJyX0U0J1L /ajO/sevTWxk+7ue/rbtnzdqLXRjg0AL2ofn5qzjpoN/Rcin2ghKh7PVXHssOpC9t7kT RDcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=qDg5yU4KTRb33/lZO69E5BRvKiVsFEJIVpzZMv0dQ+0=; b=L+lSOOhZ/sT8pZGYpGhNubGHHi9HLaPZDsvnI1ratpxMcCyBZuqE4MdZfOJ5g8x+Pp DoS43UDstl7VAtm5Ty3PC6kvKkEKFUqd6jSqmCreapb3SvOANUYYzk+bQGKa/VbGWS+G IQgVnfm0V8vVgKcft2NjEQwONu5N0WBXQxRuyASWEU51vFW8iDnpi7V0nPqeEaftJcmK jJyVgZHUc3QF5IWFLVyeLr0Zw7wY7zqfigl1YZaRNFb+RBOn2AMBgI/B9xidgNKXsP8s llsWhtOrjPrrMY3Qdghe2NqvOCjjCPwEeRc/dFiDE1w5/TwWN+2weYsrmPvycdR68qVs AF2g== X-Gm-Message-State: AKGB3mIrPwO9vD1aNV+N+PNcxLTvBBtFVxY7T+0vdb5RH+WhdCKMNKcF uDdrDgKJMIy2WHdZj+mZgOLl63csMXVAvVFhu31p3eH1 X-Google-Smtp-Source: ACJfBoubL8hmgWu8c4x1g4X6MnTnAdzj4sS3FU3zddhRDCz1OMAW+20zKI1mbaWmJ/Sl/p8ZIXv87qjSzEgyhWe1Xpk= X-Received: by 10.36.176.8 with SMTP id d8mr19231597itf.126.1515612514781; Wed, 10 Jan 2018 11:28:34 -0800 (PST) MIME-Version: 1.0 Received: by 10.2.74.150 with HTTP; Wed, 10 Jan 2018 11:28:34 -0800 (PST) From: Alex Rosenbaum Date: Wed, 10 Jan 2018 21:28:34 +0200 Message-ID: Subject: [PATCH RFC] Verbs requirement for GRH when working in GID based addressing To: linux-rdma@vger.kernel.org Cc: Yishai Hadas , Leon Romanovsky , "Alex @ Mellanox" , Majd Dibbiny , Artemy Kovalyov , Yossi Itigin 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 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 RFC exposes a new verbs port capability flag: GRH_REQUIRED. When GRH_REQUIRED port capability flag is set, the applications must create all AH with GRH configured. Meaning calling ibv_create_ah() with 'struct ibv_ah_attr { is_global = 1 }' Signed-off-by: Alex Rosenbaum --- libibverbs/man/ibv_create_ah.3 | 4 ++++ libibverbs/verbs.h | 3 ++- 2 files changed, 6 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/verbs.h b/libibverbs/verbs.h index 997597a..12e80b3 100644 --- a/libibverbs/verbs.h +++ b/libibverbs/verbs.h @@ -338,7 +338,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 {