Commit f3dc0962 authored by Long Li's avatar Long Li Committed by Leon Romanovsky

net: mana: Record the physical address for doorbell page region

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: default avatarDexuan Cui <decui@microsoft.com>
Signed-off-by: default avatarLong Li <longli@microsoft.com>
Link: https://lore.kernel.org/r/1667502990-2559-3-git-send-email-longli@linuxonhyperv.comAcked-by: default avatarHaiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: default avatarLeon Romanovsky <leonro@nvidia.com>
parent a69839d4
...@@ -351,9 +351,11 @@ struct gdma_context { ...@@ -351,9 +351,11 @@ struct gdma_context {
u32 test_event_eq_id; u32 test_event_eq_id;
bool is_pf; bool is_pf;
phys_addr_t bar0_pa;
void __iomem *bar0_va; void __iomem *bar0_va;
void __iomem *shm_base; void __iomem *shm_base;
void __iomem *db_page_base; void __iomem *db_page_base;
phys_addr_t phys_db_page_base;
u32 db_page_size; u32 db_page_size;
/* Shared memory chanenl (used to bootstrap HWC) */ /* Shared memory chanenl (used to bootstrap HWC) */
......
...@@ -44,6 +44,9 @@ static void mana_gd_init_vf_regs(struct pci_dev *pdev) ...@@ -44,6 +44,9 @@ static void mana_gd_init_vf_regs(struct pci_dev *pdev)
gc->db_page_base = gc->bar0_va + gc->db_page_base = gc->bar0_va +
mana_gd_r64(gc, GDMA_REG_DB_PAGE_OFFSET); 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); gc->shm_base = gc->bar0_va + mana_gd_r64(gc, GDMA_REG_SHM_OFFSET);
} }
...@@ -1377,6 +1380,7 @@ static int mana_gd_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -1377,6 +1380,7 @@ static int mana_gd_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
mutex_init(&gc->eq_test_event_mutex); mutex_init(&gc->eq_test_event_mutex);
pci_set_drvdata(pdev, gc); pci_set_drvdata(pdev, gc);
gc->bar0_pa = pci_resource_start(pdev, 0);
bar0_va = pci_iomap(pdev, bar, 0); bar0_va = pci_iomap(pdev, bar, 0);
if (!bar0_va) if (!bar0_va)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment