set IFF_OACTIVE to avoid hangs when the tx ring fills up

This commit is contained in:
Kip Macy 2007-05-27 04:39:07 +00:00
parent 0d99488ded
commit b2dda71e61
2 changed files with 10 additions and 0 deletions

View File

@ -1607,6 +1607,11 @@ cxgb_start_tx(struct ifnet *ifp, uint32_t txmax)
if (err == 0 && m == NULL)
err = ENOBUFS;
if ((err == 0) && (txq->size <= txq->in_use + TX_MAX_DESC) &&
(ifp->if_drv_flags & IFF_DRV_OACTIVE) == 0) {
ifp->if_drv_flags |= IFF_DRV_OACTIVE;
err = ENOSPC;
}
return (err);
}

View File

@ -766,6 +766,11 @@ sge_timer_reclaim(void *arg, int ncount)
for (i = 0; i < n; i++) {
m_freem_vec(m_vec[i]);
}
if (qs->port->ifp->if_drv_flags & IFF_DRV_OACTIVE &&
txq->size - txq->in_use >= TX_START_MAX_DESC) {
qs->port->ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
taskqueue_enqueue(qs->port->tq, &qs->port->start_task);
}
}
txq = &qs->txq[TXQ_OFLD];