From owner-freebsd-net@FreeBSD.ORG Sat Sep 27 11:21:58 2014 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EFB9FA64 for ; Sat, 27 Sep 2014 11:21:57 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 6B27BE6 for ; Sat, 27 Sep 2014 11:21:56 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id s8RBLseU052442 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 27 Sep 2014 15:21:55 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id s8RBLsYx052441; Sat, 27 Sep 2014 15:21:54 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Sat, 27 Sep 2014 15:21:54 +0400 From: Gleb Smirnoff To: Eric Joyner Subject: Re: [PATCH] Convert ixl(4) and ixlv(4) to ifcounters, and fix some counter bugs Message-ID: <20140927112154.GO884@glebius.int.ru> References: <20140925120810.GA884@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Cc: freebsd-net , Ryan Stone X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Sep 2014 11:21:58 -0000 Thanks, Eric. Ryan, will you commit? The cxgbe(4) is already updated by Navdeep. Me and melifaro@ are finishing lagg(4). Once Intel drivers are done, we can go forward for counter(9) in struct ifnet. On Fri, Sep 26, 2014 at 03:25:59PM -0700, Eric Joyner wrote: E> I approve of this patch -- I tested it on ixl and ixlv on stable/10, and at E> least the sysctl stats still look good. E> E> --- E> - Eric Joyner E> E> On Thu, Sep 25, 2014 at 5:08 AM, Gleb Smirnoff wrote: E> E> > On Tue, Sep 23, 2014 at 07:18:51PM -0400, Ryan Stone wrote: E> > R> The patch below converts the ixl(4) and ixlv(4) drivers to use the new E> > R> ifcounter interface. I've hidden the interface behind some macros to E> > R> ensure that the driver continues to compile for FreeBSD 10 and E> > R> earlier. The result of the macros is that the ifcounter E> > R> implementation is somewhat clunkier than I would have liked, but I E> > R> preferred to try and share as much code between the legacy counter E> > R> implementation and the ifcounter implementation. E> > R> E> > R> I have tested the ixl driver with head. I have only compile-tested it E> > R> for stable/10. E> > R> E> > R> This patch also fixes some counter bugs: E> > R> E> > R> - Ensure that tx discards are reported E> > R> - There are actually two types of rx discard counters in the hardware. E> > R> Currently the driver is only reporting discards from one of the two E> > R> counters, so I fixed that E> > R> - The ipackets and opackets counters were being unnecessarily E> > R> incremented in the rx and tx paths. This was racy, unnecessary (the E> > R> counters also get explicitly set based on the values in HW counters) E> > R> and very bad for performance -- the cacheline contained the counters E> > R> was constantly bouncing between CPUs. I saw this even with only one E> > R> queue active, probably due to false sharing with some other field in E> > R> the ifnet struct. E> > R> E> > R> E> > https://people.freebsd.org/~rstone/patches/ixl/0005-Convert-ixl-and-ixlv-drivers-to-use-new-ifcounter-in.patch E> > E> > Thanks, Ryan! E> > E> > I'd suggest to use check against __FreeBSD_version >= 1100036. E> > E> > Can you please commit this? Navdeep promised to do cxgbe(4), Alexander E> > is working on ixgbe. After that we can go forward with making counters E> > in struct ifnet non-racy and cheap counter(9). E> > E> > -- E> > Totus tuus, Glebius. E> > _______________________________________________ E> > freebsd-net@freebsd.org mailing list E> > http://lists.freebsd.org/mailman/listinfo/freebsd-net E> > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" E> > -- Totus tuus, Glebius.