From patchwork Thu Nov 3 19:16:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: longli@linuxonhyperv.com X-Patchwork-Id: 15114 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp720473wru; Thu, 3 Nov 2022 12:18:51 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4YMUrHrdmeAxEbhYDlg/O6DfkrUTkYCCNrq9wWr1CdM+nd+e6tB4N/Ggk0nZHMwcS2IWgU X-Received: by 2002:a17:90a:480b:b0:213:82b3:1fe7 with SMTP id a11-20020a17090a480b00b0021382b31fe7mr32762432pjh.34.1667503131211; Thu, 03 Nov 2022 12:18:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667503131; cv=none; d=google.com; s=arc-20160816; b=UZkJxVcciDnosRqZewBCnj7QlLBjWAkQkm9leYaeP/9iuTEezdnsGYZ9R0efT8RpJJ FMH17X1M6dF2hEAA6fCg2ThdXL/NLF/MndQoFP6oTUIy9DAXh09Bsyp4WOnUCpic8BG4 9IGEbU03hpVqJP+IyLW0IMziNmlE6D67+eFaWN1mnZk9Opkhg6/N0Xi3v2031WTaJwvY /TQH6tojH9VdHgom5YfdpOYscrj0H4uwSYI0fMXiGn6rzq0FZ21jyokqsfm0PZpZPsuc dHZs4yFBy+vBrGSbj/85XaMxbN0D9q2dlJGXnE4VV/dkGK/Gn93gI5hw6CdK9JsM2dPT RKvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:reply-to:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=XCdAPyY3QKtJwrvrDmLBBK0K2ZN06sCmO+Hdg9ph1/0=; b=lojCc+fZN2do1w3CmtjeAJW/Vuu8YIU27dOTpDTQfxMLHkW+Ii6MJ7uHmp2r06UsEP pskzFT3sL1jJF6T2A+MUK+/UVCZ1JBI0bNr3ZX5KiEqantsoHoxYRyXMPGyLWMUImQpN JNiFjFEpSO0H1bgAktYXSRXNdyDJPVT0BlyW9i7xB89tzlppzzpKWkq+bpT3QMRA53nN rpVxR55nnewW+JEhkx+41g3AZfWckq0uHNwQ8MgosMhyFyKjKbXY1xOaI+f805dEu+aZ GOt3SKoRFJp0c/v/yYCEaxA8K5Jt8dWWcuX5P81sOiHmtG5qRmh6qw662aZjQ82/yCk3 k+Hg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxonhyperv.com header.s=default header.b="C6Z/WFpf"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxonhyperv.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a126-20020a636684000000b0041a4bf40469si1899456pgc.271.2022.11.03.12.18.36; Thu, 03 Nov 2022 12:18:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxonhyperv.com header.s=default header.b="C6Z/WFpf"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxonhyperv.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231566AbiKCTRb (ORCPT + 99 others); Thu, 3 Nov 2022 15:17:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55862 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231506AbiKCTRA (ORCPT ); Thu, 3 Nov 2022 15:17:00 -0400 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 78C271F9D9; Thu, 3 Nov 2022 12:16:59 -0700 (PDT) Received: by linux.microsoft.com (Postfix, from userid 1004) id 505FD20C3342; Thu, 3 Nov 2022 12:16:59 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 505FD20C3342 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxonhyperv.com; s=default; t=1667503019; bh=XCdAPyY3QKtJwrvrDmLBBK0K2ZN06sCmO+Hdg9ph1/0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:Reply-To:From; b=C6Z/WFpfWdOMaC0mf0Gbi21zNmf/1y1adLOTceBrcW/gXvGzTATApaNyW4fCaSaHU NcO7c/fA8h2kmt0OUIOklSD2tn2KcvFjpkSTLkkZBevOVyA/4Uwyl0gjRlZb668hve Wlscm8144uitycpMEO7SChoTGlGcOu1os3HsfE9A= From: longli@linuxonhyperv.com To: "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , Wei Liu , Dexuan Cui , "David S. Miller" , Jakub Kicinski , Paolo Abeni , Jason Gunthorpe , Leon Romanovsky , edumazet@google.com, shiraz.saleem@intel.com, Ajay Sharma Cc: linux-hyperv@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org, Long Li Subject: [Patch v10 10/12] net: mana: Define data structures for allocating doorbell page from GDMA Date: Thu, 3 Nov 2022 12:16:28 -0700 Message-Id: <1667502990-2559-11-git-send-email-longli@linuxonhyperv.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1667502990-2559-1-git-send-email-longli@linuxonhyperv.com> References: <1667502990-2559-1-git-send-email-longli@linuxonhyperv.com> Reply-To: longli@microsoft.com X-Spam-Status: No, score=-11.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748503763429780072?= X-GMAIL-MSGID: =?utf-8?q?1748503763429780072?= From: Long Li The RDMA device needs to allocate doorbell pages for each user context. Define the GDMA data structures for use by the RDMA driver. Reviewed-by: Dexuan Cui Signed-off-by: Long Li Acked-by: Haiyang Zhang --- Change log: v4: use EXPORT_SYMBOL_NS v7: move mana_gd_allocate_doorbell_page() and mana_gd_destroy_doorbell_page() to the RDMA driver v8: remove extra line in header file include/net/mana/gdma.h | 25 +++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/include/net/mana/gdma.h b/include/net/mana/gdma.h index a9b7930dfbf8..055408a5baf3 100644 --- a/include/net/mana/gdma.h +++ b/include/net/mana/gdma.h @@ -24,11 +24,15 @@ enum gdma_request_type { GDMA_GENERATE_TEST_EQE = 10, GDMA_CREATE_QUEUE = 12, GDMA_DISABLE_QUEUE = 13, + GDMA_ALLOCATE_RESOURCE_RANGE = 22, + GDMA_DESTROY_RESOURCE_RANGE = 24, GDMA_CREATE_DMA_REGION = 25, GDMA_DMA_REGION_ADD_PAGES = 26, GDMA_DESTROY_DMA_REGION = 27, }; +#define GDMA_RESOURCE_DOORBELL_PAGE 27 + enum gdma_queue_type { GDMA_INVALID_QUEUE, GDMA_SQ, @@ -587,6 +591,26 @@ struct gdma_register_device_resp { u32 db_id; }; /* HW DATA */ +struct gdma_allocate_resource_range_req { + struct gdma_req_hdr hdr; + u32 resource_type; + u32 num_resources; + u32 alignment; + u32 allocated_resources; +}; + +struct gdma_allocate_resource_range_resp { + struct gdma_resp_hdr hdr; + u32 allocated_resources; +}; + +struct gdma_destroy_resource_range_req { + struct gdma_req_hdr hdr; + u32 resource_type; + u32 num_resources; + u32 allocated_resources; +}; + /* GDMA_CREATE_QUEUE */ struct gdma_create_queue_req { struct gdma_req_hdr hdr;