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=-3.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,USER_AGENT_NEOMUTT 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 307DFC282E1 for ; Wed, 24 Apr 2019 14:11:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0C6B121900 for ; Wed, 24 Apr 2019 14:11:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727512AbfDXOLo (ORCPT ); Wed, 24 Apr 2019 10:11:44 -0400 Received: from mail.us.es ([193.147.175.20]:44946 "EHLO mail.us.es" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725954AbfDXOLo (ORCPT ); Wed, 24 Apr 2019 10:11:44 -0400 Received: from antivirus1-rhel7.int (unknown [192.168.2.11]) by mail.us.es (Postfix) with ESMTP id 67558190F6D for ; Wed, 24 Apr 2019 16:11:42 +0200 (CEST) Received: from antivirus1-rhel7.int (localhost [127.0.0.1]) by antivirus1-rhel7.int (Postfix) with ESMTP id 55FA5DA70D for ; Wed, 24 Apr 2019 16:11:42 +0200 (CEST) Received: by antivirus1-rhel7.int (Postfix, from userid 99) id 4B27FDA709; Wed, 24 Apr 2019 16:11:42 +0200 (CEST) Received: from antivirus1-rhel7.int (localhost [127.0.0.1]) by antivirus1-rhel7.int (Postfix) with ESMTP id 4CC81DA704; Wed, 24 Apr 2019 16:11:40 +0200 (CEST) Received: from 192.168.1.97 (192.168.1.97) by antivirus1-rhel7.int (F-Secure/fsigk_smtp/550/antivirus1-rhel7.int); Wed, 24 Apr 2019 16:11:40 +0200 (CEST) X-Virus-Status: clean(F-Secure/fsigk_smtp/550/antivirus1-rhel7.int) Received: from us.es (sys.soleta.eu [212.170.55.40]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: 1984lsi) by entrada.int (Postfix) with ESMTPSA id 2B0074265A32; Wed, 24 Apr 2019 16:11:40 +0200 (CEST) Date: Wed, 24 Apr 2019 16:11:39 +0200 X-SMTPAUTHUS: auth mail.us.es From: Pablo Neira Ayuso To: Edward Cree Cc: Jamal Hadi Salim , netdev , Jiri Pirko , Cong Wang Subject: Re: TC stats / hw offload question Message-ID: <20190424141139.5c5vhihie5mryxlt@salvia> References: <26f0cfc9-3bef-8579-72cc-aa6c5ccecd43@solarflare.com> <4cb765dd-453f-3139-bce6-6e0b31167aec@mojatatu.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) X-Virus-Scanned: ClamAV using ClamSMTP Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Wed, Apr 24, 2019 at 03:05:05PM +0100, Edward Cree wrote: > 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. Then, we need to extend the API to allow to update counters per action, no driver in the tree has been supporting this so far. May I have a look at your driver code to infer what we might need? Thanks.