From: David Ahern <dsahern@kernel.org>
To: Jeffrey Ji <jeffreyjilinux@gmail.com>,
"David S . Miller" <davem@davemloft.net>
Cc: Brian Vazquez <brianvv@google.com>,
Jakub Kicinski <kuba@kernel.org>,
Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>,
Eric Dumazet <edumazet@google.com>,
Antoine Tenart <atenart@kernel.org>,
Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
Alexander Lobakin <alexandr.lobakin@intel.com>,
Kumar Kartikeya Dwivedi <memxor@gmail.com>,
Arnd Bergmann <arnd@arndb.de>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
jeffreyji <jeffreyji@google.com>
Subject: Re: [PATCH v3 net-next] net-core: add rx_otherhost_dropped counter
Date: Tue, 8 Mar 2022 15:51:32 -0700 [thread overview]
Message-ID: <d1b25466-6f83-591e-39a6-8fdbd56846fb@kernel.org> (raw)
In-Reply-To: <20220308212531.752215-1-jeffreyjilinux@gmail.com>
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).
next prev parent reply other threads:[~2022-03-08 22:51 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-08 21:25 Jeffrey Ji
2022-03-08 22:51 ` David Ahern [this message]
2022-03-08 23:18 ` Eric Dumazet
2022-03-09 0:28 ` Jakub Kicinski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d1b25466-6f83-591e-39a6-8fdbd56846fb@kernel.org \
--to=dsahern@kernel.org \
--cc=alexandr.lobakin@intel.com \
--cc=arnd@arndb.de \
--cc=atenart@kernel.org \
--cc=bigeasy@linutronix.de \
--cc=brianvv@google.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=jeffreyji@google.com \
--cc=jeffreyjilinux@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=memxor@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=yoshfuji@linux-ipv6.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®