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=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no 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 BFC14C3A59E for ; Fri, 16 Aug 2019 18:13:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 99183206C1 for ; Fri, 16 Aug 2019 18:13:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727561AbfHPSNN (ORCPT ); Fri, 16 Aug 2019 14:13:13 -0400 Received: from dispatch1-us1.ppe-hosted.com ([67.231.154.164]:56664 "EHLO dispatch1-us1.ppe-hosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727490AbfHPSNM (ORCPT ); Fri, 16 Aug 2019 14:13:12 -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-us5.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTPS id 8C6E04C0062; Fri, 16 Aug 2019 18:13: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; Fri, 16 Aug 2019 11:13:07 -0700 Subject: Re: [RFC bpf-next 0/3] tools: bpftool: add subcommand to count map entries To: Quentin Monnet , Alexei Starovoitov CC: Alexei Starovoitov , Daniel Borkmann , , , References: <20190813130921.10704-1-quentin.monnet@netronome.com> <20190814015149.b4pmubo3s4ou5yek@ast-mbp> <18f887ec-99fd-20ae-f5d6-a1f4117b2d77@netronome.com> <84aa97e3-5fde-e041-12c6-85863e27d2d9@solarflare.com> <031de7fd-caa7-9e66-861f-8e46e5bb8851@netronome.com> From: Edward Cree Message-ID: Date: Fri, 16 Aug 2019 19:13:06 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <031de7fd-caa7-9e66-861f-8e46e5bb8851@netronome.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Language: en-GB X-Originating-IP: [10.17.20.203] X-TM-AS-Product-Ver: SMEX-12.5.0.1300-8.5.1010-24850.005 X-TM-AS-Result: No-1.736300-4.000000-10 X-TMASE-MatchedRID: 7ySqCuYCpfjmLzc6AOD8DfHkpkyUphL99+PHtghP8GLo5ylrWfS0yzKy dfFQiPH7pVO+oN4Yy+nwJd0y95699XufZC0Pz+WkBcaL/tyWL2PDu9Ig2VAzuXRBPvVzfVU/m+q 3qIvun/12d8d8QAF3I+P3YB3VAfGPlwV2iaAfSWc5f9Xw/xqKXXJnzNw42kCx2bNx1HEv7HAqtq 5d3cxkNcDmktstdnbHsCD6Gug0nSw6dFPM3ONtRe0449QWDDb4Oidh6Pj4BzCFcgJc+QNMwu8bJ ovJYm8FYupx0XjSQPLDOFVmKqGJ4bPn3tFon6UK X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--1.736300-4.000000 X-TMASE-Version: SMEX-12.5.0.1300-8.5.1010-24850.005 X-MDID: 1565979192-y5jBoVQEMl90 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On 15/08/2019 15:15, Quentin Monnet wrote: > So if I understand correctly, we would use the bpf() syscall to trigger > a run of such program on all map entries (for map implementing the new > operation), and the context would include pointers to the key and the > value for the entry being processed so we can count/sum/compute an > average of the values or any other kind of processing? Yep, that's pretty much exactly what I had in mind. -Ed