summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjmatthew <jmatthew@openbsd.org>2020-04-20 12:23:53 +0000
committerjmatthew <jmatthew@openbsd.org>2020-04-20 12:23:53 +0000
commit659b9149449a844c82d88c4ff763e2cc10073bb9 (patch)
treeb21c4659e201e5c5ba0e1e75cb81f940758c6165
parentDon't call mcx_intr() from mcx_cmdq_poll(); this was a leftover from early (diff)
downloadwireguard-openbsd-659b9149449a844c82d88c4ff763e2cc10073bb9.tar.xz
wireguard-openbsd-659b9149449a844c82d88c4ff763e2cc10073bb9.zip
Check if we've reached the end of the current mailbox before writing past
the end of it, rather than after. Now we can actually allocate queues big enough to need multiple mailboxes. ok dlg@
-rw-r--r--sys/dev/pci/if_mcx.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/pci/if_mcx.c b/sys/dev/pci/if_mcx.c
index 6e7ace6aae1..e05cdee83e0 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.40 2020/04/20 12:11:17 jmatthew Exp $ */
+/* $OpenBSD: if_mcx.c,v 1.41 2020/04/20 12:23:53 jmatthew Exp $ */
/*
* Copyright (c) 2017 David Gwynne <dlg@openbsd.org>
@@ -2776,13 +2776,13 @@ mcx_cmdq_mboxes_pas(struct mcx_dmamem *mxm, int offset, int npages,
pas += (offset / sizeof(*pas));
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));
- pas++;
if (i == mbox_pages) {
mbox++;
pas = mcx_cq_mbox_data(mcx_cq_mbox(mxm, mbox));
mbox_pages += MCX_CMDQ_MAILBOX_DATASIZE / sizeof(*pas);
}
+ *pas = htobe64(MCX_DMA_DVA(buf) + (i * MCX_PAGE_SIZE));
+ pas++;
}
}