From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AE7E7C282CE for ; Wed, 24 Apr 2019 14:05:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 82466218FE for ; Wed, 24 Apr 2019 14:05:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726514AbfDXOFP (ORCPT ); Wed, 24 Apr 2019 10:05:15 -0400 Received: from dispatch1-us1.ppe-hosted.com ([148.163.129.52]:42594 "EHLO dispatch1-us1.ppe-hosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725893AbfDXOFO (ORCPT ); Wed, 24 Apr 2019 10:05:14 -0400 X-Virus-Scanned: Proofpoint Essentials engine Received: from webmail.solarflare.com (webmail.solarflare.com [12.187.104.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mx1-us3.ppe-hosted.com (Proofpoint Essentials ESMTP Server) with ESMTPS id 282A7B400B2; Wed, 24 Apr 2019 14:05:11 +0000 (UTC) Received: from [10.17.20.203] (10.17.20.203) by ocex03.SolarFlarecom.com (10.20.40.36) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Wed, 24 Apr 2019 07:05:07 -0700 Subject: Re: TC stats / hw offload question To: Jamal Hadi Salim , netdev , Pablo Neira Ayuso CC: Jiri Pirko , Cong Wang References: <26f0cfc9-3bef-8579-72cc-aa6c5ccecd43@solarflare.com> <4cb765dd-453f-3139-bce6-6e0b31167aec@mojatatu.com> From: Edward Cree Message-ID: Date: Wed, 24 Apr 2019 15:05:05 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.0 MIME-Version: 1.0 In-Reply-To: <4cb765dd-453f-3139-bce6-6e0b31167aec@mojatatu.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Content-Language: en-GB X-Originating-IP: [10.17.20.203] X-TM-AS-Product-Ver: SMEX-12.5.0.1300-8.5.1010-24570.005 X-TM-AS-Result: No-5.677800-4.000000-10 X-TMASE-MatchedRID: nVQUmLJJeyYOwH4pD14DsPHkpkyUphL9h+w9Wz/xXDowyfWtyopBqFiI mbtNzUcVhZ0VJOn9+etdllc1XXqB26DUMTFlJZ9NgOqr/r0d+Cxzd7C7BtJobjmgfzmZWflKbzV u2GfgbkLVLrCkiu+2ZkyHx3dbBRoC4fEVvamOvhvvVbHa5Rs8t30tCKdnhB581B0Hk1Q1KyL3PD iXO/tFSfcUt5lc1lLgoGRyAacnhaaU8QS59ZF8KLIVaw1AAgT/3EHyuhuosj0euDTEENWTf37cG d19dSFd X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--5.677800-4.000000 X-TMASE-Version: SMEX-12.5.0.1300-8.5.1010-24570.005 X-MDID: 1556114713-EkXcl1ZiS1Ii Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On 06/02/2019 02:20, Jamal Hadi Salim wrote: > The classifiers dont mod the packets. The actions do. And they > maintain stats on the size on "entry" i.e pre-edit. > Each action keeps its own counters. If you did something like: > > tc match using flower blah \ > action vlan push tag ... \ > action redirect to egress of eth0 > > And you submited a packet of size x bytes, > then the "match" would record x bytes. > the "vlan action" would record x bytes. > the "redirect" would record size x+vlaninfo bytes > the egress of eth0 would  recorr x+vlaninfo bytes So, I had this working for a while, by calling tcf_action_stats_update()  directly on the correct element of tc->exts->actions[], instead of using  tcf_exts_stats_update().  And this was fine, until I tried to port my  code to the 5.1 kernel, with Pablo's flow action infrastructure.  On that  it's not possible, because there is only flow_stats_update(), which takes  a single bytes value for _all_ the actions in the rule. Pablo, was your patch series[1] intended to change the semantics of TC  action bytes-counters?  What are the proper semantics now? -Ed [1] http://patchwork.ozlabs.org/cover/1035414/