diff options
author | 2017-07-12 14:25:36 +0000 | |
---|---|---|
committer | 2017-07-12 14:25:36 +0000 | |
commit | 325f3f74444c6f2c3485e32dfbe589c078df15c1 (patch) | |
tree | e23bf0f9a8b202092314a74d6b7e00a88c85b828 | |
parent | Use a 32 bit variable to detect integer overflow when searching for (diff) | |
download | wireguard-openbsd-325f3f74444c6f2c3485e32dfbe589c078df15c1.tar.xz wireguard-openbsd-325f3f74444c6f2c3485e32dfbe589c078df15c1.zip |
Reshuffle vic_start and get rid of the dequeue begin/rollback/commit dance
Tested on ESXi 5.5.0, OK reyk
-rw-r--r-- | sys/dev/pci/if_vic.c | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/sys/dev/pci/if_vic.c b/sys/dev/pci/if_vic.c index e34a1aa4f27..c15aef4c8d6 100644 --- a/sys/dev/pci/if_vic.c +++ b/sys/dev/pci/if_vic.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_vic.c,v 1.97 2017/01/22 10:17:38 dlg Exp $ */ +/* $OpenBSD: if_vic.c,v 1.98 2017/07/12 14:25:36 mikeb Exp $ */ /* * Copyright (c) 2006 Reyk Floeter <reyk@openbsd.org> @@ -1051,13 +1051,8 @@ vic_start(struct ifnet *ifp) break; } - m = ifq_deq_begin(&ifp->if_snd); - if (m == NULL) - break; - idx = sc->sc_data->vd_tx_nextidx; if (idx >= sc->sc_data->vd_tx_length) { - ifq_deq_rollback(&ifp->if_snd, m); printf("%s: tx idx is corrupt\n", DEVNAME(sc)); ifp->if_oerrors++; break; @@ -1067,23 +1062,20 @@ vic_start(struct ifnet *ifp) txb = &sc->sc_txbuf[idx]; if (txb->txb_m != NULL) { - ifq_deq_rollback(&ifp->if_snd, m); printf("%s: tx ring is corrupt\n", DEVNAME(sc)); sc->sc_data->vd_tx_stopped = 1; ifp->if_oerrors++; break; } - /* - * we're committed to sending it now. if we cant map it into - * dma memory then we drop it. - */ - ifq_deq_commit(&ifp->if_snd, m); + m = ifq_dequeue(&ifp->if_snd); + if (m == NULL) + break; + if (vic_load_txb(sc, txb, m) != 0) { m_freem(m); ifp->if_oerrors++; - /* continue? */ - break; + continue; } #if NBPFILTER > 0 |