Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp2099454pxb; Sat, 22 Jan 2022 16:14:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJyMWOHZxUO8EekJvaTk04olJuO2ndLaeqwPhrjhNjh7hQbIHkAc07BSh5KLNbhPsasPTTrG X-Received: by 2002:a05:6a00:181a:b0:4c1:3c75:9c54 with SMTP id y26-20020a056a00181a00b004c13c759c54mr9073298pfa.6.1642896880600; Sat, 22 Jan 2022 16:14:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642896880; cv=none; d=google.com; s=arc-20160816; b=h1rmRa0LW/oiJYxXxvZO0zSk3VzBqAJjgNm/1yLgQHMOcTXxPvhf8pFAklJxjd5e10 RH7mJXwM2h0o2nn4S7vGQirD7TeVPtY8+JMCzJQjCtoVVGz2UHXRjs6iIlyi84ff9OjU vOOTADmLTZKM8fQmGGAkbWbfU3OD/XpDxMBuUwd3Rz0+ouq4iAkXRVMfvkEYZCGNjKNU J1fdfHqYkXiDMttHTAkL0ahXgmgI1wtx7b9y8mEoghyoWhwOrPjbzpx3iBdS0qHTsE0d 48UMWGRY23lstw/DN2yeS20p5lGvHZCxxJZ/AseAdHEngbEhtxxbDYZnU0VVbYnkA4Qm koLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=uOatd2Ko9vNALFB2UoIJsLLgjXaMCRiA5U5yALhp1PE=; b=NFLjzsOtDGU56XglSU7j6yY0/ZYJYuaQKzP9WR/KaAMAwzlDjPkJkSXrCBwg7tH1ZM 8TCB1f07XzZy4h00k1tiOGBZaog0HtyL/OdE4+7PVmLlm+eVp3acSngH+Y9EOzSO3ydc /kL5PxdpIBU3/kEpee5vaitFx8FnAcK1t2vvnR/qm9j0upNNKO9ZmjoEz/gnBCdE2e6V ix7wWNZXWSCN+m42i9QebrpCcKzCw3KTFZ6jLY0bIoXj/OR5rzDFBLaRxovTi+vs1Sxo Stok2kkeWL2yEM8ZaNVEKBYax7mIEzlwScs0m+BNZwJh56CArKxL2D2lAVWf6orQmafh fHDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Lff2RYkw; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w12si14872538pjq.111.2022.01.22.16.14.28; Sat, 22 Jan 2022 16:14:40 -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=@kernel.org header.s=k20201202 header.b=Lff2RYkw; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231671AbiAVDlC (ORCPT + 99 others); Fri, 21 Jan 2022 22:41:02 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:43644 "EHLO ams.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229598AbiAVDlB (ORCPT ); Fri, 21 Jan 2022 22:41:01 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 25002B81E19; Sat, 22 Jan 2022 03:41:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8F242C340E1; Sat, 22 Jan 2022 03:40:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1642822858; bh=igEU1QuiHanlHIFCByVGoT1A/m68UIGIsY0mOD/CqdA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Lff2RYkwS/qEobQS3/JbW6I+jGSUHhKefhpZqvIgA6DA/PEO+RzzADhCif78S53ew sQtqIDERna42Ql0BpsqBhyroFNTjKa8med8QoXj55IZRz1lwpwVQB+wXmmzobcr3zA 9yzqrxXJ+vJ29E2hd8Csf/Hgzp5bPr+uZFg6MIqJz352EArJ4u/Po6/dbs3CepmCLP Oos9PV/f1QOaahscV/I6E1Cn48FGhjNyVl0W2nV3g8vLWO0/3ICtWfKwaWbjT0Axit t6PUbqheqY8I+cYhdphyh4ltAK+joFk5dVBncOpaAh14GqOWIrPkzorVpAGrLDsQYZ QYMB7P1P4U2xA== Date: Fri, 21 Jan 2022 19:40:57 -0800 From: Jakub Kicinski To: Jeffrey Ji Cc: Eric Dumazet , "David S . Miller" , Brian Vazquez , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, jeffreyji Subject: Re: [PATCH net-next] net-core: add InMacErrors counter Message-ID: <20220121194057.17079951@kicinski-fedora-PC1C0HJN.hsd1.ca.comcast.net> In-Reply-To: <20220122000301.1872828-1-jeffreyji@google.com> References: <20220122000301.1872828-1-jeffreyji@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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?