From patchwork Tue Mar 20 21:18:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Gunthorpe X-Patchwork-Id: 10298019 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 5895D602B3 for ; Tue, 20 Mar 2018 21:55:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4767129659 for ; Tue, 20 Mar 2018 21:55:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3C2DE29688; Tue, 20 Mar 2018 21:55: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_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 C888B29659 for ; Tue, 20 Mar 2018 21:55:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751408AbeCTVzw (ORCPT ); Tue, 20 Mar 2018 17:55:52 -0400 Received: from mail-it0-f66.google.com ([209.85.214.66]:53606 "EHLO mail-it0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751064AbeCTVzw (ORCPT ); Tue, 20 Mar 2018 17:55:52 -0400 Received: by mail-it0-f66.google.com with SMTP id b136-v6so4400754iti.3 for ; Tue, 20 Mar 2018 14:55:51 -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=K5+RgKnYE40fxXF1E7r7WHpeozXXGAdT8HXyYo6iltE=; b=CyeUeWyCUQBSK4B3tBjSoKPaRjQLYT18o6qa4V0ymYa15/uqGFMw3+KQ/ApsozNO9Y BHPyrIMZXl/HnxNKAOhqpSJdcOa8LGcnyYTLXSwPI3soHCjm4ZcVTE494VN1VYbl5tAD t3hVLML91k8BliWPNKwMaM2PtwmMM9McjCi7QLfmquok6wziVN1Xbt+SMMcBu/ryk4Gn 9ApnIkK5TPoZteP3Qba1YzdtfAKMDE4JW5/cv4/v7baKQYpXlq6G6kD9lD9kO+np9XrZ TeT33c+1yQLR4UQnhgtCHzlTe2E4K3KrlIrmQyB84C6TqMwpPRymJSuzZqSi9L2HtKSl 258A== 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=K5+RgKnYE40fxXF1E7r7WHpeozXXGAdT8HXyYo6iltE=; b=Wm5XO3rzkpqi+DwwvLlm2ECtbvui7rHE0G2OdK7+2KDXf17hamcFdD4GyNpIJ6fK8F fjBI1lMlArewGdeJRpNclr3PpTMorGiaNm9Z8lpI1tF9ulLtSXYD0LkrIOfPudvu1qCf 5QwCxnaB2mZMvnxKN8tdnwHd/FL20SuUWAAdm5lDOhNxNgper4JHo7iEpxJBor+tzdFW 3wVuM/Fn8gaPr5Y9tRlRZzklaGBmO7aCskFcLzXfz57mL2tiQAyu31l+Rc9LvrmENZB9 Gfl+RiBGb3S+QaA/7b+Y/HFUxMKpdq2mWbcBgOPJaOWpB+pbpbojh6GvT804Vgupo1C+ LVqA== X-Gm-Message-State: AElRT7G94/CS3rY8pVOs9ozyP+R5kClklWvnJEiIBGE1tl38XLhAPgbv Y6fpdd0q7G5MFsoH6+br5ki+VUzZuAw= X-Google-Smtp-Source: AG47ELs7PMppMFBSH2RZwLaMaGAxDIvc3Milv9ml+M1LJHMogwZnAhpbYIuBQ4oTfhVfUkkblJUg5A== X-Received: by 2002:a24:7c8a:: with SMTP id a132-v6mr1452381itd.113.1521582951156; Tue, 20 Mar 2018 14:55:51 -0700 (PDT) Received: from ziepe.ca (S010614cc2056d97f.ed.shawcable.net. [174.3.196.123]) by smtp.gmail.com with ESMTPSA id 129-v6sm532145itx.23.2018.03.20.14.55.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Mar 2018 14:55:50 -0700 (PDT) Received: from jgg by mlx.ziepe.ca with local (Exim 4.86_2) (envelope-from ) id 1eyOen-0002fb-Hp; Tue, 20 Mar 2018 15:18:57 -0600 From: Jason Gunthorpe To: linux-rdma@vger.kernel.org Cc: Jason Gunthorpe , Steve Wise , Yishai Hadas , Matan Barak Subject: [PATCH rdma-core 12/20] cxgb4: Move cxgb4 to exclusively use the kernel uapi headers Date: Tue, 20 Mar 2018 15:18:42 -0600 Message-Id: <20180320211850.10090-13-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 Acked-by: Steve Wise --- kernel-headers/CMakeLists.txt | 1 + providers/cxgb4/cxgb4-abi.h | 80 +++++++++++++++---------------------------- providers/cxgb4/verbs.c | 2 +- 3 files changed, 30 insertions(+), 53 deletions(-) diff --git a/kernel-headers/CMakeLists.txt b/kernel-headers/CMakeLists.txt index b884e68b1f20a0..035bc60b35dee5 100644 --- a/kernel-headers/CMakeLists.txt +++ b/kernel-headers/CMakeLists.txt @@ -55,6 +55,7 @@ endfunction() # Transform the kernel ABIs used by the providers rdma_kernel_provider_abi( + rdma/cxgb4-abi.h rdma/ib_user_verbs.h rdma/mlx4-abi.h rdma/mlx5-abi.h diff --git a/providers/cxgb4/cxgb4-abi.h b/providers/cxgb4/cxgb4-abi.h index f69894f73481e6..14fe8febc8e1c7 100644 --- a/providers/cxgb4/cxgb4-abi.h +++ b/providers/cxgb4/cxgb4-abi.h @@ -35,59 +35,35 @@ #include #include #include +#include -struct uc4iw_alloc_ucontext_resp { - struct ib_uverbs_get_context_resp ibv_resp; - __u64 status_page_key; - __u32 status_page_size; - __u32 reserved; -}; +/* compat for ABI version 0 */ +#define _c4iw_create_qp_resp_v0 \ + { \ + __u64 sq_key; \ + __u64 rq_key; \ + __u64 sq_db_gts_key; \ + __u64 rq_db_gts_key; \ + __u64 sq_memsize; \ + __u64 rq_memsize; \ + __u32 sqid; \ + __u32 rqid; \ + __u32 sq_size; \ + __u32 rq_size; \ + __u32 qid_mask; \ + }; +struct c4iw_create_qp_resp_v0 _c4iw_create_qp_resp_v0; +#define _STRUCT_c4iw_create_qp_resp_v0 struct _c4iw_create_qp_resp_v0 -struct uc4iw_alloc_pd_resp { - struct ib_uverbs_alloc_pd_resp ibv_resp; - uint32_t pdid; -}; +DECLARE_DRV_CMD(uc4iw_alloc_pd, IB_USER_VERBS_CMD_ALLOC_PD, + empty, c4iw_alloc_pd_resp); +DECLARE_DRV_CMD(uc4iw_create_cq, IB_USER_VERBS_CMD_CREATE_CQ, + empty, c4iw_create_cq_resp); +DECLARE_DRV_CMD(uc4iw_create_qp, IB_USER_VERBS_CMD_CREATE_QP, + empty, c4iw_create_qp_resp); +DECLARE_DRV_CMD(uc4iw_create_qp_v0, IB_USER_VERBS_CMD_CREATE_QP, + empty, c4iw_create_qp_resp_v0); +DECLARE_DRV_CMD(uc4iw_alloc_ucontext, IB_USER_VERBS_CMD_GET_CONTEXT, + empty, c4iw_alloc_ucontext_resp); -struct uc4iw_create_cq_resp { - struct ib_uverbs_create_cq_resp ibv_resp; - __u64 key; - __u64 gts_key; - __u64 memsize; - __u32 cqid; - __u32 size; - __u32 qid_mask; - __u32 reserved; -}; - -struct uc4iw_create_qp_resp_v0 { - struct ib_uverbs_create_qp_resp ibv_resp; - __u64 sq_key; - __u64 rq_key; - __u64 sq_db_gts_key; - __u64 rq_db_gts_key; - __u64 sq_memsize; - __u64 rq_memsize; - __u32 sqid; - __u32 rqid; - __u32 sq_size; - __u32 rq_size; - __u32 qid_mask; -}; - -struct uc4iw_create_qp_resp { - struct ib_uverbs_create_qp_resp ibv_resp; - __u64 ma_sync_key; - __u64 sq_key; - __u64 rq_key; - __u64 sq_db_gts_key; - __u64 rq_db_gts_key; - __u64 sq_memsize; - __u64 rq_memsize; - __u32 sqid; - __u32 rqid; - __u32 sq_size; - __u32 rq_size; - __u32 qid_mask; - __u32 flags; -}; #endif /* IWCH_ABI_H */ diff --git a/providers/cxgb4/verbs.c b/providers/cxgb4/verbs.c index b50a37b2771090..3c493697321b6b 100644 --- a/providers/cxgb4/verbs.c +++ b/providers/cxgb4/verbs.c @@ -303,7 +303,7 @@ static struct ibv_qp *create_qp_v0(struct ibv_pd *pd, struct ibv_qp_init_attr *attr) { struct ibv_create_qp cmd; - struct uc4iw_create_qp_resp_v0 resp; + struct uc4iw_create_qp_v0_resp resp; struct c4iw_qp *qhp; struct c4iw_dev *dev = to_c4iw_dev(pd->context->device); int ret;