From owner-freebsd-net@FreeBSD.ORG Fri Sep 26 22:26:40 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 B7338E68; Fri, 26 Sep 2014 22:26:40 +0000 (UTC) Received: from mail-pd0-x232.google.com (mail-pd0-x232.google.com [IPv6:2607:f8b0:400e:c02::232]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8639EE1; Fri, 26 Sep 2014 22:26:40 +0000 (UTC) Received: by mail-pd0-f178.google.com with SMTP id ft15so13463782pdb.23 for ; Fri, 26 Sep 2014 15:26:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=EGjCwDTfjRftHt7MMZgb2yWeirUAeQrMfLmkNiYYEDk=; b=0qJRB0/gaegJH5fZ2sYBTSqH3STNmfNOe2nYZtHSAPzKX4agN1KrNyvdbbZgllLnt+ CVgkbVg2iNCAaUzL/RuFSbjuSQammSBVn/AR8oR5CCEVmsGpBcVzuZVEW1E/Ffay9gax Q7dBOkU+PoxHUdaknhGdbasrXPLXhFBegQs8tf0FJjVivkBwOtmRtw5y1G2JETif80ZM aQhD1bPnOzoDaajKrVv4T053tSut/uxUgFmuUeGEspFhty68vYUrrQVLDfpDXpmiZ6iu pspBCedJ13eNTMFxq+98z1MU1qDtS34vzT/PIXVcwwjTx/fylevv3jjG7ohqciF3RuYs s8Ig== X-Received: by 10.68.196.226 with SMTP id ip2mr35644148pbc.120.1411770400027; Fri, 26 Sep 2014 15:26:40 -0700 (PDT) MIME-Version: 1.0 Received: by 10.70.81.137 with HTTP; Fri, 26 Sep 2014 15:25:59 -0700 (PDT) In-Reply-To: <20140925120810.GA884@FreeBSD.org> References: <20140925120810.GA884@FreeBSD.org> From: Eric Joyner Date: Fri, 26 Sep 2014 15:25:59 -0700 Message-ID: Subject: Re: [PATCH] Convert ixl(4) and ixlv(4) to ifcounters, and fix some counter bugs To: Gleb Smirnoff Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 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: Fri, 26 Sep 2014 22:26:40 -0000 I approve of this patch -- I tested it on ixl and ixlv on stable/10, and at least the sysctl stats still look good. --- - Eric Joyner On Thu, Sep 25, 2014 at 5:08 AM, Gleb Smirnoff wrote: > On Tue, Sep 23, 2014 at 07:18:51PM -0400, Ryan Stone wrote: > R> The patch below converts the ixl(4) and ixlv(4) drivers to use the new > R> ifcounter interface. I've hidden the interface behind some macros to > R> ensure that the driver continues to compile for FreeBSD 10 and > R> earlier. The result of the macros is that the ifcounter > R> implementation is somewhat clunkier than I would have liked, but I > R> preferred to try and share as much code between the legacy counter > R> implementation and the ifcounter implementation. > R> > R> I have tested the ixl driver with head. I have only compile-tested it > R> for stable/10. > R> > R> This patch also fixes some counter bugs: > R> > R> - Ensure that tx discards are reported > R> - There are actually two types of rx discard counters in the hardware. > R> Currently the driver is only reporting discards from one of the two > R> counters, so I fixed that > R> - The ipackets and opackets counters were being unnecessarily > R> incremented in the rx and tx paths. This was racy, unnecessary (the > R> counters also get explicitly set based on the values in HW counters) > R> and very bad for performance -- the cacheline contained the counters > R> was constantly bouncing between CPUs. I saw this even with only one > R> queue active, probably due to false sharing with some other field in > R> the ifnet struct. > R> > R> > https://people.freebsd.org/~rstone/patches/ixl/0005-Convert-ixl-and-ixlv-drivers-to-use-new-ifcounter-in.patch > > Thanks, Ryan! > > I'd suggest to use check against __FreeBSD_version >= 1100036. > > Can you please commit this? Navdeep promised to do cxgbe(4), Alexander > is working on ixgbe. After that we can go forward with making counters > in struct ifnet non-racy and cheap counter(9). > > -- > Totus tuus, Glebius. > _______________________________________________ > freebsd-net@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" >