mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-30 05:36:10 +00:00
if_genet: don't load DMA mapping when tx_queue is full
gen_encap() always calls bus_dmamap_load_mbuf_sg() into 'map' (which is the current tx_queue). If the tx_queue is full, it will load with a 'map' that already has a currently active mapping. This violates the busdma(9) KPI. Checking for a full queue and returning ENOBUFS will allow gen_start_locked() to set the IFF_DRV_OACTIVE faster without having to needlessly check if the mbuf will fit (it won't). PR: 256482 Reviewed by: mhorne MFC after: 1 week Submitted by: ghuckriede@blackberry.com
This commit is contained in:
parent
3703e1a73e
commit
a35f665109
|
@ -1069,6 +1069,10 @@ gen_encap(struct gen_softc *sc, struct mbuf **mp)
|
|||
GEN_ASSERT_LOCKED(sc);
|
||||
|
||||
q = &sc->tx_queue[DEF_TXQUEUE];
|
||||
if (q->queued == q->nentries) {
|
||||
/* tx_queue is full */
|
||||
return (ENOBUFS);
|
||||
}
|
||||
|
||||
m = *mp;
|
||||
|
||||
|
|
Loading…
Reference in a new issue