Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp3478190pxp; Tue, 8 Mar 2022 15:29:38 -0800 (PST) X-Google-Smtp-Source: ABdhPJwea4U+jyj6MVDSQ6u4RHrau4RNmMrX8SpvGgtZG0SHVQ+DrtaqVN57o5H4HXS69SqKYe6K X-Received: by 2002:a17:902:eb84:b0:151:f80e:e98b with SMTP id q4-20020a170902eb8400b00151f80ee98bmr8662905plg.99.1646782178699; Tue, 08 Mar 2022 15:29:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646782178; cv=none; d=google.com; s=arc-20160816; b=U6m8kTOx5KP5lO4DQuW6WrHfuESXw/plzy5+r3vFrMCWtXaprV+bL8AqC4PE45Zxyd GXoU7BZQWb/DOSyY0EmKN9naQj+o3F2o/+Vj1NPGuvj/ft4F8CY9ZTSRZhMy/Lb5nnzo 2ZeQmj1Cnlus+ZxBkJY6eZpN9ZhpVtmaFiWHytBt+anQAxzGakYXuwjxeNfYUv4vrlMr clurRiB0JKE1fdWCSSyjHvM6Oc7luWapUFIdL2kyIWMxlPtA4Z43DD0frQW6z4IFO63c RUan+ntEBkx/AGgdQfc6DBa7PUGC7PhkVba6Sl4OyWprXkdjjjIlYWn91zbDBxgH7lj4 lNZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=0lHlecG7vvSKpLAhuVWl2fA0VDNrEbvSg6pV3iTprAY=; b=LS8SrtU7cNM7mZ0+i0ojY0lqvUdSB6l44wyVTF4hhvMfJpu2Tc6kdhdp3x1QJk6c4L YpPNcyxy1n8n9CbeuISQIXjc0ChCV7gZXG+GHIXf8+lWzrZGZJ01rJPJCXzqR+0BYpNy sZzWzGP+E5Wp0GWiiJgJGnxJnQWJNF4MNU0I4JlVVG/qR1IerMgsUOnQu2M4VclVvMSw 0V64QQKXP59zTY5+E2/V6kAZrM+dtE/DOPBA1NCazCaTZyBeU6Y0T0930CV2KMqZ89Nr BGYDAST9Gg+YrBBPVHLYx8wseJn8EadB+gZCHNW+86O6/x3D7t8mkWgl3/KfSvDu4X3Z aQiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="bXimZJ/u"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id i25-20020aa78d99000000b004f0fc0ad94fsi193496pfr.87.2022.03.08.15.29.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Mar 2022 15:29:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="bXimZJ/u"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id BD7DE9D0EE; Tue, 8 Mar 2022 15:18:48 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240933AbiCHWwi (ORCPT + 99 others); Tue, 8 Mar 2022 17:52:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47122 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235509AbiCHWwe (ORCPT ); Tue, 8 Mar 2022 17:52:34 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A7CC94EF4A; Tue, 8 Mar 2022 14:51:37 -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 3B69561185; Tue, 8 Mar 2022 22:51:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7F307C340EB; Tue, 8 Mar 2022 22:51:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1646779896; bh=Bh7Qn9WLvAm/XvtyjjDG+yCZjMwP/qRWgfw7xqZkuIQ=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=bXimZJ/uR+EnEDhpBQwA2ECliX10g1BlEZbswpDzmGCyAewwu8zHiAwC2zcTrbMnV L7ff2C5F9m/dyh7iyEP00Tim7x/G5CIcI0CjB4zBPpuielh5SI47SfW1brDd4JN2iA cI2FPTfeJgsbWCOh1zb+J4XmkIssc6gDBH+7CmmeOGLPkYHtaervbgS9BzMrbe997J 9HKvADlTKm3VpjVi6c5k4PqKVUQMRsYubffcN6DQ822oi0dyRuKobZuwDk1N/TJm01 MVimR1YnK4Uz4/hgxabV3mkjr6Y5LYEx2AK3k8Z8Ku/EQINZUITefwe4Z2CEAVfAGK cXIDBCPJO9IYQ== Message-ID: Date: Tue, 8 Mar 2022 15:51:32 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.6.2 Subject: Re: [PATCH v3 net-next] net-core: add rx_otherhost_dropped counter Content-Language: en-US To: Jeffrey Ji , "David S . Miller" Cc: Brian Vazquez , Jakub Kicinski , Hideaki YOSHIFUJI , Eric Dumazet , Antoine Tenart , Sebastian Andrzej Siewior , Alexander Lobakin , Kumar Kartikeya Dwivedi , Arnd Bergmann , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, jeffreyji References: <20220308212531.752215-1-jeffreyjilinux@gmail.com> From: David Ahern In-Reply-To: <20220308212531.752215-1-jeffreyjilinux@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 3/8/22 2:25 PM, Jeffrey Ji wrote: > diff --git a/net/ipv4/ip_input.c b/net/ipv4/ip_input.c > index 95f7bb052784..8b87ea99904b 100644 > --- a/net/ipv4/ip_input.c > +++ b/net/ipv4/ip_input.c > @@ -451,6 +451,7 @@ static struct sk_buff *ip_rcv_core(struct sk_buff *skb, struct net *net) > * that it receives, do not try to analyse it. > */ > if (skb->pkt_type == PACKET_OTHERHOST) { > + atomic_long_inc(&skb->dev->rx_otherhost_dropped); > drop_reason = SKB_DROP_REASON_OTHERHOST; > goto drop; > } > diff --git a/net/ipv6/ip6_input.c b/net/ipv6/ip6_input.c > index 5b5ea35635f9..5624c937f87f 100644 > --- a/net/ipv6/ip6_input.c > +++ b/net/ipv6/ip6_input.c > @@ -150,6 +150,7 @@ static struct sk_buff *ip6_rcv_core(struct sk_buff *skb, struct net_device *dev, > struct inet6_dev *idev; > > if (skb->pkt_type == PACKET_OTHERHOST) { > + atomic_long_inc(&skb->dev->rx_otherhost_dropped); > kfree_skb(skb); > return NULL; > } that's an expensive packet counter for a common path (e.g., hosting environments).