Hi,
This is a straightforward diff moving invariant chunks before
dequeue operation.
OK?
diff --git sys/dev/pci/if_vic.c sys/dev/pci/if_vic.c
index e34a1aa4f27..bc1e600d8bc 100644
--- sys/dev/pci/if_vic.c
+++ sys/dev/pci/if_vic.c
@@ -1049,43 +1049,35 @@ vic_start(struct ifnet *ifp)
if (VIC_TXURN(sc)) {
ifq_set_oactive(&ifp->if_snd);
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;
}
txd = &sc->sc_txq[idx];
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
if (ifp->if_bpf)
bpf_mtap(ifp->if_bpf, txb->txb_m, BPF_DIRECTION_OUT);