diff options
author | kmacy <kmacy@FreeBSD.org> | 2008-01-15 03:27:42 +0000 |
---|---|---|
committer | kmacy <kmacy@FreeBSD.org> | 2008-01-15 03:27:42 +0000 |
commit | 1287cf02b7e0d7002350223eab1c4934b4235e2b (patch) | |
tree | 6e233a427f3e7628bf92ad61405aaad614d043d5 /sys/dev/cxgb/cxgb_main.c | |
parent | 9696aa5a5bdee14a9e1f1569e7112fae4f1fecc1 (diff) | |
download | FreeBSD-src-1287cf02b7e0d7002350223eab1c4934b4235e2b.zip FreeBSD-src-1287cf02b7e0d7002350223eab1c4934b4235e2b.tar.gz |
- move WR_LEN in to cxgb_adapter.h add PIO_LEN to make intent clearer
- move cxgb_tx_common in to cxgb_multiq.c and rename to cxgb_tx
- move cxgb_tx_common dependencies
- further simplify cxgb_dequeue_packet for the non-multiqueue case
- only launch one service thread per port in the non-multiq case
- remove dead cleaning code from cxgb_sge.c
- simplify PIO case substantially in by returning directly from mbuf collapse
and just using m_copydata
- remove gratuitous m_gethdr in the rx path
- clarify freeing of mbufs in collapse
Diffstat (limited to 'sys/dev/cxgb/cxgb_main.c')
-rw-r--r-- | sys/dev/cxgb/cxgb_main.c | 73 |
1 files changed, 0 insertions, 73 deletions
diff --git a/sys/dev/cxgb/cxgb_main.c b/sys/dev/cxgb/cxgb_main.c index c808bca..e505758 100644 --- a/sys/dev/cxgb/cxgb_main.c +++ b/sys/dev/cxgb/cxgb_main.c @@ -281,21 +281,6 @@ struct cxgb_ident { static int set_eeprom(struct port_info *pi, const uint8_t *data, int len, int offset); -static __inline void -check_pkt_coalesce(struct sge_qset *qs) -{ - struct adapter *sc; - struct sge_txq *txq; - - txq = &qs->txq[TXQ_ETH]; - sc = qs->port->adapter; - - if (sc->tunq_fill[qs->idx] && (txq->in_use < (txq->size - (txq->size>>2)))) - sc->tunq_fill[qs->idx] = 0; - else if (!sc->tunq_fill[qs->idx] && (txq->in_use > (txq->size - (txq->size>>2)))) - sc->tunq_fill[qs->idx] = 1; -} - static __inline char t3rev2char(struct adapter *adapter) { @@ -1865,64 +1850,6 @@ cxgb_ioctl(struct ifnet *ifp, unsigned long command, caddr_t data) return (error); } -int -cxgb_tx_common(struct ifnet *ifp, struct sge_qset *qs, uint32_t txmax) -{ - struct sge_txq *txq; - int err, in_use_init, count; - struct mbuf **m_vec; - - txq = &qs->txq[TXQ_ETH]; - m_vec = txq->txq_m_vec; - in_use_init = txq->in_use; - err = 0; - while ((txq->in_use - in_use_init < txmax) && - (txq->size > txq->in_use + TX_MAX_DESC)) { - check_pkt_coalesce(qs); - count = cxgb_dequeue_packet(ifp, txq, m_vec); - if (count == 0) - break; - ETHER_BPF_MTAP(ifp, m_vec[0]); - - if ((err = t3_encap(qs, m_vec, count)) != 0) - break; - txq->txq_enqueued += count; - } -#if 0 /* !MULTIQ */ - if (__predict_false(err)) { - if (err == ENOMEM) { - ifp->if_drv_flags |= IFF_DRV_OACTIVE; - IFQ_LOCK(&ifp->if_snd); - IFQ_DRV_PREPEND(&ifp->if_snd, m_vec[0]); - IFQ_UNLOCK(&ifp->if_snd); - } - } - if (err == 0 && m_vec[0] == NULL) { - err = ENOBUFS; - } - else if ((err == 0) && (txq->size <= txq->in_use + TX_MAX_DESC) && - (ifp->if_drv_flags & IFF_DRV_OACTIVE) == 0) { - setbit(&qs->txq_stopped, TXQ_ETH); - ifp->if_drv_flags |= IFF_DRV_OACTIVE; - err = ENOSPC; - } -#else - if ((err == 0) && (txq->size <= txq->in_use + TX_MAX_DESC)) { - err = ENOSPC; - setbit(&qs->txq_stopped, TXQ_ETH); - } - if (err == ENOMEM) { - int i; - /* - * Sub-optimal :-/ - */ - for (i = 0; i < count; i++) - m_freem(m_vec[i]); - } -#endif - return (err); -} - static int cxgb_media_change(struct ifnet *ifp) { |