Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 6 Aug 2012 22:43:49 +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: r239109 - in head: share/man/man4 sys/dev/e1000
Message-ID:  <201208062243.q76MhnkP091068@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jfv
Date: Mon Aug  6 22:43:49 2012
New Revision: 239109
URL: http://svn.freebsd.org/changeset/base/239109

Log:
  Make the polling interface in igb able to handle
  multiqueue, and correct the rxdone handling. Update
  the polling man page to include igb as well.
  
  Thanks to Mark Johnston for these changes.

Modified:
  head/share/man/man4/polling.4
  head/sys/dev/e1000/if_igb.c

Modified: head/share/man/man4/polling.4
==============================================================================
--- head/share/man/man4/polling.4	Mon Aug  6 21:33:11 2012	(r239108)
+++ head/share/man/man4/polling.4	Mon Aug  6 22:43:49 2012	(r239109)
@@ -184,6 +184,7 @@ As of this writing, the
 .Xr fwe 4 ,
 .Xr fwip 4 ,
 .Xr fxp 4 ,
+.Xr igb 4 ,
 .Xr ixgb 4 ,
 .Xr nfe 4 ,
 .Xr nge 4 ,

Modified: head/sys/dev/e1000/if_igb.c
==============================================================================
--- head/sys/dev/e1000/if_igb.c	Mon Aug  6 21:33:11 2012	(r239108)
+++ head/sys/dev/e1000/if_igb.c	Mon Aug  6 22:43:49 2012	(r239109)
@@ -1502,12 +1502,6 @@ igb_irq_fast(void *arg)
 }
 
 #ifdef DEVICE_POLLING
-/*********************************************************************
- *
- *  Legacy polling routine : if using this code you MUST be sure that
- *  multiqueue is not defined, ie, set igb_num_queues to 1.
- *
- *********************************************************************/
 #if __FreeBSD_version >= 800000
 #define POLL_RETURN_COUNT(a) (a)
 static int
@@ -1518,8 +1512,8 @@ static void
 igb_poll(struct ifnet *ifp, enum poll_cmd cmd, int count)
 {
 	struct adapter		*adapter = ifp->if_softc;
-	struct igb_queue	*que = adapter->queues;
-	struct tx_ring		*txr = adapter->tx_rings;
+	struct igb_queue	*que;
+	struct tx_ring		*txr;
 	u32			reg_icr, rx_done = 0;
 	u32			loop = IGB_MAX_LOOP;
 	bool			more;
@@ -1541,20 +1535,26 @@ igb_poll(struct ifnet *ifp, enum poll_cm
 	}
 	IGB_CORE_UNLOCK(adapter);
 
-	igb_rxeof(que, count, &rx_done);
+	for (int i = 0; i < adapter->num_queues; i++) {
+		que = &adapter->queues[i];
+		txr = que->txr;
 
-	IGB_TX_LOCK(txr);
-	do {
-		more = igb_txeof(txr);
-	} while (loop-- && more);
+		igb_rxeof(que, count, &rx_done);
+
+		IGB_TX_LOCK(txr);
+		do {
+			more = igb_txeof(txr);
+		} while (loop-- && more);
 #if __FreeBSD_version >= 800000
-	if (!drbr_empty(ifp, txr->br))
-		igb_mq_start_locked(ifp, txr, NULL);
+		if (!drbr_empty(ifp, txr->br))
+			igb_mq_start_locked(ifp, txr, NULL);
 #else
-	if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
-		igb_start_locked(txr, ifp);
+		if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
+			igb_start_locked(txr, ifp);
 #endif
-	IGB_TX_UNLOCK(txr);
+		IGB_TX_UNLOCK(txr);
+	}
+
 	return POLL_RETURN_COUNT(rx_done);
 }
 #endif /* DEVICE_POLLING */
@@ -4901,7 +4901,7 @@ next_desc:
 	}
 
 	if (done != NULL)
-		*done = rxdone;
+		*done += rxdone;
 
 	IGB_RX_UNLOCK(rxr);
 	return ((staterr & E1000_RXD_STAT_DD) ? TRUE : FALSE);



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