Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp88055pxp; Fri, 4 Mar 2022 22:22:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJx45YFSWJZoaJbrMmP/PPQGGbwrYrceKhblwjx099fnGFlSJkbWiI6pOENUR3YSQzO3i+3t X-Received: by 2002:a05:6402:370b:b0:413:3bcd:3d0e with SMTP id ek11-20020a056402370b00b004133bcd3d0emr1836369edb.178.1646461374058; Fri, 04 Mar 2022 22:22:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646461374; cv=none; d=google.com; s=arc-20160816; b=PL+a9gyhB8RYC80kJYUA3KxdOGSSRs2SF8FB0rSQoKF212aW5bCPCPC2InUhvL8ekO mjGlzmR3jgACz9MAvqf+fkf77Kf6M5jb2rvncmUMy1d8yU5fq4+870oyPWRl1vMw/kBg 8Pp/UFlLyGDCc9WSv62FX8l/897OL12QGACgS9IoTWOUloiyVzcPpOukH9n0Xt5Xi3KK 5BJ2jZiwOwnJaRQO+G3ep08bHF736YbHzvq5/DfCWBri3pQ49NE9eDSMpuqH6mkYvsEu 0Wq2qYZmUPVsw5P+k+iR1zohVpijIfwl8UA9dx875R3CI/DLTX9RnZzcZizwpxGToPji /Vdw== 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=Flo+vKA/gvob5nsT8IXdBPE3jKqoS96xqe/bm66X+G0=; b=PUHp7B2nbzKMZdlph8L7v1fwE3pe9v6kg2QuxOLzTK8NwK0m/s//2G8WEcSAp/cB/q 5VI5nkCrSBdy4Kr3cvNizRDVgVANXHcPjt8cHp3fRvM212eIzYT3cw4LJpByg8gv8xEC M4DpqphLMiJtrcuERINhzldetRrifNFPF1eeTLI3GAxcuN0boicVbGCHKnYlSCkzenuS yF42XxB7//tr0tBXwb793lG0aJCmKmfADZQ19sCVeNxcPbO55yJ5/bii7vgLk4tFgndg v7eDWGK6fWSuGlb6J/3yaL8fAlWThSZaqhBE7NG+3BRvTM+Ry33M/EdBS/e5pMk+lE2o rcAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=aw1iEaPa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l17-20020a056402255100b0041092ab8cb9si6839993edb.70.2022.03.04.22.21.47; Fri, 04 Mar 2022 22:22:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=aw1iEaPa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S231282AbiCEFkx (ORCPT + 99 others); Sat, 5 Mar 2022 00:40:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53216 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229516AbiCEFkv (ORCPT ); Sat, 5 Mar 2022 00:40:51 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3508CADD67; Fri, 4 Mar 2022 21:40:03 -0800 (PST) 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 dfw.source.kernel.org (Postfix) with ESMTPS id C70A060A6F; Sat, 5 Mar 2022 05:40:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 83642C340EE; Sat, 5 Mar 2022 05:40:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1646458802; bh=6DhOwJx5m+Etdnfg4q7LUPFaVS97iP6TaGZP2zeFvZw=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=aw1iEaPaNE6rO2cxFNyohcnCrsOnTFPxHyrovQO/up2h1VckyiNPIhtzkQSuXbgxk 2B+4vy1Oc7193yf4ndm9og/pk4V3BBSl0uHxkkRwYy08lzt51BwJehizRaJTiDWAS7 ix7x09/mDUC1iQGUClusydJLAsVF85hL8u+fvZvNp3xNsUxG4OuzGgHquLClRNVx0O e2tFkn5OFl6ATWD3xGrF7z4h+X+P/bbgeBczdfZpmJB8plKtUrchaktkusTx6LXAFz df+obcRewhOeroq+6OwUJSApYj3HyT7PHr6sLtMhPHSyHmxov3DbEaxdBrPUH7h3Df lNB1dhWSMBv2Q== Date: Fri, 4 Mar 2022 21:40:00 -0800 From: Jakub Kicinski To: Jeffrey Ji Cc: Brian Vazquez , "David S . Miller" , Hideaki YOSHIFUJI , David Ahern , Eric Dumazet , Antoine Tenart , Sebastian Andrzej Siewior , Alexander Lobakin , Kumar Kartikeya Dwivedi , Arnd Bergmann , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, jeffreyji Subject: Re: [PATCH v2 net-next] net-core: add rx_otherhost_dropped counter Message-ID: <20220304214000.597c7165@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> In-Reply-To: References: <20220303003034.1906898-1-jeffreyjilinux@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 3 Mar 2022 13:59:58 -0800 Brian Vazquez wrote: > LGTM, thanks Jeffrey! > > Reviewed-by: Brian Vazquez Please keep Brian's review tag.. > On Wed, Mar 2, 2022 at 4:30 PM Jeffrey Ji wrote: > > > > From: jeffreyji > > > > Increment rx_otherhost_dropped counter when packet dropped due to > > mismatched dest MAC addr. > > > > An example when this drop can occur is when manually crafting raw > > packets that will be consumed by a user space application via a tap > > device. For testing purposes local traffic was generated using trafgen > > for the client and netcat to start a server > > > > Tested: Created 2 netns, sent 1 packet using trafgen from 1 to the other > > with "{eth(daddr=$INCORRECT_MAC...}", verified that iproute2 showed the > > counter was incremented. (Also had to modify iproute2 to show the stat, > > additional patch for that coming next.) > > > > changelog: > > > > v2: add kdoc comment move the changelog under the '---' separator > > Signed-off-by: jeffreyji > > --- > > include/linux/netdevice.h | 3 +++ > > include/uapi/linux/if_link.h | 5 +++++ > > net/core/dev.c | 2 ++ > > net/ipv4/ip_input.c | 1 + > > net/ipv6/ip6_input.c | 1 + > > 5 files changed, 12 insertions(+) > > diff --git a/include/uapi/linux/if_link.h b/include/uapi/linux/if_link.h > > index e315e53125f4..17e74385fca8 100644 > > --- a/include/uapi/linux/if_link.h > > +++ b/include/uapi/linux/if_link.h > > @@ -211,6 +211,9 @@ struct rtnl_link_stats { > > * @rx_nohandler: Number of packets received on the interface > > * but dropped by the networking stack because the device is > > * not designated to receive packets (e.g. backup link in a bond). > > + * > > + * @rx_otherhost_dropped: Number of packets dropped due to mismatch in > > + * packet's destination MAC address. > > */ > > struct rtnl_link_stats64 { > > __u64 rx_packets; > > @@ -243,6 +246,8 @@ struct rtnl_link_stats64 { > > __u64 rx_compressed; > > __u64 tx_compressed; > > __u64 rx_nohandler; > > + > > + __u64 rx_otherhost_dropped; > > }; > > > > /* The struct should be in sync with struct ifmap */ rebase on latest net-next/master and repost. Looks like it's conflicting with recently merged commit 9309f97aef6d ("net: dev: Add hardware stats support")