From owner-svn-src-head@FreeBSD.ORG Mon Aug 6 22:43:50 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 38AD8106566B; Mon, 6 Aug 2012 22:43:50 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0AA488FC15; Mon, 6 Aug 2012 22:43:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q76MhnH5091071; Mon, 6 Aug 2012 22:43:49 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q76MhnkP091068; Mon, 6 Aug 2012 22:43:49 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201208062243.q76MhnkP091068@svn.freebsd.org> From: Jack F Vogel Date: Mon, 6 Aug 2012 22:43:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239109 - in head: share/man/man4 sys/dev/e1000 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Aug 2012 22:43:50 -0000 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);