Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 Oct 2009 17:50:10 +0000 (UTC)
From:      Pyun YongHyeon <yongari@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org
Subject:   svn commit: r198038 - in stable/6/sys: . conf contrib/pf dev/cxgb pci
Message-ID:  <200910131750.n9DHoAw0012111@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: yongari
Date: Tue Oct 13 17:50:10 2009
New Revision: 198038
URL: http://svn.freebsd.org/changeset/base/198038

Log:
  MFC 191344:
    Clear IFF_DRV_OACTIVE flag if one of queued packets was transmitted.
    Previously it used to clear the flag only when the transmit queue
    is empty which may slow down Tx performance.
    While I'm here check whether driver is running and whether we can
    queue more packets in if_start handler. This fixes occasional
    watchdog timeouts.

Modified:
  stable/6/sys/   (props changed)
  stable/6/sys/conf/   (props changed)
  stable/6/sys/contrib/pf/   (props changed)
  stable/6/sys/dev/cxgb/   (props changed)
  stable/6/sys/pci/if_xl.c

Modified: stable/6/sys/pci/if_xl.c
==============================================================================
--- stable/6/sys/pci/if_xl.c	Tue Oct 13 17:41:46 2009	(r198037)
+++ stable/6/sys/pci/if_xl.c	Tue Oct 13 17:50:10 2009	(r198038)
@@ -2104,13 +2104,13 @@ xl_txeof(struct xl_softc *sc)
 		m_freem(cur_tx->xl_mbuf);
 		cur_tx->xl_mbuf = NULL;
 		ifp->if_opackets++;
+		ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
 
 		cur_tx->xl_next = sc->xl_cdata.xl_tx_free;
 		sc->xl_cdata.xl_tx_free = cur_tx;
 	}
 
 	if (sc->xl_cdata.xl_tx_head == NULL) {
-		ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
 		sc->xl_wdog_timer = 0;
 		sc->xl_cdata.xl_tx_tail = NULL;
 	} else {
@@ -2547,6 +2547,9 @@ xl_start_locked(struct ifnet *ifp)
 
 	XL_LOCK_ASSERT(sc);
 
+	if ((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) !=
+	    IFF_DRV_RUNNING)
+		return;
 	/*
 	 * Check for an available queue slot. If there are none,
 	 * punt.
@@ -2675,7 +2678,8 @@ xl_start_90xB_locked(struct ifnet *ifp)
 
 	XL_LOCK_ASSERT(sc);
 
-	if (ifp->if_drv_flags & IFF_DRV_OACTIVE)
+	if ((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) !=
+	    IFF_DRV_RUNNING)
 		return;
 
 	idx = sc->xl_cdata.xl_tx_prod;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200910131750.n9DHoAw0012111>