From owner-svn-src-all@FreeBSD.ORG Fri Oct 10 20:40:08 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 788FFA0E; Fri, 10 Oct 2014 20:40:08 +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 E8036F18; Fri, 10 Oct 2014 20:40:07 +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 s9AKdwvE047591 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 11 Oct 2014 00:39:58 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id s9AKdwdU047590; Sat, 11 Oct 2014 00:39:58 +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, 11 Oct 2014 00:39:58 +0400 From: Gleb Smirnoff To: John Baldwin , Eric Joyner Subject: Re: svn commit: r272897 - head/sys/dev/e1000 Message-ID: <20141010203957.GD73266@glebius.int.ru> References: <201410101636.s9AGaQ43066897@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201410101636.s9AGaQ43066897@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) 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: Fri, 10 Oct 2014 20:40:08 -0000 On Fri, Oct 10, 2014 at 04:36:26PM +0000, John Baldwin wrote: J> Author: jhb J> Date: Fri Oct 10 16:36:25 2014 J> New Revision: 272897 J> URL: https://svnweb.freebsd.org/changeset/base/272897 J> J> Log: J> Various fixes to stats: J> - Read the counts of received, dropped, and transmitted management J> packets and add sysctl nodes for them. J> - Fix the total octets received/transmitted to read all 64 bits of J> the counters. J> - Add missing sysctl nodes for rlec, tncrs, fcruc, tor, and tot. J> - Remove spurious spaces. J> J> Reviewed by: Eric Joyner @ Intel J> MFC after: 1 week JFYI With the new API (userland part to be done) one wouldn't need a bunch of sysctls hanging off every NIC. Look at ift_counter enum in if_var.h. It is int type, so we can cut it into large blocks for vendor specific counters. The top part, up to the IFCOUNTERS member would remain standard and copied to if_data when imported to userland. Above IFCOUNTERS we can give us much number space to vendors as needed. Like this: + IFCOUNTER_INTEL_RLEC = 1000, + IFCOUNTER_INTEL_TNCRS, + IFCOUNTER_INTEL_FCRUC, ... etc After that the driver can return them via igb_get_counter(). As said, the userland API not written yet. The plan is that it will be not as bulky as NET_RT_IFLIST sysctl, that returns all counters for all NICs. It will allow to request certain counters for certain NICs. -- Totus tuus, Glebius.