From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 20:51:00 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 157B1DB8; Thu, 18 Sep 2014 20:51:00 +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 8CC2C283; Thu, 18 Sep 2014 20:50:58 +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 s8IKotQ0003297 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 19 Sep 2014 00:50: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 s8IKotSP003296; Fri, 19 Sep 2014 00:50:55 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Fri, 19 Sep 2014 00:50:55 +0400 From: Gleb Smirnoff To: Navdeep Parhar Subject: Re: svn commit: r271803 - head/sys/dev/tl Message-ID: <20140918205055.GE884@FreeBSD.org> References: <201409182003.s8IK3kr8033068@svn.freebsd.org> <541B3BE1.7080005@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <541B3BE1.7080005@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: Thu, 18 Sep 2014 20:51:00 -0000 Navdeep, On Thu, Sep 18, 2014 at 01:09:05PM -0700, Navdeep Parhar wrote: N> Consider changing if_inc_counter to be inline and have it take const N> ints for the counter and increment. The compiler will optimize away all N> the unneeded code in if_inc_counter. Yep, constifying is a good idea. Regarding the contents of if_inc_counter(). The plan is to remove racy counters, make array of counter(9), then if_inc_counter() will get rid of switch(), instead it will do: counter_u64_add(ifp->counters[cnt]); We can't make it inline, since we want drivers to be not aware of struct ifnet entirely. Anyway, high performance drivers do accounting in hardware, and will not execute if_inc_counter() on fast path. -- Totus tuus, Glebius.