From patchwork Tue Mar 20 21:18:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Gunthorpe X-Patchwork-Id: 10297955 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 89F0F600F6 for ; Tue, 20 Mar 2018 21:19:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7BAE22969D for ; Tue, 20 Mar 2018 21:19:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7091D296A1; Tue, 20 Mar 2018 21:19:17 +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 1FB5A2969D for ; Tue, 20 Mar 2018 21:19:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751448AbeCTVTO (ORCPT ); Tue, 20 Mar 2018 17:19:14 -0400 Received: from mail-wr0-f194.google.com ([209.85.128.194]:43455 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751411AbeCTVTJ (ORCPT ); Tue, 20 Mar 2018 17:19:09 -0400 Received: by mail-wr0-f194.google.com with SMTP id o1so3159019wro.10 for ; Tue, 20 Mar 2018 14:19:09 -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=YhSGe3Mqnn0Ko90M+0yfFaGM+WEtgB/xuig4L/6CYsY=; b=PZbk9Iy2tPYl/xdwc0+0VKBZaAwh+gk9TXiJTaZZG7AmEGAP8gtQIoRr/7B4E6Lw06 OKoj1hdMRISmR17Z4GYCjvNnoqaM3K406wP5cUIYX2/8w2LX9NvF5a7uRMIZfqsu2xo0 kQJe/q7K5uC77mmEy6+1sD6FuN1lyzz8NJle70uTFLT36ZCj1FTfGxKJrvY/TrgtItkQ S+loirjxjC8LniMZl+EMYiVBKYRB2ceCWcc6gtPYwJ38NIh4+B9AnIPNd9lAjaS/mZ1w gsZmfUHbcIDRy+6YM5tvtvmFWwZB8z0EKNon2PNWyV3ut49Dq4Am+cubjn3VcAjlJ8/G pIyA== 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=YhSGe3Mqnn0Ko90M+0yfFaGM+WEtgB/xuig4L/6CYsY=; b=DdZh7MYJnlHBkEdbq/d8l2EfQLYVmhZ0bI5RTuZ6hni14QNe0LkDVpy3IFfMk+0nI9 zffDRKg35AlrFve25blBtPTeXpmc5ONFmql/zCAe3SQ2e8UikazdxQ4UQPZzTeY2sbxI 5+snokwH/lZSO1zMt/BVX+MZ1fI9pj5kO2xUonQ6TnG24PQFNBlYYZomVTpNt29h3swR f4ngo854MUk2pjXDsV73G/qzJ1eOvfehzrQYAGsZ03/kcJia1UkuQslJS49ycOqvlAer 3erUbASBxsd6puvfG5ZqByVKBGpKPoStj3fKeMUgNbcZ420c1w6EkGvHLAbAqVaSC3y2 U4sg== X-Gm-Message-State: AElRT7FQCpLXj4r4cVwbhabLzE1jIYuJ/KtX8xUMGG96tPhLa2k7h0DC cn0GYWaBf2EonXd/ChXNtUmO8hzMcv0= X-Google-Smtp-Source: AG47ELsDWVNLdos6vsRzyStpLf77sM/BcJAdAuq6FKsA6wZ648gv1+5buyDcEio20IL3nghrCkbXUw== X-Received: by 10.223.199.10 with SMTP id k10mr13879633wrg.186.1521580748220; Tue, 20 Mar 2018 14:19:08 -0700 (PDT) Received: from ziepe.ca (S010614cc2056d97f.ed.shawcable.net. [174.3.196.123]) by smtp.gmail.com with ESMTPSA id v23sm2516451wmc.22.2018.03.20.14.19.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Mar 2018 14:19:05 -0700 (PDT) Received: from jgg by mlx.ziepe.ca with local (Exim 4.86_2) (envelope-from ) id 1eyOen-0002gC-RP; Tue, 20 Mar 2018 15:18:57 -0600 From: Jason Gunthorpe To: linux-rdma@vger.kernel.org Cc: Jason Gunthorpe , Lijun Ou , "Wei Hu(Xavier)" , Yishai Hadas , Matan Barak Subject: [PATCH rdma-core 16/20] hns: Move hns to exclusively use the kernel uapi headers Date: Tue, 20 Mar 2018 15:18:46 -0600 Message-Id: <20180320211850.10090-17-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/hns/hns_roce_u_abi.h | 44 +++++++++++------------------------------- 2 files changed, 12 insertions(+), 33 deletions(-) diff --git a/kernel-headers/CMakeLists.txt b/kernel-headers/CMakeLists.txt index 46147f5827c490..8f41b6e98b54f5 100644 --- a/kernel-headers/CMakeLists.txt +++ b/kernel-headers/CMakeLists.txt @@ -56,6 +56,7 @@ endfunction() # Transform the kernel ABIs used by the providers rdma_kernel_provider_abi( rdma/cxgb4-abi.h + rdma/hns-abi.h rdma/ib_user_verbs.h rdma/mlx4-abi.h rdma/mlx5-abi.h diff --git a/providers/hns/hns_roce_u_abi.h b/providers/hns/hns_roce_u_abi.h index 251a5c920a3557..09a920ec71ec1e 100644 --- a/providers/hns/hns_roce_u_abi.h +++ b/providers/hns/hns_roce_u_abi.h @@ -34,38 +34,16 @@ #define _HNS_ROCE_U_ABI_H #include - -struct hns_roce_alloc_ucontext_resp { - struct ib_uverbs_get_context_resp ibv_resp; - __u32 qp_tab_size; -}; - -struct hns_roce_alloc_pd_resp { - struct ib_uverbs_alloc_pd_resp ibv_resp; - __u32 pdn; - __u32 reserved; -}; - -struct hns_roce_create_cq { - struct ibv_create_cq ibv_cmd; - __u64 buf_addr; - __u64 db_addr; -}; - -struct hns_roce_create_cq_resp { - struct ib_uverbs_create_cq_resp ibv_resp; - __u32 cqn; - __u32 reserved; -}; - -struct hns_roce_create_qp { - struct ibv_create_qp ibv_cmd; - __u64 buf_addr; - __u64 db_addr; - __u8 log_sq_bb_count; - __u8 log_sq_stride; - __u8 sq_no_prefetch; - __u8 reserved[5]; -}; +#include +#include + +DECLARE_DRV_CMD(hns_roce_alloc_pd, IB_USER_VERBS_CMD_ALLOC_PD, + empty, hns_roce_ib_alloc_pd_resp); +DECLARE_DRV_CMD(hns_roce_create_cq, IB_USER_VERBS_CMD_CREATE_CQ, + hns_roce_ib_create_cq, hns_roce_ib_create_cq_resp); +DECLARE_DRV_CMD(hns_roce_create_qp, IB_USER_VERBS_CMD_CREATE_QP, + hns_roce_ib_create_qp, empty); +DECLARE_DRV_CMD(hns_roce_alloc_ucontext, IB_USER_VERBS_CMD_GET_CONTEXT, + empty, hns_roce_ib_alloc_ucontext_resp); #endif /* _HNS_ROCE_U_ABI_H */