From patchwork Tue Mar 20 21:18:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Gunthorpe X-Patchwork-Id: 10298023 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 4D0E9602C2 for ; Tue, 20 Mar 2018 21:55:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3C6BC29659 for ; Tue, 20 Mar 2018 21:55:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3107729688; Tue, 20 Mar 2018 21:55:57 +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_SIGNED, 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 AFB3F29659 for ; Tue, 20 Mar 2018 21:55:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751064AbeCTVzz (ORCPT ); Tue, 20 Mar 2018 17:55:55 -0400 Received: from mail-io0-f194.google.com ([209.85.223.194]:33514 "EHLO mail-io0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751416AbeCTVzy (ORCPT ); Tue, 20 Mar 2018 17:55:54 -0400 Received: by mail-io0-f194.google.com with SMTP id l3so4234768iog.0 for ; Tue, 20 Mar 2018 14:55:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=TycIy/Fiq2pvBRhnwO7MBy/CCKc9NQDLk5pO4nlLgmk=; b=UNHPC7InZdBq1PO7aUrMAXNSvnCyjn9E67maPPHxl3/D6r+frSFWVrWi5ciB+jFwZk Q+vCisLJKQYVRbBkaLysEWOO1GgPrjWYMVVVvETW2Kh1NT93+wVmXtHXVNqHlEDm0O2K hks7ECHlHEHL6U3L0Nsi6+0ASTEbGBHUQI0Il/hFnQFTWQRFPGo7q00Z0tFmUFBvJfsL qoP6ejk0W+nU4mkQ7TRVWPGFxyg3BRD6PZYFaOuFEJsvGiaM/PET0vDQaf4fAMbFQk4k 51B1p2Q4NMmRp3o2d1baZqgpoavwst3QXuNKTqxOm0Y9KIZqI9s89Yvwp542mcn3aQfx gBdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=TycIy/Fiq2pvBRhnwO7MBy/CCKc9NQDLk5pO4nlLgmk=; b=pvZznmd6pEzv9zNmxsw3agZD8s4V0Ty2Aa9xwjtppJ6EshhI1YRgAcDV1NOkFFtBL0 DCjB01ZVtkzmQn/b/+xmj1qoWb2qewf0kxdOtLbIcrf/CzpmI3A38HwSnv43taoDOfzL vAphDXUK30W6Z4wHwiJNVFSw9NRQfHUp/ymY9QBdJWu1iMc9MQ/Z0JuRYKzpoYvxJLGk dNVZcYj7nZ65k3pNTdM6p5ByhdU2zarsw94A0KH1s55Yo5zjH7BHYIoxkn4L+NnMMLvR Dp7CyEZhNnvLIFA6dKw+qtV3Wu4X6CMVHPTmnID65uLO4l5le8awC08HAJSa3csmKnX5 tf6Q== X-Gm-Message-State: AElRT7Hxkv4ef6rxeMoClwG24kZvPUhA0/T0cDxuV3lcis2992vAzsdD xd+xzin5e0UdZdWwwKRC0RaQxbSPSL0= X-Google-Smtp-Source: AG47ELvGMmXVNa7KkdPy5UXh9YmUtT/xuTTN7U1gHNHlUmg5TbGJvIV0V3ciHt2lqLjNU9oQZmsNvw== X-Received: by 10.107.168.144 with SMTP id e16mr17252692ioj.180.1521582954112; Tue, 20 Mar 2018 14:55:54 -0700 (PDT) Received: from ziepe.ca (S010614cc2056d97f.ed.shawcable.net. [174.3.196.123]) by smtp.gmail.com with ESMTPSA id e9sm1770924ioj.47.2018.03.20.14.55.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Mar 2018 14:55:53 -0700 (PDT) Received: from jgg by mlx.ziepe.ca with local (Exim 4.86_2) (envelope-from ) id 1eyOeo-0002go-2d; Tue, 20 Mar 2018 15:18:58 -0600 From: Jason Gunthorpe To: linux-rdma@vger.kernel.org Cc: Jason Gunthorpe , Tatyana Nikolova , Yishai Hadas , Matan Barak Subject: [PATCH rdma-core 20/20] i40iw: Move i40iw to exclusively use the kernel uapi headers Date: Tue, 20 Mar 2018 15:18:50 -0600 Message-Id: <20180320211850.10090-21-jgg@ziepe.ca> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180320211850.10090-1-jgg@ziepe.ca> References: <20180320211850.10090-1-jgg@ziepe.ca> 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: Jason Gunthorpe Using the driver support macros we can now directly create the required driver structs automatically. Signed-off-by: Jason Gunthorpe --- kernel-headers/CMakeLists.txt | 1 + providers/i40iw/i40iw-abi.h | 70 +++++++------------------------------------ providers/i40iw/i40iw_umain.c | 2 +- 3 files changed, 13 insertions(+), 60 deletions(-) diff --git a/kernel-headers/CMakeLists.txt b/kernel-headers/CMakeLists.txt index 2c062f8d17a67b..1c4662007a02a3 100644 --- a/kernel-headers/CMakeLists.txt +++ b/kernel-headers/CMakeLists.txt @@ -58,6 +58,7 @@ rdma_kernel_provider_abi( rdma/bnxt_re-abi.h rdma/cxgb4-abi.h rdma/hns-abi.h + rdma/i40iw-abi.h rdma/ib_user_verbs.h rdma/mlx4-abi.h rdma/mlx5-abi.h diff --git a/providers/i40iw/i40iw-abi.h b/providers/i40iw/i40iw-abi.h index 469cf3d12104d0..1fee9177f20ac0 100644 --- a/providers/i40iw/i40iw-abi.h +++ b/providers/i40iw/i40iw-abi.h @@ -37,67 +37,19 @@ #include #include +#include #define I40IW_ABI_VER 5 -struct i40iw_get_context { - struct ibv_get_context cmd; - __u32 reserved32; - __u8 userspace_ver; - __u8 reserved8[3]; -}; - -struct i40iw_ualloc_ucontext_resp { - struct ib_uverbs_get_context_resp ibv_resp; - __u32 max_pds; /* maximum pds allowed for this user process */ - __u32 max_qps; /* maximum qps allowed for this user process */ - __u32 wq_size; /* defines the size of the WQs (sq+rq) allocated to the mmaped area */ - __u8 kernel_ver; - __u8 reserved[3]; -}; - -struct i40iw_ualloc_pd_resp { - struct ib_uverbs_alloc_pd_resp ibv_resp; - __u32 pd_id; - __u8 reserved[4]; -}; - -struct i40iw_ucreate_cq { - struct ibv_create_cq ibv_cmd; - __u64 user_cq_buffer; -}; - -struct i40iw_ucreate_cq_resp { - struct ib_uverbs_create_cq_resp ibv_resp; - __u32 cq_id; - __u32 cq_size; - __u32 mmap_db_index; - __u32 reserved; -}; - -struct i40iw_ureg_mr { - struct ibv_reg_mr ibv_cmd; - __u16 reg_type; - __u16 cq_pages; - __u16 rq_pages; - __u16 sq_pages; -}; - -struct i40iw_ucreate_qp { - struct ibv_create_qp ibv_cmd; - __u64 user_wqe_buffers; - __u64 user_compl_ctx; -}; - -struct i40iw_ucreate_qp_resp { - struct ib_uverbs_create_qp_resp ibv_resp; - __u32 qp_id; - __u32 actual_sq_size; - __u32 actual_rq_size; - __u32 i40iw_drv_opt; - __u16 push_idx; - __u8 rsvd1; - __u8 rsvd2; -}; +DECLARE_DRV_CMD(i40iw_ualloc_pd, IB_USER_VERBS_CMD_ALLOC_PD, + empty, i40iw_alloc_pd_resp); +DECLARE_DRV_CMD(i40iw_ucreate_cq, IB_USER_VERBS_CMD_CREATE_CQ, + i40iw_create_cq_req, i40iw_create_cq_resp); +DECLARE_DRV_CMD(i40iw_ucreate_qp, IB_USER_VERBS_CMD_CREATE_QP, + i40iw_create_qp_req, i40iw_create_qp_resp); +DECLARE_DRV_CMD(i40iw_get_context, IB_USER_VERBS_CMD_GET_CONTEXT, + i40iw_alloc_ucontext_req, i40iw_alloc_ucontext_resp); +DECLARE_DRV_CMD(i40iw_ureg_mr, IB_USER_VERBS_CMD_REG_MR, + i40iw_mem_reg_req, empty); #endif /* I40IW_ABI_H */ diff --git a/providers/i40iw/i40iw_umain.c b/providers/i40iw/i40iw_umain.c index b16988132f2285..467709fc8cbe2d 100644 --- a/providers/i40iw/i40iw_umain.c +++ b/providers/i40iw/i40iw_umain.c @@ -132,7 +132,7 @@ static struct verbs_context *i40iw_ualloc_context(struct ibv_device *ibdev, struct ibv_pd *ibv_pd; struct i40iw_uvcontext *iwvctx; struct i40iw_get_context cmd; - struct i40iw_ualloc_ucontext_resp resp; + struct i40iw_get_context_resp resp; iwvctx = verbs_init_and_alloc_context(ibdev, cmd_fd, iwvctx, ibv_ctx, RDMA_DRIVER_I40IW);