From patchwork Sat Oct 22 00:01:19 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: 7036 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp960080wrr; Fri, 21 Oct 2022 17:03:42 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4qt9nepPTg48TWJi/pXab6et0byPx8XkFnyDuWV3WNdBowy0eC4UG2WsqpIMK+rvZDEY5y X-Received: by 2002:a17:907:6eac:b0:78d:ce9c:3761 with SMTP id sh44-20020a1709076eac00b0078dce9c3761mr17515938ejc.738.1666397022759; Fri, 21 Oct 2022 17:03:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666397022; cv=none; d=google.com; s=arc-20160816; b=kuhrOl5cBjUElqYGE1YumUjbg0Iyh81VwuVdX9RscN4JPK1jsutGA3cwgYxDI1Yx75 HoLPeqM65h0leZoJdLVBvEEAvPOcfJWTOt59rnCZktOJPP+2haTh/BRARtFCRMi6oVX3 bR1syKqUA+T49IWUcVN/h/lAiGvBdm7E3ttjB4Hx/ol+/pTz4Tt582ySkOjJlkA3cRPL 2+d3UziSQsB4kthK5pcnboGzMRz1WcTixXUtjIDsLLla0nh2aD2Vm3t9HTK71T+GPS3G FD+3Uq9LDBIPCaM6IjAYH6PTgCb4Q3ap3SeLYVqUvf5KJpSOv6PnixuSw/ib25kWeJo5 mqmw== 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=dOXYu3+97HCXRTRehn+Dx1EZkwAj/1nuL7UrEbzj1FJA5FIr9b3sXkl6impGL4I9EF oZIIc+TO04RxK/7A+5V7/g5gex5hqR6XfFxjgmAvDzHveunh2Lv3kUInednthj0H4yge 5WDhwrGOsYvOhDmU1kHzhzINSZv0dRCH0hvigoPyZROEiXl/sTG1RPPgTZlTw3SoezZU N5rO06jy8I8hhHN5jz4li0melZY+oQ+/0DG/7CWkmLJm+b3gmNvm3CpAnO1BvepwD5px uSOtdEkxwuCj6lfoCgDtw0uYApWoftnBSHyiTjcQwcSLSQK8i04eyhije9EpJ1S4Pgvj KlxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxonhyperv.com header.s=default header.b=dbUl4LPj; 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 j12-20020a05640211cc00b0045878af0adbsi21210750edw.393.2022.10.21.17.03.16; Fri, 21 Oct 2022 17:03:42 -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=dbUl4LPj; 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 S230108AbiJVACG (ORCPT + 99 others); Fri, 21 Oct 2022 20:02:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51540 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229978AbiJVABm (ORCPT ); Fri, 21 Oct 2022 20:01:42 -0400 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 6848E24FEF7; Fri, 21 Oct 2022 17:01:38 -0700 (PDT) Received: by linux.microsoft.com (Postfix, from userid 1004) id F1D1C20FEEF9; Fri, 21 Oct 2022 17:01:37 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com F1D1C20FEEF9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxonhyperv.com; s=default; t=1666396898; bh=8Z6yW2KqbQl4Wyror+q4zSVQuzt8hLhkxhobys217qM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:Reply-To:From; b=dbUl4LPjwC5jlJ9jZDI+pQVcXIq5Apl41tdN1bfZnPSzGxGmmA2f8UdVyvHi7SWS+ zc73KeUdY7C2aYxUhb36fCoZH7ER02ZBid/lzavDfWZ87L+VxxkYboWbEFXgT16iNv D1maftXWAXcO0+f/uFr52ABnFqMUMsGw1w9wMPmM= 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 02/12] net: mana: Record the physical address for doorbell page region Date: Fri, 21 Oct 2022 17:01:19 -0700 Message-Id: <1666396889-31288-3-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?1747343924551760998?= X-GMAIL-MSGID: =?utf-8?q?1747343924551760998?= 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)