Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp4697210rwb; Tue, 20 Sep 2022 18:57:48 -0700 (PDT) X-Google-Smtp-Source: AMsMyM42RPFwIqyifWMIN4iTXgruy39omFzZDtnqqhn784iJgh06EfWmLF2dEH5/9nT12HM6Df1J X-Received: by 2002:a17:907:75c1:b0:730:aa62:7f65 with SMTP id jl1-20020a17090775c100b00730aa627f65mr18370971ejc.355.1663725468719; Tue, 20 Sep 2022 18:57:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663725468; cv=none; d=google.com; s=arc-20160816; b=v2bKYyqQU3xcFt6pI3E3x0K3IGycbq2WqgbkYOZ1YOIkYOfc/v1mFpqRUAvwF2lUdl zF3Lv3TaPkT0j17V/z+tfYTb07RQJ1Jr7sdImeAaR3PAyp/gzzh81vbfn7mRnf6iB/xr lr/he2KHKkv1nRwKdnVJItBJLlxOZ20EKIsmzHmCo1+Rav0ySEnZgIqCI3+YywRUoH92 MQa7d6szlO9lUMykEd/U1LmSI3Wmfr6Gx41kBQnTezsvcOmFOGAJldCZtlBlNDafeUgf lfNcTUfC+XN1nR4AP+ETiJ4FDkKuM6ugaeJJP5JLe0aszbGsyFzNQWKFPQjBC8wRq8iE 5bgA== 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=HYy18TzkTtaKQXg53yKvXDaSZ7b92sY9YtTXBLWgZF2fJVlql3VVigIGmhlba2QKcj zYeeC7n/LfFTciMIEycoH2wSJvAiboNscElPhtFzSG6jSeUgYop5flnxznMddZwARvpl ok2d2w5WpNDNQx7NzqDa5+iaSg6FwQD8U1jQRrTIx5rv7iF5U1WpgKpw2DmbW2NBJ8LC csweMVagGsgD9Q5+vc6+ZlT0uc5dN0bCh6ggciokn9ehrNP7RDGtWD2v1A8C3DjgAd5B +OCVSL42VAlFVIfMOYE0SAhM+bIkXIbm1tF4AyoEHCfjswv4lr1ysF3IHSyf41s4c2Ub 2b5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxonhyperv.com header.s=default header.b="Aj/JFqTE"; 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 e1-20020a056402148100b00451f433ecd4si1144577edv.107.2022.09.20.18.57.23; Tue, 20 Sep 2022 18:57:48 -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="Aj/JFqTE"; 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 S231469AbiIUBXK (ORCPT + 99 others); Tue, 20 Sep 2022 21:23:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34210 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231320AbiIUBXD (ORCPT ); Tue, 20 Sep 2022 21:23:03 -0400 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 91A657B1DF; Tue, 20 Sep 2022 18:22:59 -0700 (PDT) Received: by linux.microsoft.com (Postfix, from userid 1004) id 9EC4920B929C; Tue, 20 Sep 2022 18:22:58 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 9EC4920B929C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxonhyperv.com; s=default; t=1663723378; bh=8Z6yW2KqbQl4Wyror+q4zSVQuzt8hLhkxhobys217qM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:Reply-To:From; b=Aj/JFqTEjtU136yAKnA7RohurT5WdCYs8MydhMlE3md78mbJVWw2OmrGW1etyzAb3 gk8n02lf8WEdA2U0z6dQYSl6gS4o9U7+NcDor7TSFF6DLl3L9bH3H0H7WK734hwoqi qTVyTsokP04Orsjtd5yyUPuQNX9Y3rML5lnHUR80= 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 v6 02/12] net: mana: Record the physical address for doorbell page region Date: Tue, 20 Sep 2022 18:22:22 -0700 Message-Id: <1663723352-598-3-git-send-email-longli@linuxonhyperv.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1663723352-598-1-git-send-email-longli@linuxonhyperv.com> References: <1663723352-598-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 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) -- 2.17.1