summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJerry Jelinek <jerry.jelinek@joyent.com>2020-07-24 11:32:35 +0000
committerJerry Jelinek <jerry.jelinek@joyent.com>2020-07-24 11:32:35 +0000
commit005cfc368c546b7a045eea7674028a7214ebdea6 (patch)
tree9f957c60e08b94c2cd7bb07a38f23307204fae21
parent45253056e75fcd7e65f200019d4523246dd488a9 (diff)
parent9e2a4eaf6fee551c027291466c695e4414145b39 (diff)
downloadillumos-joyent-005cfc368c546b7a045eea7674028a7214ebdea6.tar.gz
[illumos-gate merge]
commit 9e2a4eaf6fee551c027291466c695e4414145b39 12978 usr/dict/words has CoC violations commit 8fa80b6906806016ca3449e9e20ce5f6b49653dc 12712 xnf calls ddi_dma_nextcookie too many times and panics the system
-rw-r--r--usr/src/cmd/look/words3
-rw-r--r--usr/src/cmd/spell/extra1
-rw-r--r--usr/src/cmd/spell/list3
-rw-r--r--usr/src/uts/common/xen/io/xnf.c23
4 files changed, 12 insertions, 18 deletions
diff --git a/usr/src/cmd/look/words b/usr/src/cmd/look/words
index fea8853600..1277f2e00e 100644
--- a/usr/src/cmd/look/words
+++ b/usr/src/cmd/look/words
@@ -8400,7 +8400,6 @@ fade
fadeout
faery
Fafnir
-fag
Fahey
Fahrenheit
fail
@@ -15677,7 +15676,6 @@ Nietzsche
Niger
Nigeria
niggardly
-nigger
niggle
nigh
night
@@ -24859,7 +24857,6 @@ wool
woolgather
Woolworth
Wooster
-wop
Worcester
word
Wordsworth
diff --git a/usr/src/cmd/spell/extra b/usr/src/cmd/spell/extra
index 71a2b132ab..8a4ed3c032 100644
--- a/usr/src/cmd/spell/extra
+++ b/usr/src/cmd/spell/extra
@@ -5218,7 +5218,6 @@ wench
wend
werewolf
werewolves
-wetback
whacky
whaleboat
whalebone
diff --git a/usr/src/cmd/spell/list b/usr/src/cmd/spell/list
index d7ba9fea1b..024a0eaf48 100644
--- a/usr/src/cmd/spell/list
+++ b/usr/src/cmd/spell/list
@@ -8398,7 +8398,6 @@ fade
fadeout
faery
Fafnir
-fag
Fahey
Fahrenheit
fail
@@ -15675,7 +15674,6 @@ Nietzsche
Niger
Nigeria
niggardly
-nigger
niggle
nigh
night
@@ -24858,7 +24856,6 @@ wool
woolgather
Woolworth
Wooster
-wop
Worcester
word
Wordsworth
diff --git a/usr/src/uts/common/xen/io/xnf.c b/usr/src/uts/common/xen/io/xnf.c
index ebed9c5f7e..2a53cc23e2 100644
--- a/usr/src/uts/common/xen/io/xnf.c
+++ b/usr/src/uts/common/xen/io/xnf.c
@@ -26,6 +26,7 @@
/*
* Copyright (c) 2014, 2017 by Delphix. All rights reserved.
+ * Copyright 2020 RackTop Systems, Inc.
*/
/*
@@ -1779,8 +1780,7 @@ xnf_mblk_map(xnf_t *xnfp, mblk_t *mp, int *countp)
for (mblk_t *ml = mp; ml != NULL; ml = ml->b_cont) {
ddi_dma_handle_t dma_handle;
- ddi_dma_cookie_t dma_cookie;
- uint_t ncookies;
+ const ddi_dma_cookie_t *dma_cookie, *dma_cookie_prev;
xnf_txbuf_t *txp;
if (MBLKL(ml) == 0)
@@ -1804,8 +1804,7 @@ xnf_mblk_map(xnf_t *xnfp, mblk_t *mp, int *countp)
int ret = ddi_dma_addr_bind_handle(dma_handle,
NULL, (char *)ml->b_rptr, MBLKL(ml),
DDI_DMA_WRITE | DDI_DMA_STREAMING,
- DDI_DMA_DONTWAIT, 0, &dma_cookie,
- &ncookies);
+ DDI_DMA_DONTWAIT, 0, NULL, NULL);
if (ret != DDI_DMA_MAPPED) {
if (ret != DDI_DMA_NORESOURCES) {
dev_err(xnfp->xnf_devinfo, CE_WARN,
@@ -1816,15 +1815,16 @@ xnf_mblk_map(xnf_t *xnfp, mblk_t *mp, int *countp)
}
txp->tx_handle_bound = B_TRUE;
- ASSERT(ncookies > 0);
- for (int i = 0; i < ncookies; i++) {
+ dma_cookie_prev = NULL;
+ while ((dma_cookie = ddi_dma_cookie_iter(dma_handle,
+ dma_cookie_prev)) != NULL) {
if (nsegs == XEN_MAX_TX_DATA_PAGES) {
dev_err(xnfp->xnf_devinfo, CE_WARN,
"xnf_dmamap_alloc() failed: "
"too many segments");
goto error;
}
- if (i > 0) {
+ if (dma_cookie_prev != NULL) {
txp = xnf_data_txbuf_alloc(xnfp);
ASSERT(tail != NULL);
TXBUF_SETNEXT(tail, txp);
@@ -1832,7 +1832,7 @@ xnf_mblk_map(xnf_t *xnfp, mblk_t *mp, int *countp)
}
txp->tx_mfn =
- xnf_btop(pa_to_ma(dma_cookie.dmac_laddress));
+ xnf_btop(pa_to_ma(dma_cookie->dmac_laddress));
txp->tx_txreq.gref = xnf_gref_get(xnfp);
if (txp->tx_txreq.gref == INVALID_GRANT_REF) {
dev_err(xnfp->xnf_devinfo, CE_WARN,
@@ -1843,16 +1843,17 @@ xnf_mblk_map(xnf_t *xnfp, mblk_t *mp, int *countp)
gnttab_grant_foreign_access_ref(txp->tx_txreq.gref,
oeid, txp->tx_mfn, 1);
txp->tx_txreq.offset =
- dma_cookie.dmac_laddress & PAGEOFFSET;
- txp->tx_txreq.size = dma_cookie.dmac_size;
+ dma_cookie->dmac_laddress & PAGEOFFSET;
+ txp->tx_txreq.size = dma_cookie->dmac_size;
txp->tx_txreq.flags = 0;
- ddi_dma_nextcookie(dma_handle, &dma_cookie);
nsegs++;
if (tail != NULL)
tail->tx_txreq.flags = NETTXF_more_data;
tail = txp;
+
+ dma_cookie_prev = dma_cookie;
}
}