From owner-svn-src-all@FreeBSD.ORG Wed Apr 22 01:25:04 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0D5501065673; Wed, 22 Apr 2009 01:25:04 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.232]) by mx1.freebsd.org (Postfix) with ESMTP id BF4B48FC0A; Wed, 22 Apr 2009 01:25:03 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: by rv-out-0506.google.com with SMTP id k40so1309258rvb.43 for ; Tue, 21 Apr 2009 18:25:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:from:date:to:cc :subject:message-id:reply-to:references:mime-version:content-type :content-disposition:in-reply-to:user-agent; bh=y/IMSkxk5Kiapl4vaa/TdydbuWC1LgmYczyybzjy+WQ=; b=QfWb2SxETRz/Y9Jvi2q56JUU+CAMRiJkqbqWDanEldXcU6dq21BXh16lqdgcm5O/Fh LmTVgqI6Lh5qlCF6SxvG1Q9jyvLETezMvcRr+5PV2fjfJwD+d9FaMneFAEEzWnD6VPto WttfBY3ZlmbYxLiWps+H/hjWc/lFDC11hbiR8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:date:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=jtQscjL2NDHbnJiP/nlvoVcTxbJcmjvlm0JOO1r2lLEarI/0m7kgNvpBP8X+aCnZyu 5k/kwzjq2q9my2zvMSDWOrIZCL+pTpXpuAfO3tSGsTvlC2JJ5iIY4SvnUP7D70BZdBip xne9BS32v1QuScaUc1VEcBcID7123rUBTIY7A= Received: by 10.141.122.1 with SMTP id z1mr3076241rvm.210.1240361721087; Tue, 21 Apr 2009 17:55:21 -0700 (PDT) Received: from michelle.cdnetworks.co.kr ([114.111.62.249]) by mx.google.com with ESMTPS id k41sm8177634rvb.46.2009.04.21.17.55.18 (version=SSLv3 cipher=RC4-MD5); Tue, 21 Apr 2009 17:55:19 -0700 (PDT) Received: by michelle.cdnetworks.co.kr (sSMTP sendmail emulation); Wed, 22 Apr 2009 09:59:12 +0900 From: Pyun YongHyeon Date: Wed, 22 Apr 2009 09:59:12 +0900 To: Robert Watson Message-ID: <20090422005912.GG93322@michelle.cdnetworks.co.kr> References: <200904210034.n3L0YV9i062814@svn.freebsd.org> 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: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Pyun YongHyeon Subject: Re: svn commit: r191344 - head/sys/dev/xl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Apr 2009 01:25:04 -0000 On Tue, Apr 21, 2009 at 10:24:07AM +0100, Robert Watson wrote: > > On Tue, 21 Apr 2009, Pyun YongHyeon wrote: > > > Clear IFF_DRV_OACTIVE flag if one of queued packets was transmitted. > > Previously it used to clear the flag only when the transmit queue > > is empty which may slow down Tx performance. > > While I'm here check whether driver is running and whether we can > > queue more packets in if_start handler. This fixes occasional > > watchdog timeouts. > > Historically, IFF_DRV_OACTIVE was present to allow the driver to prevent > calls to if_start when the driver was already in the transmit steady state > (i.e., interrupt-driven transmit). When the transmit interrupt saw it was > out of queued packets and interrupt-driven transmission was ending, it > would clear the flag so that future enqueues to the now-empty queue would > generate an if_start to trigger interrupt-driven transmission again. With > that in mind -- are you sure this is the right change? Shouldn't the Yes. > descriptor ring be refilled when an interrupt comes in from the device > after an appropriate interval? > Since interrupt handler knows that hardware can queue more packets if it reclaimed transmitted frames, clearing IFF_DRV_OACTIVE would make if_start called again. It's also possible this may be waste of time due to lack of free Tx descriptors when sending a highly fragmented frame but most cases it will refill Tx descriptor full. Keeping Tx queue full seems to be one of key factor to get best performance from the hardware. The Tx descriptor counter for xl(4) is 256 which I think somewhat large value for fast-ethernet controllers. I didn't benchmark performance differences after the change but 128 would be enough after my change.