From patchwork Tue Mar 20 21:18:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Gunthorpe X-Patchwork-Id: 10297963 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 9D2A0600F6 for ; Tue, 20 Mar 2018 21:19:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8BC392969D for ; Tue, 20 Mar 2018 21:19:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7E2CB296A1; Tue, 20 Mar 2018 21:19:20 +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 1AB582969D for ; Tue, 20 Mar 2018 21:19:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751458AbeCTVTS (ORCPT ); Tue, 20 Mar 2018 17:19:18 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:40676 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751475AbeCTVTK (ORCPT ); Tue, 20 Mar 2018 17:19:10 -0400 Received: by mail-wm0-f67.google.com with SMTP id t6so6215523wmt.5 for ; Tue, 20 Mar 2018 14:19:10 -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=ujrmvn665YBrtOrrtLVMy7HxgQjRUcMjYLwHmQ3klus=; b=haTr4KStL+AksPdA43mqwt6kg3+zPBIOYA0WWuD+YeCzRz1/oVUe5HvwiWRIT8WIhJ LGrNUmzuhMmz0WxE1QPgrjD6LOGOWT+wMr1iY0XkkQLe5zAEw9JTYLGHKH6WWikKoEGT 4uWjkPLIm+oyETGDbLlWJeh10Nd1xpqFmkDY/U2p/rCtETfTR36YBnkA4mrSJkGfzudD rOpzyhBcKeCM9RJu9IvNwvnkqs0TXoRcrdMylXPgMXc8wkdQKehqg4d9oU4ALCofxdhg ZDnij3MKibCK81C2LbXg/HE7CazOJ/VFkJwv9qbqhA3p5Pqs/ROiyhk+TCQm5gV6xyAT +EOQ== 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=ujrmvn665YBrtOrrtLVMy7HxgQjRUcMjYLwHmQ3klus=; b=a9+gtRXOmoLLw9iTUikAiywwNucMLNfaTWZbbudQOVQzBngTY0PNMMrRnR2oifWr3/ quFQtNv+TWTa8/DMamf0lbpSOahCUqJ0XnxZrqSh8jpRJJ7ZyHI97EHw4Dp7cXwJNwqJ dDjD8nWzTnACETnbw6S12kL6Mk+U4V5hbmLBd5UZzGHhh/YEZxyyPQAQjSBSO+lBoeMY 478vF4xKLI0z1+f11zXU4UZcv7t+11REiE57OlLtHsn02GloHEAZjwjTnqs18AAxKMaS VFBh9zU5cUH3L2++ohe13MEw/kgLFLRSEr58rTB2UlaKe20UxpiXbEqktY4XOemyHpHJ g9HQ== X-Gm-Message-State: AElRT7HGUow+EdSD4PglyBIOw2Af3NXPrpwwz4GYZpZ+KGFB9zEGTar0 iir/rKclls/n1knvt8eY3/7pAn/MXrc= X-Google-Smtp-Source: AG47ELvZvz1pkzHtqWFtyslfukM9d7SUGauWQ9o3+PUX2bjpoInh6W7CkNdfJfL5ebQJVFrnMB/NWQ== X-Received: by 10.28.0.88 with SMTP id 85mr788313wma.63.1521580749349; Tue, 20 Mar 2018 14:19:09 -0700 (PDT) Received: from ziepe.ca (S010614cc2056d97f.ed.shawcable.net. [174.3.196.123]) by smtp.gmail.com with ESMTPSA id p4sm594473wrh.45.2018.03.20.14.19.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Mar 2018 14:19:08 -0700 (PDT) Received: from jgg by mlx.ziepe.ca with local (Exim 4.86_2) (envelope-from ) id 1eyOen-0002fs-M6; Tue, 20 Mar 2018 15:18:57 -0600 From: Jason Gunthorpe To: linux-rdma@vger.kernel.org Cc: Jason Gunthorpe , Vladimir Sokolovsky , Yishai Hadas , Matan Barak Subject: [PATCH rdma-core 14/20] mthca: Move mthca to exclusively use the kernel uapi headers Date: Tue, 20 Mar 2018 15:18:44 -0600 Message-Id: <20180320211850.10090-15-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/mthca/mthca-abi.h | 79 +++++++++---------------------------------- 2 files changed, 17 insertions(+), 63 deletions(-) diff --git a/kernel-headers/CMakeLists.txt b/kernel-headers/CMakeLists.txt index 035bc60b35dee5..c7ad8254e3448e 100644 --- a/kernel-headers/CMakeLists.txt +++ b/kernel-headers/CMakeLists.txt @@ -59,6 +59,7 @@ rdma_kernel_provider_abi( rdma/ib_user_verbs.h rdma/mlx4-abi.h rdma/mlx5-abi.h + rdma/mthca-abi.h rdma/nes-abi.h rdma/qedr-abi.h rdma/rdma_user_rxe.h diff --git a/providers/mthca/mthca-abi.h b/providers/mthca/mthca-abi.h index e965d040e68b78..ca909541e1242a 100644 --- a/providers/mthca/mthca-abi.h +++ b/providers/mthca/mthca-abi.h @@ -36,68 +36,21 @@ #include #include - -struct umthca_alloc_ucontext_resp { - struct ib_uverbs_get_context_resp ibv_resp; - __u32 qp_tab_size; - __u32 uarc_size; -}; - -struct umthca_alloc_pd_resp { - struct ib_uverbs_alloc_pd_resp ibv_resp; - __u32 pdn; - __u32 reserved; -}; - -struct umthca_reg_mr { - struct ibv_reg_mr ibv_cmd; - __u32 mr_attrs; - __u32 reserved; -}; - -struct umthca_create_cq { - struct ibv_create_cq ibv_cmd; - __u32 lkey; - __u32 pdn; - __u64 arm_db_page; - __u64 set_db_page; - __u32 arm_db_index; - __u32 set_db_index; -}; - -struct umthca_create_cq_resp { - struct ib_uverbs_create_cq_resp ibv_resp; - __u32 cqn; - __u32 reserved; -}; - -struct umthca_resize_cq { - struct ibv_resize_cq ibv_cmd; - __u32 lkey; - __u32 reserved; -}; - -struct umthca_create_srq { - struct ibv_create_srq ibv_cmd; - __u32 lkey; - __u32 db_index; - __u64 db_page; -}; - -struct umthca_create_srq_resp { - struct ib_uverbs_create_srq_resp ibv_resp; - __u32 srqn; - __u32 reserved; -}; - -struct umthca_create_qp { - struct ibv_create_qp ibv_cmd; - __u32 lkey; - __u32 reserved; - __u64 sq_db_page; - __u64 rq_db_page; - __u32 sq_db_index; - __u32 rq_db_index; -}; +#include + +DECLARE_DRV_CMD(umthca_alloc_pd, IB_USER_VERBS_CMD_ALLOC_PD, + empty, mthca_alloc_pd_resp); +DECLARE_DRV_CMD(umthca_create_cq, IB_USER_VERBS_CMD_CREATE_CQ, + mthca_create_cq, mthca_create_cq_resp); +DECLARE_DRV_CMD(umthca_create_qp, IB_USER_VERBS_CMD_CREATE_QP, + mthca_create_qp, empty); +DECLARE_DRV_CMD(umthca_create_srq, IB_USER_VERBS_CMD_CREATE_SRQ, + mthca_create_srq, mthca_create_srq_resp); +DECLARE_DRV_CMD(umthca_alloc_ucontext, IB_USER_VERBS_CMD_GET_CONTEXT, + empty, mthca_alloc_ucontext_resp); +DECLARE_DRV_CMD(umthca_reg_mr, IB_USER_VERBS_CMD_REG_MR, + mthca_reg_mr, empty); +DECLARE_DRV_CMD(umthca_resize_cq, IB_USER_VERBS_CMD_RESIZE_CQ, + mthca_resize_cq, empty); #endif /* MTHCA_ABI_H */