From owner-svn-src-all@FreeBSD.ORG Thu Apr 16 23:08:54 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 76CE41065672; Thu, 16 Apr 2009 23:08:54 +0000 (UTC) (envelope-from mat.macy@gmail.com) Received: from yw-out-2324.google.com (yw-out-2324.google.com [74.125.46.29]) by mx1.freebsd.org (Postfix) with ESMTP id 990818FC15; Thu, 16 Apr 2009 23:08:53 +0000 (UTC) (envelope-from mat.macy@gmail.com) Received: by yw-out-2324.google.com with SMTP id 5so413856ywh.13 for ; Thu, 16 Apr 2009 16:08:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type:content-transfer-encoding; bh=QRwIHB0wxt4oFjUL7sxZzzJnwyRCPVPEfSHC2NJg12Q=; b=KB1thipQ8wX9/YOA3NrtEJGGQzWaVSk1ayEUhevIZPVZjdvO3Wlo1J079OXHTlNUiH NVNjHr8traolNyvP43B2FYZYLB1gFw21BcgtSgAu2HOQCdyiUMIbMwRAClfOkZO27Zyn 7Cc40wPhkn4VLlRFtZa18BRRblsPOJtCEmi5I= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=U3qO6+r9h+gzuwdEOLqEPlbHuID/e07g2CFtXEnIuFHbCvIzS0YlRwyd5C0LSiFwgs aW7se3ZzgieA8jdaBeT4mYNMMDuzAWWlYejkHCibYCCMbDME822t+zis9q6MpHvFdPLh f+7MwswksfyTlnqROTwpXPVAON+D8dIQLi3i0= MIME-Version: 1.0 Sender: mat.macy@gmail.com Received: by 10.100.153.6 with SMTP id a6mr2706413ane.149.1239923332967; Thu, 16 Apr 2009 16:08:52 -0700 (PDT) In-Reply-To: References: <200904140317.n3E3HigF092519@svn.freebsd.org> <3c1674c90904141545tc2aa075l512cb76c1f334069@mail.gmail.com> Date: Thu, 16 Apr 2009 16:08:52 -0700 X-Google-Sender-Auth: 0e71ab34abc8b5f5 Message-ID: <3c1674c90904161608m290938e9oe973ac2202d4a834@mail.gmail.com> From: Kip Macy To: Robert Watson Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r191037 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list 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: Thu, 16 Apr 2009 23:08:54 -0000 see 191161 - I think it addresses everything -Kip On Thu, Apr 16, 2009 at 3:51 PM, Robert Watson wrote: > On Tue, 14 Apr 2009, Kip Macy wrote: > >>> The commit message should perhaps read: >>> >>> =A0Call default if_qflush on ifq if there are still packets left in the >>> =A0default queue after calling the driver's flush method. >>> >>> However, this seems a bit odd: what if the driver uses if_snd as its >>> queue but implements other differences in the transmit routine? =A0In t= hat >>> case, we might impose default queue properties on if_snd even though th= e >>> driver doesn't use them. =A0Could you talk a bit about the circumstance= s under >>> which the driver provides an if_qflush that doesn't drain its queues >>> properly? >> >> I'm afraid I don't understand the question. If a driver only uses if_snd >> for its transmit routine then there is no reason for it to override the >> default if_qflush implementation. > > In the past (and possibly still) device driver and link layers have used > if_snd plus their own queues for differentiated traffic. =A0For example, > if_slip used an additional "fast" queue for interactive traffic, and if_s= nd > for "slow" traffic. =A0It would still need to implement a flush method it= self > since it maintains additional queues. > > What I'd like to see is two modes of operation: > > (1) Historic mode: the ifnet framework provides all queueing support, > =A0 =A0enqueuing using the standard macros to if_snd, and the default > =A0 =A0implementation of if_qflush in place to flush the queue. =A0This m= eans > =A0 =A0implementing neither if_transmit nor if_qflush methods on the ifne= t. > > (2) Modern mode: the driver provides all queueing support, possibly by > =A0 =A0invoking "library" =A0routines from the stack, and the ifnet queue= stays > =A0 =A0entirely out of the way. =A0This means implementing both if_transm= it and > =A0 =A0if_qflush methods on the ifnet. > > To support the (1) scenario above, simply calling ifp->if_qflush() does t= he > trick fine, since it's pre-initialized to if_qflush(). =A0For the (2) > scenario, the driver might choose to call if_qflush() to perform some or = all > flushing, but it shouldn't happen by itself unless the device driver auth= or > wants that. > > Robert N M Watson > Computer Laboratory > University of Cambridge --=20 All that is necessary for the triumph of evil is that good men do nothing. Edmund Burke