From patchwork Tue Mar 20 21:18:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Gunthorpe X-Patchwork-Id: 10297941 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 50EC960349 for ; Tue, 20 Mar 2018 21:19:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 416E32969A for ; Tue, 20 Mar 2018 21:19:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3601B296A1; Tue, 20 Mar 2018 21:19:08 +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 B6AF22969A for ; Tue, 20 Mar 2018 21:19:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751456AbeCTVTG (ORCPT ); Tue, 20 Mar 2018 17:19:06 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:54660 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751319AbeCTVTD (ORCPT ); Tue, 20 Mar 2018 17:19:03 -0400 Received: by mail-wm0-f68.google.com with SMTP id h76so6139625wme.4 for ; Tue, 20 Mar 2018 14:19:03 -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=fu4nvjqZP6n0MRpwBydFYQWhLR3mhKnFUPbtj3E1EMY=; b=WCNG4vOJnGItTcAKB58CotPhF/seRADV30TwjVtVMqQAQrDhusH/55/WHjAmytsFpP SOsHh05D4vexYLrNqgHhsXebjcJmVNetxQUeSc+wVOHkJrfLYK9g5xQHWdz/zOsUay4I 81Do3k0cJKZgxcehypvlGlQWzYGHqCaOyF3RQWQ1kSPClraQvjkExdySWWyjC8bo2LaD sSrM+hkLXtoCg4qHeBDY8jhh9M0nbckaqMpK+jzFsz7OEf4ygPyKxkyuVqczVyhpFpOZ 2PFvrVraAc4O1+zfGqy72a7lQLNyJ8HbSoibKEuBQO64z1fVeAlK4ROKfDfiP2qY6QS2 4Ryg== 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=fu4nvjqZP6n0MRpwBydFYQWhLR3mhKnFUPbtj3E1EMY=; b=Zfd/Iybb7B+4vswus106+8UC4ZzX8fUEI8uxOkQtvUZA+X5KprwaNCUoqyI59IAYre kGkT7acr3hJz920hlVCDsWbDyttVeIlqQ0i2AQPX+NpyZl6pv+lls3i4cfQosqn+YX0g dOyYXlwSahWoSYEWIBn1weTkqQGiofcgdoGUjUydGZCtx7xBXWdRa2V5pLnTS/32lWHW taqrqZhAF1YxMBwKdaXTKFVB9dsnVBDMHE0xyzB9M5Rr+G1HPDTodSxpJq4CwrM/lF0a 5CXCF5dDAwWz7VHEswlLJABk+tjxn+ND5+CWQz9rif1uS7k72U2OVKaaOw5gibZj6/Kl 5hIw== X-Gm-Message-State: AElRT7HN9YlT3AiS4E7TaaFixcxus5E194D7ini7K4JL5WZVICuy0af4 JWYTC+lFv4FCtmR/HTk8MsmkGRdsEf8= X-Google-Smtp-Source: AG47ELtoHqMsPbJ1cl6lHjVz8tEBpDYTD/bK8v4FwxGJQB8Epehd+4pTHhDvPm1pk6Qb/1vHqv5itw== X-Received: by 10.28.44.134 with SMTP id s128mr795281wms.85.1521580741886; Tue, 20 Mar 2018 14:19:01 -0700 (PDT) Received: from ziepe.ca (S010614cc2056d97f.ed.shawcable.net. [174.3.196.123]) by smtp.gmail.com with ESMTPSA id v9sm2330221wre.96.2018.03.20.14.18.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Mar 2018 14:18:59 -0700 (PDT) Received: from jgg by mlx.ziepe.ca with local (Exim 4.86_2) (envelope-from ) id 1eyOem-0002eG-Ug; Tue, 20 Mar 2018 15:18:56 -0600 From: Jason Gunthorpe To: linux-rdma@vger.kernel.org Cc: Jason Gunthorpe , Moni Shoua , Yishai Hadas , Matan Barak Subject: [PATCH rdma-core 02/20] rxe: Move rxe to exclusively use the kernel uapi headers Date: Tue, 20 Mar 2018 15:18:32 -0600 Message-Id: <20180320211850.10090-3-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 Useing the driver support macros we can now directly create the required driver structs automatically. Only mmap_info needed to be renamed, using this script: $ sed -i \ -e 's/struct[ \t]mmap_info\([ \t,]\)/struct mminfo\1/g'\ `git ls-files` Signed-off-by: Jason Gunthorpe --- kernel-headers/CMakeLists.txt | 1 + providers/rxe/rxe-abi.h | 46 ++++++++++++------------------------------- providers/rxe/rxe.c | 4 ++-- providers/rxe/rxe.h | 8 ++++---- 4 files changed, 20 insertions(+), 39 deletions(-) diff --git a/kernel-headers/CMakeLists.txt b/kernel-headers/CMakeLists.txt index e8fb9a2464ead9..365b4c57cd7095 100644 --- a/kernel-headers/CMakeLists.txt +++ b/kernel-headers/CMakeLists.txt @@ -57,4 +57,5 @@ endfunction() rdma_kernel_provider_abi( rdma/ib_user_verbs.h rdma/qedr-abi.h + rdma/rdma_user_rxe.h ) diff --git a/providers/rxe/rxe-abi.h b/providers/rxe/rxe-abi.h index 78535a59014cf6..b4680a24dd16b5 100644 --- a/providers/rxe/rxe-abi.h +++ b/providers/rxe/rxe-abi.h @@ -36,38 +36,18 @@ #define RXE_ABI_H #include - -struct mmap_info { - __u64 offset; - __u32 size; - __u32 pad; -}; - -struct urxe_create_cq_resp { - struct ib_uverbs_create_cq_resp ibv_resp; - struct mmap_info mi; -}; - -struct urxe_resize_cq_resp { - struct ib_uverbs_resize_cq_resp ibv_resp; - struct mmap_info mi; -}; - -struct urxe_create_qp_resp { - struct ib_uverbs_create_qp_resp ibv_resp; - struct mmap_info rq_mi; - struct mmap_info sq_mi; -}; - -struct urxe_create_srq_resp { - struct ib_uverbs_create_srq_resp ibv_resp; - struct mmap_info mi; - __u32 srq_num; -}; - -struct urxe_modify_srq_cmd { - struct ibv_modify_srq ibv_cmd; - __u64 mmap_info_addr; -}; +#include +#include + +DECLARE_DRV_CMD(urxe_create_cq, IB_USER_VERBS_CMD_CREATE_CQ, + empty, rxe_create_cq_resp); +DECLARE_DRV_CMD(urxe_create_qp, IB_USER_VERBS_CMD_CREATE_QP, + empty, rxe_create_qp_resp); +DECLARE_DRV_CMD(urxe_create_srq, IB_USER_VERBS_CMD_CREATE_SRQ, + empty, rxe_create_srq_resp); +DECLARE_DRV_CMD(urxe_modify_srq, IB_USER_VERBS_CMD_MODIFY_SRQ, + rxe_modify_srq_cmd, empty); +DECLARE_DRV_CMD(urxe_resize_cq, IB_USER_VERBS_CMD_RESIZE_CQ, + empty, rxe_resize_cq_resp); #endif /* RXE_ABI_H */ diff --git a/providers/rxe/rxe.c b/providers/rxe/rxe.c index dbb8f94274ca32..1ced15be45c928 100644 --- a/providers/rxe/rxe.c +++ b/providers/rxe/rxe.c @@ -308,9 +308,9 @@ static int rxe_modify_srq(struct ibv_srq *ibsrq, struct ibv_srq_attr *attr, int attr_mask) { struct rxe_srq *srq = to_rsrq(ibsrq); - struct urxe_modify_srq_cmd cmd; + struct urxe_modify_srq cmd; int rc = 0; - struct mmap_info mi; + struct mminfo mi; mi.offset = 0; mi.size = 0; diff --git a/providers/rxe/rxe.h b/providers/rxe/rxe.h index 3fc0436127e432..96f4ee9cfba213 100644 --- a/providers/rxe/rxe.h +++ b/providers/rxe/rxe.h @@ -59,7 +59,7 @@ struct rxe_context { struct rxe_cq { struct ibv_cq ibv_cq; - struct mmap_info mmap_info; + struct mminfo mmap_info; struct rxe_queue *queue; pthread_spinlock_t lock; }; @@ -78,9 +78,9 @@ struct rxe_wq { struct rxe_qp { struct ibv_qp ibv_qp; - struct mmap_info rq_mmap_info; + struct mminfo rq_mmap_info; struct rxe_wq rq; - struct mmap_info sq_mmap_info; + struct mminfo sq_mmap_info; struct rxe_wq sq; unsigned int ssn; }; @@ -89,7 +89,7 @@ struct rxe_qp { struct rxe_srq { struct ibv_srq ibv_srq; - struct mmap_info mmap_info; + struct mminfo mmap_info; struct rxe_wq rq; uint32_t srq_num; };