From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jiri Pirko Subject: Re: [patch net-next v5 0/4] return offloaded stats as default and expose original sw stats Date: Thu, 23 Jun 2016 17:40:38 +0200 Message-ID: <20160623154038.GH2060@nanopsycho.orion> References: <1466522156-4795-1-git-send-email-jiri@resnulli.us> <20160623054050.GA2060@nanopsycho.orion> <576BC7A7.2000704@cumulusnetworks.com> <20160623113508.GE2060@nanopsycho.orion> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Roopa Prabhu , "netdev@vger.kernel.org" , "davem@davemloft.net" , Nogah Frankel , Ido Schimmel , Elad Raz , Yotam Gigi , Or Gerlitz , Nikolay Aleksandrov , John Linville , Thomas Graf , Andy Gospodarek , Scott Feldman , sd@queasysnail.net, eranbe@mellanox.com, Alexei Starovoitov , Eric Dumazet , "hannes@stressinduktion.org" , Florian Fainelli , David Ahern To: Anuradha Karuppiah Return-path: Received: from mail-wm0-f51.google.com ([74.125.82.51]:37592 "EHLO mail-wm0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750866AbcFWPkm (ORCPT ); Thu, 23 Jun 2016 11:40:42 -0400 Received: by mail-wm0-f51.google.com with SMTP id a66so55768404wme.0 for ; Thu, 23 Jun 2016 08:40:41 -0700 (PDT) Content-Disposition: inline In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: Thu, Jun 23, 2016 at 05:11:26PM CEST, anuradhak@cumulusnetworks.com wrote: >>>>> we can't separate CPU and HW stats there. In some cases (or ASICs) HW >>>>> counters do >>>>> not include CPU generated packets....you will have to add CPU >>>>> generated pkt counters to the >>>>> hw counters for such virtual device stats. >>>> Can you please provide and example how that could happen? >>> >>>example is the bridge vlan stats I mention below. These are usually counted >>>by attaching hw virtual counter resources. And CPU generated packets >>>in some cases maybe setup to bypass the ASIC pipeline because the CPU >>>has already made the required decisions. So, they may not be counted by >>>by such hw virtual counters. >> >> Bypass ASIC? How do the packets get on the wire? >> > >Bypass the "forwarding pipeline" in the ASIC that is. Obviously the >ASIC ships the CPU generated packet out of the switch/front-panel >port. Continuing Roopa's example of vlan netdev stats.... To get the >HW stats counters are typically tied to the ingress and egress vlan hw >entries. All the incoming packets are subject to the ingress vlan >lookup irrespective of whether they get punted to the CPU or whether >they are forwarded to another front panel port. In that case the >ingress HW stats does represent all packets. However for CPU >originated packets egress vlan lookups are bypassed in the ASIC (this >is common forwarding option in most ASICs) and the packet shipped as >is out of front-panel port specified by the CPU. Which means these >packets will NOT be counted against the egress VLAN HW counter; hence >the need for summation. Driver will know about this, and will provide the stats accordignly to the core. Who else than driver should resolve this.