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=-6.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED 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 20485C388F7 for ; Tue, 10 Nov 2020 07:13:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C1FE0206B6 for ; Tue, 10 Nov 2020 07:13:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="LW4ny0aD" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726467AbgKJHNI (ORCPT ); Tue, 10 Nov 2020 02:13:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727019AbgKJHNF (ORCPT ); Tue, 10 Nov 2020 02:13:05 -0500 Received: from mail-pg1-x542.google.com (mail-pg1-x542.google.com [IPv6:2607:f8b0:4864:20::542]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ABCF3C0613CF; Mon, 9 Nov 2020 23:13:05 -0800 (PST) Received: by mail-pg1-x542.google.com with SMTP id r10so9359239pgb.10; Mon, 09 Nov 2020 23:13:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ZPFe2WuiWwyNg1Eyj3XJGsLb5Wa+6AC1ZklocEhohjk=; b=LW4ny0aDBseDwZ76K9DKeQOHEHyHurl/nH8zVm9oq4gw3hcIQnEjTIVQzx01YG6MAq OQY/3QH+NaZAieNoZmYuUPUzzMz45JXLzqk16njQnUQdVMz8+Oohl8/vftFwrd5DogF1 RgD3k6j8EWApfYjwY6SQy0Ig2uJn4nq8n3a3pIuKVUjQYBnS5Tl0zSldv42Sc7vy3TdO 0FERJ5P7UBQakCZ6KBvmrbcSsLJ0AtuDYORTC7NgZIWvUMu0VnVBwj6fX296zTCOZPC+ 9ubJsOCWlqPCWt9jpz8TzyWq2qOHNGRujamCmMWKpRdbXqclCh4ODJ3/zuNTqeECEbiY OF2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ZPFe2WuiWwyNg1Eyj3XJGsLb5Wa+6AC1ZklocEhohjk=; b=uejDGxTIYSEmA+oBb/Kmiv1KiJhrhgO7Jnt2afMXC05wlWi/Qp/vxlCumaHwLagxyC ljp38JX3mluiPprikDnVIhfAp0GUrkjErSLMgaqhStt4YeD+RzQLBc8perNpPKn767Y8 TUGaL+Af0jcfSWoci2cYHOKEhNB3nQXU51iFT7v9221yUu39cmBQjpF8RS3w19wAjute 79ldx+YZIr72XGvMJzz0/0dBxNYJFTEaBcFrkVuCcfJZY4Mt4fbaDxLIIS00ALtsYebd B+jHE0nbDz1uAK6O951QTVxWQEfduVLXfzpAPtz+FnmX4nSfNFcDlEZj/bytSMSyUoz7 lTGA== X-Gm-Message-State: AOAM533oHHXzq1+hT4ARwuuCILytDN+FDTYPPiXWkoZqYLg3WWmjkgaw 0e9FXsBj5IAwiNtuvoNejAds7XQPjvMadM+THsY= X-Google-Smtp-Source: ABdhPJwdKvbB69qXEgdZwN3837DsoGBC4vJQh8ZB1EElebgRlZqRjGhXE6kbQreHcgynDvusc9yZdtBUmsuH6ozwGTw= X-Received: by 2002:a62:2bd0:0:b029:18a:df0f:dd61 with SMTP id r199-20020a622bd00000b029018adf0fdd61mr16448462pfr.19.1604992385197; Mon, 09 Nov 2020 23:13:05 -0800 (PST) MIME-Version: 1.0 References: <1604498942-24274-1-git-send-email-magnus.karlsson@gmail.com> <1604498942-24274-3-git-send-email-magnus.karlsson@gmail.com> <5fa9aae46c442_8c0e208b5@john-XPS-13-9370.notmuch> In-Reply-To: <5fa9aae46c442_8c0e208b5@john-XPS-13-9370.notmuch> From: Magnus Karlsson Date: Tue, 10 Nov 2020 08:12:54 +0100 Message-ID: Subject: Re: [Intel-wired-lan] [PATCH bpf-next 2/6] samples/bpf: increment Tx stats at sending To: John Fastabend Cc: "Karlsson, Magnus" , =?UTF-8?B?QmrDtnJuIFTDtnBlbA==?= , Alexei Starovoitov , Daniel Borkmann , Network Development , Jonathan Lemon , Maciej Fijalkowski , intel-wired-lan , bpf Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org On Mon, Nov 9, 2020 at 9:47 PM John Fastabend wrote: > > Magnus Karlsson wrote: > > From: Magnus Karlsson > > > > Increment the statistics over how many Tx packets have been sent at > > the time of sending instead of at the time of completion. This as a > > completion event means that the buffer has been sent AND returned to > > user space. The packet always gets sent shortly after sendto() is > > called. The kernel might, for performance reasons, decide to not > > return every single buffer to user space immediately after sending, > > for example, only after a batch of packets have been > > transmitted. Incrementing the number of packets sent at completion, > > will in that case be confusing as if you send a single packet, the > > counter might show zero for a while even though the packet has been > > transmitted. > > > > Signed-off-by: Magnus Karlsson > > --- > > LGTM. Just one question then if we wanted to know the old value, packet > completion counter it looks like (tx_npkts - outstanding_tx) would give > that value? That is correct. > Acked-by: John Fastabend