From: Eric Dumazet <dada1@cosmosbay.com>
To: "David S. Miller" <davem@davemloft.net>
Cc: Linux Netdev List <netdev@vger.kernel.org>,
Herbert Xu <herbert@gondor.apana.org.au>
Subject: [PATCH] udp : increments sk_drops in __udp_queue_rcv_skb()
Date: Mon, 02 Feb 2009 16:32:51 +0100 [thread overview]
Message-ID: <49871223.2000701@cosmosbay.com> (raw)
Hi David
While investigating with Kenny Chang multicast drops problems, I found sk_drops
field was not anymore updated in current kernels for UDP IPV4 sockets.
Thank you
[PATCH] udp: increments sk_drops in __udp_queue_rcv_skb()
Commit 93821778def10ec1e69aa3ac10adee975dad4ff3
(udp: Fix rcv socket locking) accidentally removed sk_drops increments for
UDP IPV4 sockets.
This field can be used to detect incorrect sizing of socket receive buffers.
Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
---
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index b7faffe..997c418 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -1015,9 +1015,11 @@ static int __udp_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
if ((rc = sock_queue_rcv_skb(sk, skb)) < 0) {
/* Note that an ENOMEM error is charged twice */
- if (rc == -ENOMEM)
+ if (rc == -ENOMEM) {
UDP_INC_STATS_BH(sock_net(sk), UDP_MIB_RCVBUFERRORS,
is_udplite);
+ atomic_inc(&sk->sk_drops);
+ }
goto drop;
}
next reply other threads:[~2009-02-02 15:33 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-02 15:32 Eric Dumazet [this message]
2009-02-02 21:42 ` [PATCH] udp : increments sk_drops in __udp_queue_rcv_skb() David Miller
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=49871223.2000701@cosmosbay.com \
--to=dada1@cosmosbay.com \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=netdev@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.