summaryrefslogtreecommitdiff
path: root/sys/dev/pv
diff options
context:
space:
mode:
authorMike Belopuhov <mikeb@cvs.openbsd.org>2017-12-09 14:00:22 +0000
committerMike Belopuhov <mikeb@cvs.openbsd.org>2017-12-09 14:00:22 +0000
commit0739c4672543a26cc0c0df9fab292d265a926565 (patch)
treec969da3b95ed230cca247918e4039a2410b6515f /sys/dev/pv
parentea721503cfd8b6f4951a98d573bfe94b675b85c6 (diff)
No need for the txb_used flag anymore
Diffstat (limited to 'sys/dev/pv')
-rw-r--r--sys/dev/pv/if_xnf.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/sys/dev/pv/if_xnf.c b/sys/dev/pv/if_xnf.c
index d044d596eb7..1f5c3916062 100644
--- a/sys/dev/pv/if_xnf.c
+++ b/sys/dev/pv/if_xnf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_xnf.c,v 1.61 2017/11/08 00:37:18 mikeb Exp $ */
+/* $OpenBSD: if_xnf.c,v 1.62 2017/12/09 14:00:21 mikeb Exp $ */
/*
* Copyright (c) 2015, 2016 Mike Belopuhov
@@ -140,8 +140,7 @@ struct xnf_tx_ring {
} __packed;
struct xnf_tx_buf {
- uint16_t txb_used;
- uint16_t txb_ndesc;
+ uint32_t txb_ndesc;
bus_dmamap_t txb_dmap;
struct mbuf *txb_mbuf;
};
@@ -595,7 +594,7 @@ xnf_encap(struct xnf_softc *sc, struct mbuf *m_head, uint32_t *prod)
do {
id = sc->sc_tx_next++ & (XNF_TX_DESC - 1);
txb = &sc->sc_tx_buf[id];
- } while (txb->txb_used);
+ } while (txb->txb_mbuf);
if (bus_dmamap_load(sc->sc_dmat, txb->txb_dmap, m->m_data,
m->m_len, NULL, flags)) {
@@ -634,7 +633,6 @@ xnf_encap(struct xnf_softc *sc, struct mbuf *m_head, uint32_t *prod)
}
txb->txb_mbuf = m;
- txb->txb_used = 1;
used++;
}
@@ -666,7 +664,6 @@ xnf_encap(struct xnf_softc *sc, struct mbuf *m_head, uint32_t *prod)
txb->txb_mbuf = NULL;
txb->txb_ndesc = 0;
- txb->txb_used = 0;
}
}
return (ENOBUFS);
@@ -724,7 +721,6 @@ xnf_txeof(struct xnf_softc *sc)
m_free(txb->txb_mbuf);
txb->txb_mbuf = NULL;
- txb->txb_used = 0;
done++;
}
@@ -1082,7 +1078,6 @@ xnf_tx_ring_destroy(struct xnf_softc *sc)
continue;
m_free(sc->sc_tx_buf[i].txb_mbuf);
sc->sc_tx_buf[i].txb_mbuf = NULL;
- sc->sc_tx_buf[i].txb_used = 0;
sc->sc_tx_buf[i].txb_ndesc = 0;
}
if (sc->sc_tx_rmap) {