Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1777466rwi; Wed, 19 Oct 2022 15:28:10 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5UiMvPrZEAc4m+5iRC4+b9akHzvyuqT74eDCpgqmjVN01fnIMsfUz+SO8Tu+RZoM+wcB3r X-Received: by 2002:a17:906:cc0f:b0:78e:1216:fade with SMTP id ml15-20020a170906cc0f00b0078e1216fademr8515584ejb.47.1666218489868; Wed, 19 Oct 2022 15:28:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666218489; cv=none; d=google.com; s=arc-20160816; b=g6cn29ZFm9sdeYlMw0UXJYcj/TymJyvtUqtl6AoEW1UnSWnffmq9GR4GCa1ul/pzxG tzCdxWIqFis/aTFivaG26fHJ7j130Kul3JDOsxR850CiA/NfapyEjHFh68Y4/R4/irQV Jb0P5k0bN/17NHCscYqcgIYsXiXejAwnY+i4ZyNNIvPPJ7OcHkJ+UbJognEBvTJGrsDN 91PYSuESI9CiADDqOm3sVgweR2J+qhOAPGxwhWbRLal21mmEr4eREiWV2sJhuE+P1cZC vgr4UoYgKAXQ37Xgge4k5t/n4Psh4G1N5Yf2Rzck0iTkWh+jxNz5QAULI9r+DFOT4+yq MtWg== 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=MH5bW46yuVi86TAQLxcFEncE/AT4pEIhBgmXOik2UXxABXdiV06lgk/SSd2VkdnLXl VzTn1um54dI/tORmZyZ/eNpdRP6ld4uJXMfJ6Olo/5PzCQhJ/OSiM3OrE9U6sLvISgVK CTenRvjAiulgWfIRj2V+AwhuHGyJtPwrVsmBA/5NIM+GTpYWrBr5qshXvP/D6fO54Dfp ZrTFSzANHyw0hHPeXQ0/qG4B0JzjYPHbTU1s8yUXfJmSy2DQwOyMfqLXoy4sDwJ5lrfU BFl+W5lUNwJnUuruvcBAwZ2feZOhHCG7d74gg//6ZY+Et+i3J/O1hdFcErD68JbhOrfa VINA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxonhyperv.com header.s=default header.b=OMRJhT8C; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d11-20020a170906370b00b007818378f560si11646611ejc.383.2022.10.19.15.27.44; Wed, 19 Oct 2022 15:28:09 -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=OMRJhT8C; 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 S231374AbiJSWZM (ORCPT + 99 others); Wed, 19 Oct 2022 18:25:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34792 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231296AbiJSWY1 (ORCPT ); Wed, 19 Oct 2022 18:24:27 -0400 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A8702BF73; Wed, 19 Oct 2022 15:24:26 -0700 (PDT) Received: by linux.microsoft.com (Postfix, from userid 1004) id 8370420FEA41; Wed, 19 Oct 2022 15:24:26 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 8370420FEA41 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxonhyperv.com; s=default; t=1666218266; bh=XCdAPyY3QKtJwrvrDmLBBK0K2ZN06sCmO+Hdg9ph1/0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:Reply-To:From; b=OMRJhT8CpdLn2WXJi4fYH6uEqY+DwmyzXKeG0y7Gonl5jQsDC+//SMQh/MzXVbnGT OI3NLr1/a3t4y7bAhHAOtg3IcZrkueI9n7/R23dmr5AeGYMKLzb9tLCwXFe4m3yEir 9bbdBPvkh0n27fsh0xJm772GbBMVsjaxGWgznB74= 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 v8 10/12] net: mana: Define data structures for allocating doorbell page from GDMA Date: Wed, 19 Oct 2022 15:24:10 -0700 Message-Id: <1666218252-32191-11-git-send-email-longli@linuxonhyperv.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1666218252-32191-1-git-send-email-longli@linuxonhyperv.com> References: <1666218252-32191-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 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; -- 2.17.1