Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3536836pxb; Mon, 24 Jan 2022 11:40:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJykNVDThMGn8ChacmoGc59gyoFsMpzh5bHyAUVdRY99QIiCQ7NPPs2uUXzwV53SGfMikyrP X-Received: by 2002:a05:6a00:be5:b0:4c7:f615:41de with SMTP id x37-20020a056a000be500b004c7f61541demr9821194pfu.34.1643053245216; Mon, 24 Jan 2022 11:40:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643053245; cv=none; d=google.com; s=arc-20160816; b=PoX9AdbQwf3nPDnMuvjeciHODIE1hsZZwD0MY2pko6YGt/tf3eYUYFwRqgkbyrtkwp WXs/bnhH9ce5Xl5cA5sIFS7xJLjkcEJLyKvLyBLL7yLVEyi9KEo8QfX1iMPfoqyZxuPn RXJBAECv13htxasfqD9OtGYXEMP0rJ+GM56FyqDYhbTBcnxf51R6IIK8j5rU7Mo+GoBu Yyw1jTc8KNg6h3VOO/frZ/2T5NHAwOzhfgHJppGU0HICgc/b27DF50m2AE1Un/bY3SZg q1hF6HXon6q9TtiBkFJBQ8cA1NNlTX51H38Dsn2q44/p2eLc8bB5WGNv0q+Md66J60oO oPLg== 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=zYBnJwYU6kdgRrUuU4GKLshNyRjBtazPAW6pSfcKBSo=; b=uDyg/wJ/7mI5lJUuDs7fA9ckUGYKfcOxfLX1h9bLThzMpIoQ2ZpbV122sPxvDD4xC9 3ej4CP3siyuIM8RWsjzhdtyvoxISTx4HBQXPYnk+o98ybI33g7t/oNFco/fGy1r/T/wr gcx/1ZFO7PXO4hBEEBEzTVmWSaYnBRnBmbrdlaQDefyuGT+iVYh+jxDsx45uOGAj4u5t aThsOhNiV9CEjGHZ+L8yHPsvla88JZuYoS3Qb0rVRCMsov08OfQCVvsZ/jt1lGrza+0c 0QnT00ipBWJJfmC7X/6Xf54izgbh8dxCCK7WopI9rORR1F2Xyqy8R7GygBNo6IUBSz2P TBYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=NcjYumzr; 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 r21si12429307pla.499.2022.01.24.11.40.33; Mon, 24 Jan 2022 11:40:45 -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=NcjYumzr; 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 S241506AbiAXROV (ORCPT + 99 others); Mon, 24 Jan 2022 12:14:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47846 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244254AbiAXRNl (ORCPT ); Mon, 24 Jan 2022 12:13:41 -0500 Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D1A85C06175D for ; Mon, 24 Jan 2022 09:13:25 -0800 (PST) Received: by mail-lf1-x136.google.com with SMTP id y15so43073103lfa.9 for ; Mon, 24 Jan 2022 09:13:25 -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=zYBnJwYU6kdgRrUuU4GKLshNyRjBtazPAW6pSfcKBSo=; b=NcjYumzr7dyaLLba4i3YqmYaQwCFsch778PYRKN+5YsJOLcUESv+T3GtfcswO8H0jj Dp85CIXgcjciAnpA/s893+nzu2TEnjiuoypcdIAFWfjTRgv5FUyu88T1peEZAFCeEp3t 3IsDPOfRnahTAy18/h87YprIIENFCSR8fjfAd7GjEUDIyXkzvhnuArmgjJGNMbChmw0P qgjrs2Avg59Hbs+QLF7i8yRBzHzqTVf6Y+aZAndEhHNJ4pyo5OFqZyL+c8SXCr3Io7RW Cgz6XcCwhimT1NUEz2/xVlMqDl5LrXsQOEejcshXH95pOidgw0n8hUWetgiLWIocW1g0 LxZg== 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=zYBnJwYU6kdgRrUuU4GKLshNyRjBtazPAW6pSfcKBSo=; b=HHKFl36/+Juo95bJWL1ztnIakGhLpTm6oX2262L7VRwzozHJwo5G4pVGWBu4nzPliQ Y87ivhpq7YkWXJwW3hYm4+TGfo7l0EGmy6a0BUxdKAdAfHXPfGDzYhpTzjNo0Ob6Mapp PTVYivf+DiSLAeahXkDcYRbMkiEW4fVj8IsEKQPNpHq/qSjrFjKFY9+ZmH3nNYdVIPua fLjZY5uYouEBSZt47XvVoMjqE2OiYrUQrTiohFaTEPpL+4zmQnD7zMj8k7njUc4XvnxC sExMrkPvuGl6CXdoaUQC0AEYmqPJ2hOc0iSvG3wRj811hVnmf7eOSy2m3fnRIWcbH3Z+ kYEA== X-Gm-Message-State: AOAM530gOqIRHX0XB++oo5g1np4TiwxkK1DF3tOkv8lZNqKbDnyrWfyb jdGGEVtl9oR+l4zFc/E9veupLvCoarShCAvsYncYiQ== X-Received: by 2002:a05:6512:b04:: with SMTP id w4mr1061895lfu.545.1643044403748; Mon, 24 Jan 2022 09:13:23 -0800 (PST) MIME-Version: 1.0 References: <20220122000301.1872828-1-jeffreyji@google.com> <20220121194057.17079951@kicinski-fedora-PC1C0HJN.hsd1.ca.comcast.net> In-Reply-To: <20220121194057.17079951@kicinski-fedora-PC1C0HJN.hsd1.ca.comcast.net> From: Brian Vazquez Date: Mon, 24 Jan 2022 09:13:12 -0800 Message-ID: Subject: Re: [PATCH net-next] net-core: add InMacErrors counter To: Jakub Kicinski Cc: Jeffrey Ji , Eric Dumazet , "David S . Miller" , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, jeffreyji Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.