From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 20:59:59 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 CCB7464A; Thu, 18 Sep 2014 20:59:59 +0000 (UTC) Received: from mail-pa0-x231.google.com (mail-pa0-x231.google.com [IPv6:2607:f8b0:400e:c03::231]) (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 8FB1C325; Thu, 18 Sep 2014 20:59:59 +0000 (UTC) Received: by mail-pa0-f49.google.com with SMTP id lf10so2328067pab.36 for ; Thu, 18 Sep 2014 13:59:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=G4XuvTypuH9A8aEthyMHqo6BNNoJi/aYt6iYPbN5RIU=; b=rcktzDPRJ9uMPhTc0aF6Pok5cMt8rBoLjMN8ZmQcspYontgVeKD8lfjwvJFOZKlbHl U7PzU+2mOaXRPNqcfq3pGqP+LAhhHGWfY27pc2mt3MSuERCqWjuOfiwbhJr8S1tbCI2M MKbu2IiWuTlPB4R33envXMwdvcc4JSVXgfL6k0qGm3UVW9+G6lk9rJOqu7eQ1Dq0fNz1 HnGUFxe3UCNRDNvDHCLvWhZvrzyP3P9SgKWlgp38vGQeB04B9LSFQ/DZXbEEqWV84dJi b8c6qp8MFUWFAsMXMXHlKywO4QeRpI7UNx951oaTtCHXsYudAj/aaHcpWYcGu4ew7012 3uUQ== X-Received: by 10.68.125.227 with SMTP id mt3mr9722234pbb.97.1411073999163; Thu, 18 Sep 2014 13:59:59 -0700 (PDT) Received: from [10.192.166.0] (stargate.chelsio.com. [67.207.112.58]) by mx.google.com with ESMTPSA id v1sm20600016pdg.28.2014.09.18.13.59.57 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Sep 2014 13:59:57 -0700 (PDT) Sender: Navdeep Parhar Message-ID: <541B47CB.3000100@FreeBSD.org> Date: Thu, 18 Sep 2014 13:59:55 -0700 From: Navdeep Parhar User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.1.0 MIME-Version: 1.0 To: Gleb Smirnoff Subject: Re: svn commit: r271803 - head/sys/dev/tl References: <201409182003.s8IK3kr8033068@svn.freebsd.org> <541B3BE1.7080005@FreeBSD.org> <20140918205055.GE884@FreeBSD.org> In-Reply-To: <20140918205055.GE884@FreeBSD.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit 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:59:59 -0000 On 09/18/14 13:50, Gleb Smirnoff wrote: > 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. You can hide ifnet behind a stable KPI or KBI. Looks like your goal is the latter. Regards, Navdeep