netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] udp: Add MIB counters for rcvbuferrors
@ 2014-06-17 20:13 James M Leddy
  2014-06-21 22:07 ` David Miller
  0 siblings, 1 reply; 5+ messages in thread
From: James M Leddy @ 2014-06-17 20:13 UTC (permalink / raw)
  To: netdev; +Cc: James M Leddy

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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] udp: Add MIB counters for rcvbuferrors
  2014-06-17 20:13 [PATCH] udp: Add MIB counters for rcvbuferrors James M Leddy
@ 2014-06-21 22:07 ` David Miller
  2014-06-25 21:30   ` [PATCH v2] " James M Leddy
  2014-06-25 21:31   ` [PATCH] " James M Leddy
  0 siblings, 2 replies; 5+ messages in thread
From: David Miller @ 2014-06-21 22:07 UTC (permalink / raw)
  To: james.leddy; +Cc: netdev

From: James M Leddy <james.leddy@redhat.com>
Date: Tue, 17 Jun 2014 16:13:02 -0400

> Add MIB counters for rcvbuferrors in UDP to help diagnose problems.
> 
> Signed-off-by: James M Leddy <james.leddy@redhat.com>

Please compile test your patches:

net/ipv4/udp.c: In function ‘udp_queue_rcv_skb’:
net/ipv4/udp.c:1538:5: error: label ‘csum_error’ used but not defined
make[1]: *** [net/ipv4/udp.o] Error 1
make: *** [net/ipv4/udp.o] Error 2

The encapsulation handling above your changes still use that label.

Besides, I see no reason to replace the goto csum_error; with
doing the counter bump by hand and jumping to "drop".  Especially
since, as per above, there is another code path which can make
use of and thus share that csum_error label code.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v2] udp: Add MIB counters for rcvbuferrors
  2014-06-21 22:07 ` David Miller
@ 2014-06-25 21:30   ` James M Leddy
  2014-06-27  4:22     ` Eric Dumazet
  2014-06-25 21:31   ` [PATCH] " James M Leddy
  1 sibling, 1 reply; 5+ messages in thread
From: James M Leddy @ 2014-06-25 21:30 UTC (permalink / raw)
  To: netdev; +Cc: James M Leddy

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 |    5 ++++-
 net/ipv6/udp.c |    6 +++++-
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index d92f94b..7d5a866 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -1588,8 +1588,11 @@ int udp_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
 		goto csum_error;
 
 
-	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;
 
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index 95c8347..7092ff7 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -674,8 +674,11 @@ int udpv6_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
 			goto csum_error;
 	}
 
-	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);
 
@@ -690,6 +693,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:
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] udp: Add MIB counters for rcvbuferrors
  2014-06-21 22:07 ` David Miller
  2014-06-25 21:30   ` [PATCH v2] " James M Leddy
@ 2014-06-25 21:31   ` James M Leddy
  1 sibling, 0 replies; 5+ messages in thread
From: James M Leddy @ 2014-06-25 21:31 UTC (permalink / raw)
  To: David Miller; +Cc: netdev

On 06/21/2014 06:07 PM, David Miller wrote:
> From: James M Leddy <james.leddy@redhat.com>
> Date: Tue, 17 Jun 2014 16:13:02 -0400
>
>> Add MIB counters for rcvbuferrors in UDP to help diagnose problems.
>>
>> Signed-off-by: James M Leddy <james.leddy@redhat.com>
>
> Please compile test your patches:
>
> net/ipv4/udp.c: In function ‘udp_queue_rcv_skb’:
> net/ipv4/udp.c:1538:5: error: label ‘csum_error’ used but not defined
> make[1]: *** [net/ipv4/udp.o] Error 1
> make: *** [net/ipv4/udp.o] Error 2
>
> The encapsulation handling above your changes still use that label.
>
> Besides, I see no reason to replace the goto csum_error; with
> doing the counter bump by hand and jumping to "drop".  Especially
> since, as per above, there is another code path which can make
> use of and thus share that csum_error label code.

My bad, resending


-- 
James M Leddy

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] udp: Add MIB counters for rcvbuferrors
  2014-06-25 21:30   ` [PATCH v2] " James M Leddy
@ 2014-06-27  4:22     ` Eric Dumazet
  0 siblings, 0 replies; 5+ messages in thread
From: Eric Dumazet @ 2014-06-27  4:22 UTC (permalink / raw)
  To: James M Leddy; +Cc: netdev

On Wed, 2014-06-25 at 17:30 -0400, James M Leddy wrote:
> 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 |    5 ++++-
>  net/ipv6/udp.c |    6 +++++-
>  2 files changed, 9 insertions(+), 2 deletions(-)

Acked-by: Eric Dumazet <edumazet@google.com>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-06-27  4:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-17 20:13 [PATCH] udp: Add MIB counters for rcvbuferrors James M Leddy
2014-06-21 22:07 ` 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

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).