Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3730411pxb; Mon, 24 Jan 2022 16:33:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJww+BaU0UsK+rHGsVUWu3P1bKMBtpGpW952bYbKhjVd5J+6H2EfjwU+p1gdt4bt9SpHPotA X-Received: by 2002:a17:902:8494:b0:149:8a72:98bb with SMTP id c20-20020a170902849400b001498a7298bbmr15894704plo.0.1643070716386; Mon, 24 Jan 2022 16:31:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643070716; cv=none; d=google.com; s=arc-20160816; b=l+FWqwZA51NwUjN+CiyzMRPZOowAVigZFcrdufVqhPN9xY4F2NoG0/fppsDEPFvZ8Z 5JFc/K4EjlSOLh7rjxGy6/k+sJUlxwKINAPDQoeWfi/7GzX2n+bkCJUayFVhPKsjzNnk j6yWpML4czQd7X+URDNEm3ZSwTVrK9mEef5D98WXYHmZRCFW6LtQCH+ZFV9tnYNnD/Ao jXAAX5ldugVjN6KJtoPm6Cj6b5O45lln8lnv0UYpMWttrg9nOXtGjrGVaSlCjJneJ2nt XBvPmGjy4ZqSTkIYmcM7SwLP8df0Sn8ttKeN0Etp47UoD4pUNeaaNlB4bjweNQMZ3os7 8esg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=xwfv9DWhnbqAeBe0vZuMaEEqHhzX/GAvJYcdU/hIEU0=; b=gBrYOnBed0xt3AxYDZ7prH5Tu0tzilTcZxr0IRE4E+hq8sdax6/pTYZwBCVAJNUol7 OK6wnI1siZ3it+i0FAFZLa7QYPG2H8CrX4soT0mG9ajefLjUIPRps1qtzdgzy6r3WRLQ qyD/MuZYub2uLtLbnCteLXHwPKsUiFkvOr6GnSCUeS2f7ioR+KuK+8jQXdAR9WEFmiIc +LO19zUVDNT4qK0sxSkDRlb9d/nmKCGV3L8s7fUquANdH6oLVkxZG4nNMSL+hnn1jVzl UjCHOFbq6pV1Hdznl8iVMz6oFV5sXXEddMq7IKkxqjwYGp92eJB1SMfhJ4UfL4+XJdty Sgag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=YZEjc5Xg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d9si15191774pgb.583.2022.01.24.16.31.44; Mon, 24 Jan 2022 16:31:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=YZEjc5Xg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S3409995AbiAYA2M (ORCPT + 99 others); Mon, 24 Jan 2022 19:28:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53820 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1455379AbiAXVfT (ORCPT ); Mon, 24 Jan 2022 16:35:19 -0500 Received: from mail-yb1-xb31.google.com (mail-yb1-xb31.google.com [IPv6:2607:f8b0:4864:20::b31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F1D6EC0612A6 for ; Mon, 24 Jan 2022 12:22:10 -0800 (PST) Received: by mail-yb1-xb31.google.com with SMTP id r65so51437224ybc.11 for ; Mon, 24 Jan 2022 12:22:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=xwfv9DWhnbqAeBe0vZuMaEEqHhzX/GAvJYcdU/hIEU0=; b=YZEjc5XgddEOMDEFMbA/nfERNSKDAvksKW3MccXgk/muQB+YDP3EGqR5R99SaGgsy+ tYmN3BspZJWCVNOVtpRcR2yhuqOUS/dTMJ8qhEWo4Q3s+mOiZv/gDoglKXWncm11J4iV Hk9DtYMbaYEE1kWvPRVZHw8IKZ8efE2Wiw37iUO0+X/Anbte97vcnN3h8JgZxjeN0ZX2 rTQ9Uk6paf1BFgq62wq4y5JIew3/PMaHiXBpAWT70gQrG6ZPwfcnCx8lh84GqjA/fFBe +SNnIEPlX9wqhIFaYCEziDHQ31p7qhGLgsZidM8UR5q9UUe9PoOilL7zPvj8xz1H6m4E k4TQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=xwfv9DWhnbqAeBe0vZuMaEEqHhzX/GAvJYcdU/hIEU0=; b=ZvzJi005dz+ExhOy4wZxWiyDe/87qBwNmT2sskpDtawrrdyfB65L0ZoEsgCLNwMg0j FvVJKt5+sf6s4TX9rC4ccX0rDTcfH9PsH8b3s3+a7b8sjL9IgsMdHLodXZ7rr9o55ywp 7FXeTY8PonEA5c6soADdhfy5kSd/OAQIgPx4W/c6lezrrbd4S1PVDokIDY4VNH3Vrp/+ xHOlIxPqeJO4Pqz2Jai/DpAXLDvGO4YvdFgaZUPfcIQozvlh2Pr1ktWWp3MwxcrZ/Dbq XbBzGq4QakdkPIBAARtDrwV5AqST8GXnen4Hps3MlUlHaFuK5re1v0uicy9zlhkXoh7/ DNHA== X-Gm-Message-State: AOAM530l0XRsNXgufsglZWGiGh7wxC3XKRbmURXdMEYkub0vpLWn8KSU HNQnZBoUmgBe6msRoYwj1Wg/2+RC/72t4ugAMfgAsg== X-Received: by 2002:a25:9d82:: with SMTP id v2mr24635936ybp.383.1643055729748; Mon, 24 Jan 2022 12:22:09 -0800 (PST) MIME-Version: 1.0 References: <20220122000301.1872828-1-jeffreyji@google.com> <20220121194057.17079951@kicinski-fedora-PC1C0HJN.hsd1.ca.comcast.net> <20220124092924.0eb17027@kicinski-fedora-PC1C0HJN.hsd1.ca.comcast.net> In-Reply-To: From: Eric Dumazet Date: Mon, 24 Jan 2022 12:21:58 -0800 Message-ID: Subject: Re: [PATCH net-next] net-core: add InMacErrors counter To: Cong Wang Cc: Jakub Kicinski , Brian Vazquez , Jeffrey Ji , "David S . Miller" , LKML , netdev , jeffreyji Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 24, 2022 at 12:20 PM Cong Wang wrote: > > On Mon, Jan 24, 2022 at 09:29:24AM -0800, Jakub Kicinski wrote: > > On Mon, 24 Jan 2022 09:13:12 -0800 Brian Vazquez wrote: > > > On Fri, Jan 21, 2022 at 7:41 PM Jakub Kicinski wrote: > > > > On Sat, 22 Jan 2022 00:03:01 +0000 Jeffrey Ji wrote: > > > > > From: jeffreyji > > > > > > > > > > Increment InMacErrors counter when packet dropped due to incorrect dest > > > > > MAC addr. > > > > > > > > > > example output from nstat: > > > > > \~# nstat -z "*InMac*" > > > > > \#kernel > > > > > Ip6InMacErrors 0 0.0 > > > > > IpExtInMacErrors 1 0.0 > > > > > > > > > > Tested: Created 2 netns, sent 1 packet using trafgen from 1 to the other > > > > > with "{eth(daddr=$INCORRECT_MAC...}", verified that nstat showed the > > > > > counter was incremented. > > > > > > > > > > Signed-off-by: jeffreyji > > > > > > > > How about we use the new kfree_skb_reason() instead to avoid allocating > > > > per-netns memory the stats? > > > > > > I'm not too familiar with the new kfree_skb_reason , but my > > > understanding is that it needs either the drop_monitor or ebpf to get > > > the reason from the tracepoint, right? This is not too different from > > > using perf tool to find where the pkt is being dropped. > > > > > > The idea here was to have a high level metric that is easier to find > > > for users that have less expertise on using more advance tools. > > > > That much it's understood, but it's a trade off. This drop point > > existed for 20 years, why do we need to consume extra memory now? > > kfree_skb_reason() is for tracing and tracing has overhead in > production, which is higher than just a percpu counter. > > What memory overhead are you talking about? We have ~37 IP related > SNMP counters, this patch merely adds 1/37 memory overhead. So, what's the > point? :-/ > BTW I just saw that kfree_skb_reason() changes have been proposed already by Menglong Dong this morning.