netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: James M Leddy <james.leddy@redhat.com>
To: netdev@vger.kernel.org
Cc: James M Leddy <james.leddy@redhat.com>
Subject: [PATCH] udp: Add MIB counters for rcvbuferrors
Date: Tue, 17 Jun 2014 16:13:02 -0400	[thread overview]
Message-ID: <1403035982-6548-1-git-send-email-james.leddy@redhat.com> (raw)

Add MIB counters for rcvbuferrors in UDP to help diagnose problems.

Signed-off-by: James M Leddy <james.leddy@redhat.com>
---
 net/ipv4/udp.c |   13 ++++++++-----
 net/ipv6/udp.c |   15 ++++++++++-----
 2 files changed, 18 insertions(+), 10 deletions(-)

diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index 4468e1a..8059902 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -1542,12 +1542,17 @@ int udp_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
 	}
 
 	if (rcu_access_pointer(sk->sk_filter) &&
-	    udp_lib_checksum_complete(skb))
-		goto csum_error;
+	    udp_lib_checksum_complete(skb)) {
+		UDP_INC_STATS_BH(sock_net(sk), UDP_MIB_CSUMERRORS, is_udplite);
+		goto drop;
+	}
 
 
-	if (sk_rcvqueues_full(sk, skb, sk->sk_rcvbuf))
+	if (sk_rcvqueues_full(sk, skb, sk->sk_rcvbuf)) {
+		UDP_INC_STATS_BH(sock_net(sk), UDP_MIB_RCVBUFERRORS,
+				 is_udplite);
 		goto drop;
+	}
 
 	rc = 0;
 
@@ -1563,8 +1568,6 @@ int udp_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
 
 	return rc;
 
-csum_error:
-	UDP_INC_STATS_BH(sock_net(sk), UDP_MIB_CSUMERRORS, is_udplite);
 drop:
 	UDP_INC_STATS_BH(sock_net(sk), UDP_MIB_INERRORS, is_udplite);
 	atomic_inc(&sk->sk_drops);
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index 1e586d9..94ba69c 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -666,12 +666,18 @@ int udpv6_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
 	}
 
 	if (rcu_access_pointer(sk->sk_filter)) {
-		if (udp_lib_checksum_complete(skb))
-			goto csum_error;
+		if (udp_lib_checksum_complete(skb)) {
+			UDP6_INC_STATS_BH(sock_net(sk),
+					  UDP_MIB_CSUMERRORS, is_udplite);
+			goto drop;
+		}
 	}
 
-	if (sk_rcvqueues_full(sk, skb, sk->sk_rcvbuf))
+	if (sk_rcvqueues_full(sk, skb, sk->sk_rcvbuf)) {
+		UDP6_INC_STATS_BH(sock_net(sk),
+				  UDP_MIB_RCVBUFERRORS, is_udplite);
 		goto drop;
+	}
 
 	skb_dst_drop(skb);
 
@@ -686,8 +692,7 @@ int udpv6_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
 	bh_unlock_sock(sk);
 
 	return rc;
-csum_error:
-	UDP6_INC_STATS_BH(sock_net(sk), UDP_MIB_CSUMERRORS, is_udplite);
+
 drop:
 	UDP6_INC_STATS_BH(sock_net(sk), UDP_MIB_INERRORS, is_udplite);
 	atomic_inc(&sk->sk_drops);
-- 
1.7.1

             reply	other threads:[~2014-06-17 20:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-17 20:13 James M Leddy [this message]
2014-06-21 22:07 ` [PATCH] udp: Add MIB counters for rcvbuferrors David Miller
2014-06-25 21:30   ` [PATCH v2] " James M Leddy
2014-06-27  4:22     ` Eric Dumazet
2014-06-25 21:31   ` [PATCH] " James M Leddy

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=1403035982-6548-1-git-send-email-james.leddy@redhat.com \
    --to=james.leddy@redhat.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).