From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 19:18:27 2014 Return-Path: Delivered-To: svn-src-all@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 7624B45A; Thu, 18 Sep 2014 19:18:27 +0000 (UTC) Received: from mail-we0-x234.google.com (mail-we0-x234.google.com [IPv6:2a00:1450:400c:c03::234]) (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 98FEE7BD; Thu, 18 Sep 2014 19:18:26 +0000 (UTC) Received: by mail-we0-f180.google.com with SMTP id q59so1418922wes.11 for ; Thu, 18 Sep 2014 12:18:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=8rDfWTxltmAE0YUWXOpXOyF8EqMBuw+nvAYoGWCn1ME=; b=bwg/KsJ6M0xYfahBJ6yO/sq7QcfZxxXG608vTaXzzHo7Di835NjUw96wZD+Rb3u5rh b0xapTsBkxl5nLS9KnIBTuWIR52hubJ7jJpA4cQcxFkjb6YjD2mawgPE1KQQCJf3FZj1 K0fH187ZK8Ha5nDo+GS933i+xzIsRmW3QofhJ6k5sATUvKQsFc1ipz6O6AiP+BCB/1+C vy3NugFmlJtnUsqlBXzzDgmkBOBf8q3oXIeQDYuSPp0XI9EzllRFi0pz+r0mTQT0/bZK tWLv4kHZWGnRHij1mjiToQAeUIx6wtJ7/Nmhg7CPhSbUC3EA8z5sSqwUHym5/jv9gfcS squQ== MIME-Version: 1.0 X-Received: by 10.194.157.230 with SMTP id wp6mr7135353wjb.15.1411067904743; Thu, 18 Sep 2014 12:18:24 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.216.106.199 with HTTP; Thu, 18 Sep 2014 12:18:24 -0700 (PDT) In-Reply-To: <20140918191119.GA884@FreeBSD.org> References: <201409181556.s8IFuEK1013392@svn.freebsd.org> <20140918191119.GA884@FreeBSD.org> Date: Thu, 18 Sep 2014 12:18:24 -0700 X-Google-Sender-Auth: orWYMpERKqITDWfmw97WooxvtkU Message-ID: Subject: Re: svn commit: r271782 - in head/sys/dev: bge bxe e1000 fxp nfe From: Adrian Chadd To: Gleb Smirnoff Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 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, 18 Sep 2014 19:18:27 -0000 On 18 September 2014 12:11, Gleb Smirnoff wrote: > On Thu, Sep 18, 2014 at 03:56:14PM +0000, Gleb Smirnoff wrote: > T> Author: glebius > T> Date: Thu Sep 18 15:56:14 2014 > T> New Revision: 271782 > T> URL: http://svnweb.freebsd.org/changeset/base/271782 > T> > T> Log: > T> - Use if_inc_counter() to increment various counters. > T> - Do not ever set a counter to a value. For those counters > T> that we don't increment, but return directly from hardware > T> create cases in if_get_counter() method. > > Note that this patch was done mechanically. However, with new API > all statistics handling in all drivers can be improved. It is no > longer required to poll hardware counters and write down their > values into ifnet. Hardware counters now can (and should!) be read > on demand at the time when either sysctl(2) or network stack > asks for a counter. > > Of course such change to drivers can't be committed without > testing on hardware, that's why I decided to be conservative. > > I'll convert several drivers as an example soon. Something that recently popped up at home with my RSS testing is that the hardware counters may actually reflect the packets that the MAC has seen, rather than the packets the driver side has actually seen. It looks like with flow control disabled, the counters used for ixgbe(4) reflect the per-queue and global MAC RX counters, before a saturated receive thread drops some frames. Before, the interface counters reflected what the driver managed to see, not necessarily what was received by the NIC. What should we do about that? -a