cxgb_main.c (170869) | cxgb_main.c (171335) |
---|---|
1/************************************************************************** 2 3Copyright (c) 2007, Chelsio Inc. 4All rights reserved. 5 6Redistribution and use in source and binary forms, with or without 7modification, are permitted provided that the following conditions are met: 8 --- 14 unchanged lines hidden (view full) --- 23INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26POSSIBILITY OF SUCH DAMAGE. 27 28***************************************************************************/ 29 30#include <sys/cdefs.h> | 1/************************************************************************** 2 3Copyright (c) 2007, Chelsio Inc. 4All rights reserved. 5 6Redistribution and use in source and binary forms, with or without 7modification, are permitted provided that the following conditions are met: 8 --- 14 unchanged lines hidden (view full) --- 23INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26POSSIBILITY OF SUCH DAMAGE. 27 28***************************************************************************/ 29 30#include <sys/cdefs.h> |
31__FBSDID("$FreeBSD: head/sys/dev/cxgb/cxgb_main.c 170869 2007-06-17 04:33:38Z kmacy $"); | 31__FBSDID("$FreeBSD: head/sys/dev/cxgb/cxgb_main.c 171335 2007-07-10 06:01:45Z kmacy $"); |
32 33#include <sys/param.h> 34#include <sys/systm.h> 35#include <sys/kernel.h> 36#include <sys/bus.h> 37#include <sys/module.h> 38#include <sys/pciio.h> 39#include <sys/conf.h> --- 1568 unchanged lines hidden (view full) --- 1608 1609 if (IFQ_DRV_IS_EMPTY(&ifp->if_snd)) 1610 return (ENOBUFS); 1611 1612 qs = &p->adapter->sge.qs[p->first_qset]; 1613 txq = &qs->txq[TXQ_ETH]; 1614 err = 0; 1615 | 32 33#include <sys/param.h> 34#include <sys/systm.h> 35#include <sys/kernel.h> 36#include <sys/bus.h> 37#include <sys/module.h> 38#include <sys/pciio.h> 39#include <sys/conf.h> --- 1568 unchanged lines hidden (view full) --- 1608 1609 if (IFQ_DRV_IS_EMPTY(&ifp->if_snd)) 1610 return (ENOBUFS); 1611 1612 qs = &p->adapter->sge.qs[p->first_qset]; 1613 txq = &qs->txq[TXQ_ETH]; 1614 err = 0; 1615 |
1616 if (txq->flags & TXQ_TRANSMITTING) 1617 return (EINPROGRESS); 1618 |
|
1616 mtx_lock(&txq->lock); | 1619 mtx_lock(&txq->lock); |
1620 txq->flags |= TXQ_TRANSMITTING; |
|
1617 in_use_init = txq->in_use; 1618 while ((txq->in_use - in_use_init < txmax) && 1619 (txq->size > txq->in_use + TX_MAX_DESC)) { 1620 IFQ_DRV_DEQUEUE(&ifp->if_snd, m); 1621 if (m == NULL) 1622 break; 1623 /* 1624 * Convert chain to M_IOVEC --- 21 unchanged lines hidden (view full) --- 1646 } else 1647 break; 1648 } 1649 m = m0; 1650 if ((err = t3_encap(p, &m)) != 0) 1651 break; 1652 BPF_MTAP(ifp, m); 1653 } | 1621 in_use_init = txq->in_use; 1622 while ((txq->in_use - in_use_init < txmax) && 1623 (txq->size > txq->in_use + TX_MAX_DESC)) { 1624 IFQ_DRV_DEQUEUE(&ifp->if_snd, m); 1625 if (m == NULL) 1626 break; 1627 /* 1628 * Convert chain to M_IOVEC --- 21 unchanged lines hidden (view full) --- 1650 } else 1651 break; 1652 } 1653 m = m0; 1654 if ((err = t3_encap(p, &m)) != 0) 1655 break; 1656 BPF_MTAP(ifp, m); 1657 } |
1658 txq->flags &= ~TXQ_TRANSMITTING; |
|
1654 mtx_unlock(&txq->lock); 1655 1656 if (__predict_false(err)) { 1657 if (err == ENOMEM) { 1658 ifp->if_drv_flags |= IFF_DRV_OACTIVE; 1659 IFQ_LOCK(&ifp->if_snd); 1660 IFQ_DRV_PREPEND(&ifp->if_snd, m); 1661 IFQ_UNLOCK(&ifp->if_snd); --- 18 unchanged lines hidden (view full) --- 1680 struct sge_txq *txq; 1681 int error; 1682 1683 qs = &pi->adapter->sge.qs[pi->first_qset]; 1684 txq = &qs->txq[TXQ_ETH]; 1685 1686 do { 1687 if (desc_reclaimable(txq) > TX_CLEAN_MAX_DESC) | 1659 mtx_unlock(&txq->lock); 1660 1661 if (__predict_false(err)) { 1662 if (err == ENOMEM) { 1663 ifp->if_drv_flags |= IFF_DRV_OACTIVE; 1664 IFQ_LOCK(&ifp->if_snd); 1665 IFQ_DRV_PREPEND(&ifp->if_snd, m); 1666 IFQ_UNLOCK(&ifp->if_snd); --- 18 unchanged lines hidden (view full) --- 1685 struct sge_txq *txq; 1686 int error; 1687 1688 qs = &pi->adapter->sge.qs[pi->first_qset]; 1689 txq = &qs->txq[TXQ_ETH]; 1690 1691 do { 1692 if (desc_reclaimable(txq) > TX_CLEAN_MAX_DESC) |
1688 taskqueue_enqueue(pi->adapter->tq, 1689 &pi->timer_reclaim_task); | 1693 taskqueue_enqueue(pi->adapter->tq, &txq->qreclaim_task); |
1690 1691 error = cxgb_start_tx(ifp, TX_START_MAX_DESC); 1692 } while (error == 0); 1693} 1694 1695static void 1696cxgb_start(struct ifnet *ifp) 1697{ --- 634 unchanged lines hidden --- | 1694 1695 error = cxgb_start_tx(ifp, TX_START_MAX_DESC); 1696 } while (error == 0); 1697} 1698 1699static void 1700cxgb_start(struct ifnet *ifp) 1701{ --- 634 unchanged lines hidden --- |