From owner-freebsd-net@FreeBSD.ORG Thu Jan 17 06:33:07 2013 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B9DBF182 for ; Thu, 17 Jan 2013 06:33:07 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: from onelab2.iet.unipi.it (onelab2.iet.unipi.it [131.114.59.238]) by mx1.freebsd.org (Postfix) with ESMTP id 7C1937DC for ; Thu, 17 Jan 2013 06:33:06 +0000 (UTC) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id DCBBF7300A; Thu, 17 Jan 2013 07:32:32 +0100 (CET) Date: Thu, 17 Jan 2013 07:32:32 +0100 From: Luigi Rizzo To: Jack Vogel Subject: Re: two problems in dev/e1000/if_lem.c::lem_handle_rxtx() Message-ID: <20130117063232.GA59734@onelab2.iet.unipi.it> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i Cc: "freebsd-net@freebsd.org" , head@freebsd.org X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jan 2013 06:33:07 -0000 On Tue, Jan 15, 2013 at 09:43:54PM -0800, Jack Vogel wrote: > OK, will look at this as soon as I can. > > Jack below is a short patch that reschedule the task if the queue has not been drained. Tested on qemu. I can do the commit if you like. cheers luigi Index: ../head/sys/dev/e1000/if_lem.c =================================================================== --- ../head/sys/dev/e1000/if_lem.c (revision 245218) +++ ../head/sys/dev/e1000/if_lem.c (working copy) @@ -1337,12 +1411,16 @@ if (ifp->if_drv_flags & IFF_DRV_RUNNING) { - lem_rxeof(adapter, adapter->rx_process_limit, NULL); + bool more = lem_rxeof(adapter, adapter->rx_process_limit, NULL); EM_TX_LOCK(adapter); lem_txeof(adapter); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) lem_start_locked(ifp); EM_TX_UNLOCK(adapter); + if (more) { + taskqueue_enqueue(adapter->tq, &adapter->rxtx_task); + return; + } } if (ifp->if_drv_flags & IFF_DRV_RUNNING)