From owner-svn-src-head@FreeBSD.ORG Mon May 4 21:03:13 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 43F7E7F7; Mon, 4 May 2015 21:03:13 +0000 (UTC) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F0F6715D4; Mon, 4 May 2015 21:03:12 +0000 (UTC) Received: from slw by zxy.spb.ru with local (Exim 4.84 (FreeBSD)) (envelope-from ) id 1YpNW4-000Ete-9M; Tue, 05 May 2015 00:03:04 +0300 Date: Tue, 5 May 2015 00:03:04 +0300 From: Slawa Olhovchenkov To: John Baldwin Cc: Gleb Smirnoff , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r282280 - in head/sys/dev: e1000 ixgbe ixl Message-ID: <20150504210304.GA1394@zxy.spb.ru> References: <201504301823.t3UINd74073186@svn.freebsd.org> <26088556.xbkUe5VAyp@ralph.baldwin.cx> <20150504185125.GL34544@FreeBSD.org> <2463555.FfYUgqxYi8@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2463555.FfYUgqxYi8@ralph.baldwin.cx> User-Agent: Mutt/1.5.23 (2014-03-12) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 04 May 2015 21:03:13 -0000 On Mon, May 04, 2015 at 04:01:28PM -0400, John Baldwin wrote: > On Monday, May 04, 2015 09:51:25 PM Gleb Smirnoff wrote: > > John, > > > > On Mon, May 04, 2015 at 09:58:49AM -0400, John Baldwin wrote: > > J> > J> > J> So the importaing thing here is that if_get_counter() is still doing > > J> > J> > J> per-ifnet stats. The stat you underlined above is per-queue instead. > > J> > J> > J> We well need more explicitly knowledge of queues outside of drivers > > J> > J> > J> and in the stack itself to support a generic framework for per-queue > > J> > J> > J> stats. > > J> > J> > > > J> > J> > This depends on how generic we want the API to be. Of course, we can add > > J> > J> > an extra argument to if_get_counter(). > > J> > J> > > > J> > J> > However, if we don't expect the number of queues to exceed a reasonable > > J> > J> > number of 255 :), we can fit the functionality into existing API. > > J> > J> > We can keep the queue number in the highest 8 bits of the ift_counter > > J> > J> > parameter. > > J> > J> > > > J> > J> > #define IFCOUNTER_MASK 0x00ffffff > > J> > J> > #define IFCOUNTER_QUEUE(c) ((c) >> 24) > > J> > J> > > J> > J> I'd prefer that expose queues more directly and figure out how to handle > > J> > J> per-queue stats then (e.g. do we have some sort of driver-independent > > J> > J> structure that each ifnet has 1 or more of that maps to a queue and has > > J> > J> driver provided methods, etc. If so you could have a driver method for > > J> > J> queue stats). Note that I did use if_get_counter to report the > > J> > J> per-interface stats instead of adding a new sysctl. > > J> > > > J> > What do you prefer: an extra argument to the if_get_counter() or a extra > > J> > ifop? > > J> > > J> As I said, I'd prefer we expose queues to the stack more directly complete > > J> with per-queue ops (e.g. I'd like a per-queue if_transmit thing, though > > J> probably more like the old if_start). > > > > Your answer seems quite orthogonal to my question. I reread it couple of times, > > but still can't figure out how exactly do you prefet to fetch per-queue stats. > > Can you please explain in more detail? > > struct if_queue { > struct ifnet *ifq_parent; > void (*ifq_get_counter)(struct if_queue *, ift_counter); > ... > }; > > (Pretend that if_queue is a new object type and that each RX or TX queue on a > NIC has one.) What about bulk get? One request for 1.5K queues stats.