Skip to content

Commit

Permalink
udp: Add MIB counters for rcvbuferrors
Browse files Browse the repository at this point in the history
Add MIB counters for rcvbuferrors in UDP to help diagnose problems.

Signed-off-by: James M Leddy <james.leddy@redhat.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
James M Leddy authored and David S. Miller committed Jun 27, 2014
1 parent 73413ff commit 3e215c8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 4 additions & 1 deletion net/ipv4/udp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
6 changes: 5 additions & 1 deletion net/ipv6/udp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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:
Expand Down

0 comments on commit 3e215c8

Please sign in to comment.