svn commit: r193482 - user/kmacy/releng_7_2_fcs/sys/dev/cxgb
Kip Macy
kmacy at FreeBSD.org
Fri Jun 5 05:12:34 UTC 2009
Author: kmacy
Date: Fri Jun 5 05:12:33 2009
New Revision: 193482
URL: http://svn.freebsd.org/changeset/base/193482
Log:
- check that we don't try to produce packets faster than the card
consume them by checking in_use vs. size
- check for coalescing in direct transmit path
Modified:
user/kmacy/releng_7_2_fcs/sys/dev/cxgb/cxgb_sge.c
Modified: user/kmacy/releng_7_2_fcs/sys/dev/cxgb/cxgb_sge.c
==============================================================================
--- user/kmacy/releng_7_2_fcs/sys/dev/cxgb/cxgb_sge.c Fri Jun 5 04:20:14 2009 (r193481)
+++ user/kmacy/releng_7_2_fcs/sys/dev/cxgb/cxgb_sge.c Fri Jun 5 05:12:33 2009 (r193482)
@@ -1503,8 +1503,8 @@ static void
cxgb_start_locked(struct sge_qset *qs)
{
struct mbuf *m, *m_tail, *m_head = NULL;
- int txmax = TX_START_MAX_DESC;
struct sge_txq *txq = &qs->txq[TXQ_ETH];
+ int txmax = min(TX_START_MAX_DESC, txq->size - txq->in_use);
int in_use_init = txq->in_use;
struct port_info *pi = qs->port;
struct adapter *sc = pi->adapter;
@@ -1565,19 +1565,21 @@ cxgb_transmit_locked(struct ifnet *ifp,
{
struct port_info *pi = qs->port;
struct adapter *sc = pi->adapter;
- struct buf_ring *br = qs->txq[TXQ_ETH].txq_mr;
+ struct sge_txq *txq = &qs->txq[TXQ_ETH];
+ struct buf_ring *br = txq->txq_mr;
int error, count = 1;
TXQ_LOCK_ASSERT(qs);
reclaim_completed_tx(qs, (TX_ETH_Q_SIZE>>4), TXQ_ETH);
if (sc->tunq_coalesce == 0 && pi->link_config.link_ok &&
- TXQ_RING_EMPTY(qs)) {
+ TXQ_RING_EMPTY(qs) && (txq->size - txq->in_use) >= 4) {
if (t3_encap(qs, &m, 1)) {
if (m != NULL &&
(error = drbr_enqueue(ifp, br, m)) != 0)
return (error);
} else {
+ check_pkt_coalesce(qs);
/*
* We've bypassed the buf ring so we need to update
* ifp directly
More information about the svn-src-user
mailing list