summaryrefslogtreecommitdiff
path: root/sys/dev/pci/if_mcx.c
diff options
context:
space:
mode:
authorJonathan Matthew <jmatthew@cvs.openbsd.org>2020-04-06 11:27:24 +0000
committerJonathan Matthew <jmatthew@cvs.openbsd.org>2020-04-06 11:27:24 +0000
commit40cc806ef9ea7795234ea009567b013f4f8cb644 (patch)
treec395ec49afce4e7d053caa3c7a08f55530039675 /sys/dev/pci/if_mcx.c
parent8b440b4adf0207c9d0637b16817fda9700a8a0e9 (diff)
fix previous: use the correct offset for sq/rq creation, and don't
reset the mbox counter to 0 after calculating it.
Diffstat (limited to 'sys/dev/pci/if_mcx.c')
-rw-r--r--sys/dev/pci/if_mcx.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/dev/pci/if_mcx.c b/sys/dev/pci/if_mcx.c
index c1e8b8e1f2f..adbf625adfe 100644
--- a/sys/dev/pci/if_mcx.c
+++ b/sys/dev/pci/if_mcx.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_mcx.c,v 1.38 2020/04/06 01:28:58 jmatthew Exp $ */
+/* $OpenBSD: if_mcx.c,v 1.39 2020/04/06 11:27:23 jmatthew Exp $ */
/*
* Copyright (c) 2017 David Gwynne <dlg@openbsd.org>
@@ -2777,7 +2777,6 @@ mcx_cmdq_mboxes_pas(struct mcx_dmamem *mxm, int offset, int npages,
pas = mcx_cq_mbox_data(mcx_cq_mbox(mxm, mbox));
pas += (offset / sizeof(*pas));
- mbox = 0;
mbox_pages = (MCX_CMDQ_MAILBOX_DATASIZE - offset) / sizeof(*pas);
for (i = 0; i < npages; i++) {
*pas = htobe64(MCX_DMA_DVA(buf) + (i * MCX_PAGE_SIZE));
@@ -4044,7 +4043,7 @@ mcx_create_rq(struct mcx_softc *sc, int cqn)
mbin->rq_wq.wq_log_size = MCX_LOG_RQ_SIZE;
/* physical addresses follow the mailbox in data */
- mcx_cmdq_mboxes_pas(&mxm, sizeof(*mbin), npages, &sc->sc_rq_mem);
+ mcx_cmdq_mboxes_pas(&mxm, sizeof(*mbin) + 0x10, npages, &sc->sc_rq_mem);
mcx_cmdq_post(sc, cqe, 0);
error = mcx_cmdq_poll(sc, cqe, 1000);
@@ -4316,7 +4315,7 @@ mcx_create_sq(struct mcx_softc *sc, int cqn)
mbin->sq_wq.wq_log_size = MCX_LOG_SQ_SIZE;
/* physical addresses follow the mailbox in data */
- mcx_cmdq_mboxes_pas(&mxm, sizeof(*mbin), npages, &sc->sc_sq_mem);
+ mcx_cmdq_mboxes_pas(&mxm, sizeof(*mbin) + 0x10, npages, &sc->sc_sq_mem);
mcx_cmdq_post(sc, cqe, 0);
error = mcx_cmdq_poll(sc, cqe, 1000);