Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 6 Aug 2012 20:44:05 +0000 (UTC)
From:      Jack F Vogel <jfv@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r239105 - head/sys/dev/e1000
Message-ID:  <201208062044.q76Ki59o081002@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jfv
Date: Mon Aug  6 20:44:05 2012
New Revision: 239105
URL: http://svn.freebsd.org/changeset/base/239105

Log:
  Correct the mq_start routine to avoid out-of-order
  packet delivery, always enqueue when possible. Also
  correct the DEPLETED test as multiple bits might be
  set.  Thanks to Randall Stewart for the changes!

Modified:
  head/sys/dev/e1000/if_igb.c

Modified: head/sys/dev/e1000/if_igb.c
==============================================================================
--- head/sys/dev/e1000/if_igb.c	Mon Aug  6 20:01:32 2012	(r239104)
+++ head/sys/dev/e1000/if_igb.c	Mon Aug  6 20:44:05 2012	(r239105)
@@ -100,7 +100,7 @@ int	igb_display_debug_stats = 0;
 /*********************************************************************
  *  Driver version:
  *********************************************************************/
-char igb_driver_version[] = "version - 2.3.4";
+char igb_driver_version[] = "version - 2.3.5";
 
 
 /*********************************************************************
@@ -961,7 +961,15 @@ igb_mq_start(struct ifnet *ifp, struct m
 	que = &adapter->queues[i];
 	if (((txr->queue_status & IGB_QUEUE_DEPLETED) == 0) &&
 	    IGB_TX_TRYLOCK(txr)) {
-		err = igb_mq_start_locked(ifp, txr, m);
+		struct mbuf *pm = NULL;
+		/*
+		** Try to queue first to avoid
+		** out-of-order delivery, but 
+		** settle for it if that fails
+		*/
+		if (m && drbr_enqueue(ifp, txr->br, m))
+			pm = m;
+		err = igb_mq_start_locked(ifp, txr, pm);
 		IGB_TX_UNLOCK(txr);
 	} else {
 		err = drbr_enqueue(ifp, txr->br, m);
@@ -981,7 +989,7 @@ igb_mq_start_locked(struct ifnet *ifp, s
 	IGB_TX_LOCK_ASSERT(txr);
 
 	if (((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) ||
-	    (txr->queue_status == IGB_QUEUE_DEPLETED) ||
+	    (txr->queue_status & IGB_QUEUE_DEPLETED) ||
 	    adapter->link_active == 0) {
 		if (m != NULL)
 			err = drbr_enqueue(ifp, txr->br, m);



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