From patchwork Thu Nov 3 19:16:20 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: 15110 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp720252wru; Thu, 3 Nov 2022 12:18:23 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5sgwMlEXLAQzwWPWlD3D9/wUtgejrsmsSWD6cQQBsYmTN7qROoe7wwbMSyKDcs+aW8lcpr X-Received: by 2002:aa7:88c9:0:b0:56b:e851:5b65 with SMTP id k9-20020aa788c9000000b0056be8515b65mr32153260pff.74.1667503102998; Thu, 03 Nov 2022 12:18:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667503102; cv=none; d=google.com; s=arc-20160816; b=ovcfyrBkpOZeNknnOotoSe/1PF9pcxs19rZ6JQAO71jcQAV7VAeHztmijuqe6EyCvh 52dO7O1oenVdaWYZQTpPoW5o1gpJqRY+xdJp0XctGvKqxl2fTvufr/4oaZb3wrVG43Am jcK2orzWBK1MB1b1g9nccIQTv0czGP0NCzIScjhcfJCnR4LN5Vucy9QlVNCICF7XYH06 zUHPDKa2+aweLAPb30I48TyfbGtL3v9V2oys9HMPE7h4SmYdJdVAXSkxAcDrZKPae0QE sVQjXr1AZCbafet7O3EZQygCyczpVXssYOA1cU0YGw5W01JPABGJeNjEYYdBtn/2hwc+ rLeQ== 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=8Z6yW2KqbQl4Wyror+q4zSVQuzt8hLhkxhobys217qM=; b=QH7R4MYA0m6tRcpRMvb03sj4vw/jwrop4SeyzKGfVJvD4QCfDNmUMBZjwbT9UOYhfB VGXl4xafJAxuMsqYiMUbFYkbgopH/wO4g3HMTZhaCUlESTyzSnW2DzIVrWCOma1u1ILo 0p/3IU280JJz+P/Lm7n5xY8q6CgEPbbQMdWD8a084P0RVYOItodc1Nc2LfrHI/dePraw H6dszFExErFXneOP5PWjtQ8VginsSJbGWQaCW+aKZ8vICaJnYL+5BjRMdsE8SCXC+aVR vWO70N0hzDNJvM8Dj+O9WGmrsYA7SY6nyDzWxf2iLAFqZerhfSOdOPxhJTZCnkpGhBcq 7y3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxonhyperv.com header.s=default header.b=Nkhol3X5; 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 l3-20020a63da43000000b004347b49d045si1990558pgj.631.2022.11.03.12.18.09; Thu, 03 Nov 2022 12:18:22 -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=Nkhol3X5; 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 S231643AbiKCTRN (ORCPT + 99 others); Thu, 3 Nov 2022 15:17:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55734 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231396AbiKCTQ4 (ORCPT ); Thu, 3 Nov 2022 15:16:56 -0400 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id AEDA41F9DE; Thu, 3 Nov 2022 12:16:54 -0700 (PDT) Received: by linux.microsoft.com (Postfix, from userid 1004) id 78DA2205DA43; Thu, 3 Nov 2022 12:16:54 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 78DA2205DA43 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxonhyperv.com; s=default; t=1667503014; bh=8Z6yW2KqbQl4Wyror+q4zSVQuzt8hLhkxhobys217qM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:Reply-To:From; b=Nkhol3X59tnEwYqBLiIRFX3PP+FzavW8ftwQ03wcEznRasb5T5A3qNTS8H5Jh+9La pxBmZ3t+juA5h/6WV551Wd/6O2nTK5d5ok2AujIkuNKX30kTFdnKR8cMxp0R6NXLMg vnrVfcEuDRpbmpnPk6sm9HiH5bSZ3VTFJq3xOMq0= 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 02/12] net: mana: Record the physical address for doorbell page region Date: Thu, 3 Nov 2022 12:16:20 -0700 Message-Id: <1667502990-2559-3-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?1748503733828015099?= X-GMAIL-MSGID: =?utf-8?q?1748503733828015099?= From: Long Li For supporting RDMA device with multiple user contexts with their individual doorbell pages, record the start address of doorbell page region for use by the RDMA driver to allocate user context doorbell IDs. Reviewed-by: Dexuan Cui Signed-off-by: Long Li Acked-by: Haiyang Zhang --- Change log: v6: rebased to rdma-next drivers/net/ethernet/microsoft/mana/gdma.h | 2 ++ drivers/net/ethernet/microsoft/mana/gdma_main.c | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/drivers/net/ethernet/microsoft/mana/gdma.h b/drivers/net/ethernet/microsoft/mana/gdma.h index f321a2616d03..72eaec2470c0 100644 --- a/drivers/net/ethernet/microsoft/mana/gdma.h +++ b/drivers/net/ethernet/microsoft/mana/gdma.h @@ -351,9 +351,11 @@ struct gdma_context { u32 test_event_eq_id; bool is_pf; + phys_addr_t bar0_pa; void __iomem *bar0_va; void __iomem *shm_base; void __iomem *db_page_base; + phys_addr_t phys_db_page_base; u32 db_page_size; /* Shared memory chanenl (used to bootstrap HWC) */ diff --git a/drivers/net/ethernet/microsoft/mana/gdma_main.c b/drivers/net/ethernet/microsoft/mana/gdma_main.c index 5f9240182351..0cfe5f15458e 100644 --- a/drivers/net/ethernet/microsoft/mana/gdma_main.c +++ b/drivers/net/ethernet/microsoft/mana/gdma_main.c @@ -44,6 +44,9 @@ static void mana_gd_init_vf_regs(struct pci_dev *pdev) gc->db_page_base = gc->bar0_va + mana_gd_r64(gc, GDMA_REG_DB_PAGE_OFFSET); + gc->phys_db_page_base = gc->bar0_pa + + mana_gd_r64(gc, GDMA_REG_DB_PAGE_OFFSET); + gc->shm_base = gc->bar0_va + mana_gd_r64(gc, GDMA_REG_SHM_OFFSET); } @@ -1367,6 +1370,7 @@ static int mana_gd_probe(struct pci_dev *pdev, const struct pci_device_id *ent) mutex_init(&gc->eq_test_event_mutex); pci_set_drvdata(pdev, gc); + gc->bar0_pa = pci_resource_start(pdev, 0); bar0_va = pci_iomap(pdev, bar, 0); if (!bar0_va)