From patchwork Mon Oct 17 19:20:39 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: 3679 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp1607807wrs; Mon, 17 Oct 2022 12:28:16 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5jvyaxHvqqlq7gQeYHtrDzasHw5eHsa7x76k1SAGnPlG4OgOAQ+IlEcCL6Wtd5yC0P78Bc X-Received: by 2002:a17:90b:4c12:b0:20d:7124:7c10 with SMTP id na18-20020a17090b4c1200b0020d71247c10mr33977228pjb.204.1666034896243; Mon, 17 Oct 2022 12:28:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666034896; cv=none; d=google.com; s=arc-20160816; b=UeCEabnBg74majTqizdvG8ACCe7Gv/5BsKERfp3GC2iPFaFpKvAJmzKyi6KwFRz4PG zJxmIbAEUl6d6ZodZzdxxV0NcX5kBYDODmhZeEl3fTaHBMtEZH100xXaay4ohD0KRNHm InSaURzvgqAx0E7kHIBEEQJ5QsLRuUMPMzdBWHLahl/fUhPinKTDMF6VDPEhwKd/8OQf Az57DD2RYpGqhVa5aF5rmvbwxL9HKbnrgwBkx837Uytxw5ZBUD8hN0JQGibraxVG8/4c 7A+9TrreOTfkb5NzSH9o+jb84iKZhVj4H7ZsAwdiaMQGShu7Krae4W1ACP5YYYT7aCrp m5Ag== 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=A8fxUD/nTCAqIoM1mcUZ00zFIWg8IfK6iVDQEpa0CEo=; b=LIzVcZQb6Z1UQUq6uL9Ag0gSk6+isO9Zb+mEdZHPVM5jFuCZWPs9lyxhwkG7pio/KY mb/CXsZC+MBaoXBzm48u+ZhBVXpUpx1u8KedX+LfYSpEV7M3S+SHPGFy5QiQUzJUpS3m D7kjd0v1tnI0cSbUxF/hCVeZn+AZa78zq2ObrYvbY51BnHt1HGVGCwfFBcNfyZjiDARK lt1v0ZhE+VsPgbEfTa0sIa+rmvXvn+OLWWAxk5EyYDOQKoAKbSMN+UKdg2F1Yf73bZ0h 102uORO/Elj4NqJQ5cI4qaD31CSXlSdAYMAHKnyaGkQ+iT/pIPoU6ZZmyf8IDrc+5lzb 16BQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxonhyperv.com header.s=default header.b=l9NkBblH; 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 s13-20020a170903214d00b0017d22c23b3esi10840847ple.309.2022.10.17.12.28.02; Mon, 17 Oct 2022 12:28:16 -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=l9NkBblH; 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 S231190AbiJQTWA (ORCPT + 99 others); Mon, 17 Oct 2022 15:22:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55988 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231128AbiJQTVC (ORCPT ); Mon, 17 Oct 2022 15:21:02 -0400 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 03F4274B9B; Mon, 17 Oct 2022 12:20:56 -0700 (PDT) Received: by linux.microsoft.com (Postfix, from userid 1004) id 64A9420FE028; Mon, 17 Oct 2022 12:20:56 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 64A9420FE028 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxonhyperv.com; s=default; t=1666034456; bh=A8fxUD/nTCAqIoM1mcUZ00zFIWg8IfK6iVDQEpa0CEo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:Reply-To:From; b=l9NkBblHyXCR+bOA3ZQItM0wEvL6Bt2uBjYQwFtIo8wcnSrBDHg3LN5aOK2R5pNex qzRE93yMzULau694eLtSnwxB4VJm4sbLPNRjYQq+mlWFfyYlIWgv/NXiSveBD5eqi1 zZOV4Jkh0S9d3l4pMDxgCZGA1959E7dCDRSCkBdU= 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 v7 10/12] net: mana: Define data structures for allocating doorbell page from GDMA Date: Mon, 17 Oct 2022 12:20:39 -0700 Message-Id: <1666034441-15424-11-git-send-email-longli@linuxonhyperv.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1666034441-15424-1-git-send-email-longli@linuxonhyperv.com> References: <1666034441-15424-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?1746964207393240064?= X-GMAIL-MSGID: =?utf-8?q?1746964207393240064?= 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 include/net/mana/gdma.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/include/net/mana/gdma.h b/include/net/mana/gdma.h index a9b7930dfbf8..bc060b6fa54c 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; @@ -695,4 +719,5 @@ void mana_gd_free_memory(struct gdma_mem_info *gmi); int mana_gd_send_request(struct gdma_context *gc, u32 req_len, const void *req, u32 resp_len, void *resp); + #endif /* _GDMA_H */