From patchwork Sat Oct 22 00:01:27 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: 7045 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp961223wrr; Fri, 21 Oct 2022 17:06:56 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6bcrXSUSqH5ugsuMVBO7U/zXUBrNzmDnIieVPfvmAxswnUWJ5m7xFEZoodEOMh+M8Nqu3s X-Received: by 2002:a17:907:3da2:b0:78d:45df:b4f with SMTP id he34-20020a1709073da200b0078d45df0b4fmr17333307ejc.651.1666397216308; Fri, 21 Oct 2022 17:06:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666397216; cv=none; d=google.com; s=arc-20160816; b=ylkrcRcF6wbPqL4/JARSlrRw/Fz3GgPbhuZCXxUw/8jM35cjpRYCSD5G6lyDpHjag5 8ad3RYBtJE61TPj/yiYM0pSas0X2+Ea7H/PZv6QJPzgaOFmFEA7Gf14ElX5luAYvArvw zDkcS6St+htNDcyENLN9QMwkvNRAAwobVyXtAu7RwpCFl4P4fPZAWNVhRX4vU6+4FBb5 gZBgkDrrIUleG2vNm+MXAQIfcp7hAOIYCVXqk42NmeGTTnQtJgqa2+C+Mv/WXTSQxvvs WO00B0anBNXBvdfXhv2r+zjN2Y8rFqn3jTjhpkm4Tp3XhBag+Xds08hcMYfaw3Jr76VJ 1d+g== 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=zGhxyHwXWz1VVl04M43u2MPrPB9FacdaeWwe4qQiDfOBrfL2Z7VcEQSQiUoBSg1Hqv BnCtzXr9GB812bb62usrgYZOVbxcDL7ZvDh3wCWO7MDqUi2A8jowddSiYNNlkt9/1VyH IJ7oLwbxRh6nlED8+d5ymtoMVDY5LzznFH4/OkvacKzZufowJYRXeaz0K1J968+LYbB7 KXpS16ymXHvscpNSnqb47OPrRQcwN4qoTMFuXzD65BmB9ogaQPYdM3Mci4UkPuW3rlY6 Lla4w8Xfkox76qFNHFMmexneAP/6unEv6SgQZhMBxj+x7ixiFdqGD87A2ZrK0lu81EyM 2zVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxonhyperv.com header.s=default header.b=faA+oiyA; 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 g10-20020a056402090a00b0045c97ee2b01si24092122edz.616.2022.10.21.17.06.25; Fri, 21 Oct 2022 17:06:56 -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=faA+oiyA; 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 S230102AbiJVACg (ORCPT + 99 others); Fri, 21 Oct 2022 20:02:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230033AbiJVABt (ORCPT ); Fri, 21 Oct 2022 20:01:49 -0400 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 441E626D902; Fri, 21 Oct 2022 17:01:43 -0700 (PDT) Received: by linux.microsoft.com (Postfix, from userid 1004) id DDB9F20FF4EE; Fri, 21 Oct 2022 17:01:41 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com DDB9F20FF4EE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxonhyperv.com; s=default; t=1666396901; bh=XCdAPyY3QKtJwrvrDmLBBK0K2ZN06sCmO+Hdg9ph1/0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:Reply-To:From; b=faA+oiyAlFd7vGuIT2sfiAWGev0+Q8HkghW02Cha5wsLc9B22gKphi71HW1es33ka ATH6a53lvZmNZ7CV1HBv25C19dklB3Ul3D5j2fNeNMaTlKTxUcoec9jDkk3f8OyLWN +E1Lg2ORB2KTc0wwOguHnZoaYJquQM6IRclES/5Y= 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 v9 10/12] net: mana: Define data structures for allocating doorbell page from GDMA Date: Fri, 21 Oct 2022 17:01:27 -0700 Message-Id: <1666396889-31288-11-git-send-email-longli@linuxonhyperv.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1666396889-31288-1-git-send-email-longli@linuxonhyperv.com> References: <1666396889-31288-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?1747344127907270702?= X-GMAIL-MSGID: =?utf-8?q?1747344127907270702?= 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;