From owner-freebsd-net@FreeBSD.ORG Fri Jun 22 01:40:05 2012 Return-Path: Delivered-To: freebsd-net@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 25DD81065672 for ; Fri, 22 Jun 2012 01:40:05 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id F32048FC0C for ; Fri, 22 Jun 2012 01:40:04 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q5M1e4nT064903 for ; Fri, 22 Jun 2012 01:40:04 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q5M1e4UV064902; Fri, 22 Jun 2012 01:40:04 GMT (envelope-from gnats) Date: Fri, 22 Jun 2012 01:40:04 GMT Message-Id: <201206220140.q5M1e4UV064902@freefall.freebsd.org> To: freebsd-net@FreeBSD.org From: Mark Johnston Cc: Subject: Re: kern/155030: [igb] igb(4) DEVICE_POLLING does not work with carp(4) X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Mark Johnston List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jun 2012 01:40:05 -0000 The following reply was made to PR kern/155030; it has been noted by GNATS. From: Mark Johnston To: bug-followup@FreeBSD.org, mm@FreeBSD.org Cc: Subject: Re: kern/155030: [igb] igb(4) DEVICE_POLLING does not work with carp(4) Date: Thu, 21 Jun 2012 21:38:36 -0400 --+HP7ph2BbKc20aGI Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Another way to go is just to fix igb(4)'s polling routine to work with multiple queues. That's what I've done in the src tree at my work; the patch is attached. Can you test it and let me know if it solves your problem? If so, I'll bug jfv@ to commit it. =) Thanks, -Mark --+HP7ph2BbKc20aGI Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="igb_polling.patch" diff --git a/share/man/man4/polling.4 b/share/man/man4/polling.4 index 2c711cc..6abc37c 100644 --- a/share/man/man4/polling.4 +++ b/share/man/man4/polling.4 @@ -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 , diff --git a/sys/dev/e1000/if_igb.c b/sys/dev/e1000/if_igb.c index cb6c63f..7a92b9a 100644 --- a/sys/dev/e1000/if_igb.c +++ b/sys/dev/e1000/if_igb.c @@ -1482,12 +1482,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 @@ -1498,11 +1492,12 @@ 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; + int i; IGB_CORE_LOCK(adapter); if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { @@ -1521,20 +1516,26 @@ igb_poll(struct ifnet *ifp, enum poll_cmd cmd, int count) } IGB_CORE_UNLOCK(adapter); - igb_rxeof(que, count, &rx_done); + for (i = 0; i < adapter->num_queues; i++) { + que = &adapter->queues[i]; + txr = que->txr; + + igb_rxeof(que, count, &rx_done); - IGB_TX_LOCK(txr); - do { - more = igb_txeof(txr); - } while (loop-- && more); + 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 */ @@ -4846,7 +4847,7 @@ next_desc: } if (done != NULL) - *done = rxdone; + *done += rxdone; IGB_RX_UNLOCK(rxr); return ((staterr & E1000_RXD_STAT_DD) ? TRUE : FALSE); --+HP7ph2BbKc20aGI--