git: 87b0e7711f25 - main - cxgbe tom: Use VM_PAGE_TO_PHYS().

From: John Baldwin <jhb_at_FreeBSD.org>
Date: Tue, 08 Mar 2022 22:31:11 UTC
The branch main has been updated by jhb:

URL: https://cgit.FreeBSD.org/src/commit/?id=87b0e7711f2552ff6ad575deb546124d8b5ae5d8

commit 87b0e7711f2552ff6ad575deb546124d8b5ae5d8
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2022-03-08 18:10:59 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2022-03-08 22:30:26 +0000

    cxgbe tom: Use VM_PAGE_TO_PHYS().
    
    Sponsored by:   Chelsio Communications
---
 sys/dev/cxgbe/tom/t4_ddp.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/sys/dev/cxgbe/tom/t4_ddp.c b/sys/dev/cxgbe/tom/t4_ddp.c
index 428e942a29cd..7c1e3011df7f 100644
--- a/sys/dev/cxgbe/tom/t4_ddp.c
+++ b/sys/dev/cxgbe/tom/t4_ddp.c
@@ -907,8 +907,8 @@ t4_alloc_page_pods_for_ps(struct ppod_region *pr, struct pageset *ps)
 	for (i = 0; i < ps->npages; i++) {
 		seglen = PAGE_SIZE;
 		while (i < ps->npages - 1 &&
-		    ps->pages[i]->phys_addr + PAGE_SIZE ==
-		    ps->pages[i + 1]->phys_addr) {
+		    VM_PAGE_TO_PHYS(ps->pages[i]) + PAGE_SIZE ==
+		    VM_PAGE_TO_PHYS(ps->pages[i + 1])) {
 			seglen += PAGE_SIZE;
 			i++;
 		}
@@ -1103,6 +1103,7 @@ t4_write_page_pods_for_ps(struct adapter *sc, struct sge_wrq *wrq, int tid,
 	uint32_t cmd;
 	struct ppod_reservation *prsv = &ps->prsv;
 	struct ppod_region *pr = prsv->prsv_pr;
+	vm_paddr_t pa;
 
 	KASSERT(!(ps->flags & PS_PPODS_WRITTEN),
 	    ("%s: page pods already written", __func__));
@@ -1147,8 +1148,8 @@ t4_write_page_pods_for_ps(struct adapter *sc, struct sge_wrq *wrq, int tid,
 			idx = i * PPOD_PAGES * (ddp_pgsz / PAGE_SIZE);
 			for (k = 0; k < nitems(ppod->addr); k++) {
 				if (idx < ps->npages) {
-					ppod->addr[k] =
-					    htobe64(ps->pages[idx]->phys_addr);
+					pa = VM_PAGE_TO_PHYS(ps->pages[idx]);
+					ppod->addr[k] = htobe64(pa);
 					idx += ddp_pgsz / PAGE_SIZE;
 				} else
 					ppod->addr[k] = 0;