From patchwork Sun May 18 09:38:46 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Or Gerlitz X-Patchwork-Id: 4197701 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.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 2EB85BEEAB for ; Sun, 18 May 2014 09:39:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 577D02034C for ; Sun, 18 May 2014 09:39:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 88401202DD for ; Sun, 18 May 2014 09:39:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750715AbaERJjA (ORCPT ); Sun, 18 May 2014 05:39:00 -0400 Received: from mailp.voltaire.com ([193.47.165.129]:54907 "EHLO mellanox.co.il" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1750764AbaERJi6 (ORCPT ); Sun, 18 May 2014 05:38:58 -0400 Received: from Internal Mail-Server by MTLPINE2 (envelope-from ogerlitz@mellanox.com) with SMTP; 18 May 2014 12:38:51 +0300 Received: from r-vnc04.mtr.labs.mlnx (r-vnc04.mtr.labs.mlnx [10.208.0.116]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id s4I9cogW021477; Sun, 18 May 2014 12:38:51 +0300 From: Or Gerlitz To: roland@kernel.org, yishaih@mellanox.com Cc: linux-rdma@vger.kernel.org, dledford@redhat.com, matanb@mellanox.com, Or Gerlitz Subject: [PATCH libibverbs V4 2/5] Extend create_ah in order to pass L2 parameters to the provider Date: Sun, 18 May 2014 12:38:46 +0300 Message-Id: <1400405929-14313-3-git-send-email-ogerlitz@r-vnc04.mtr.labs.mlnx> X-Mailer: git-send-email 1.7.8.2 In-Reply-To: <1400405929-14313-1-git-send-email-ogerlitz@r-vnc04.mtr.labs.mlnx> References: <1400405929-14313-1-git-send-email-ogerlitz@r-vnc04.mtr.labs.mlnx> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-7.5 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 From: Matan Barak In order to support IP based addressing, one needs to pass the L2 parameters to the provider drive. This is done through a new extendable interface between libibverbs and the provider library. Signed-off-by: Matan Barak Signed-off-by: Or Gerlitz --- include/infiniband/verbs.h | 25 +++++++++++++++++++++++++ 1 files changed, 25 insertions(+), 0 deletions(-) diff --git a/include/infiniband/verbs.h b/include/infiniband/verbs.h index 71adf2a..ab497b1 100644 --- a/include/infiniband/verbs.h +++ b/include/infiniband/verbs.h @@ -40,6 +40,7 @@ #include #include #include +#include #ifdef __cplusplus # define BEGIN_C_DECLS extern "C" { @@ -467,6 +468,28 @@ struct ibv_ah_attr { uint8_t port_num; }; +enum ibv_ah_attr_ex_attr_mask { + IBV_AH_ATTR_EX_LL = 1UL << 0, + IBV_AH_ATTR_EX_VID = 1UL << 1, +}; + +struct ibv_ah_attr_ex { + struct ibv_global_route grh; + uint16_t dlid; + uint8_t sl; + uint8_t src_path_bits; + uint8_t static_rate; + uint8_t is_global; + uint8_t port_num; + uint32_t comp_mask; + union { + struct sockaddr sa; + struct sockaddr_storage _s; + } ll; + uint16_t vid; +}; + + enum ibv_srq_attr_mask { IBV_SRQ_MAX_WR = 1 << 0, IBV_SRQ_LIMIT = 1 << 1 @@ -975,6 +998,8 @@ enum verbs_context_mask { struct verbs_context { /* "grows up" - new fields go here */ + struct ibv_ah * (*create_ah_ex)(struct ibv_pd *pd, + struct ibv_ah_attr_ex *attr); void (*_reserved_2)(void); int (*destroy_flow)(struct ibv_flow *flow); void (*_reserved_1)(void);