|
@@ -662,6 +662,16 @@ out:
|
|
UDP_INC_STATS_USER(UDP_MIB_OUTDATAGRAMS);
|
|
UDP_INC_STATS_USER(UDP_MIB_OUTDATAGRAMS);
|
|
return len;
|
|
return len;
|
|
}
|
|
}
|
|
|
|
+ /*
|
|
|
|
+ * ENOBUFS = no kernel mem, SOCK_NOSPACE = no sndbuf space. Reporting
|
|
|
|
+ * ENOBUFS might not be good (it's not tunable per se), but otherwise
|
|
|
|
+ * we don't have a good statistic (IpOutDiscards but it can be too many
|
|
|
|
+ * things). We could add another new stat but at least for now that
|
|
|
|
+ * seems like overkill.
|
|
|
|
+ */
|
|
|
|
+ if (err == -ENOBUFS || test_bit(SOCK_NOSPACE, &sk->sk_socket->flags)) {
|
|
|
|
+ UDP_INC_STATS_USER(UDP_MIB_SNDBUFERRORS);
|
|
|
|
+ }
|
|
return err;
|
|
return err;
|
|
|
|
|
|
do_confirm:
|
|
do_confirm:
|
|
@@ -981,6 +991,7 @@ static int udp_encap_rcv(struct sock * sk, struct sk_buff *skb)
|
|
static int udp_queue_rcv_skb(struct sock * sk, struct sk_buff *skb)
|
|
static int udp_queue_rcv_skb(struct sock * sk, struct sk_buff *skb)
|
|
{
|
|
{
|
|
struct udp_sock *up = udp_sk(sk);
|
|
struct udp_sock *up = udp_sk(sk);
|
|
|
|
+ int rc;
|
|
|
|
|
|
/*
|
|
/*
|
|
* Charge it to the socket, dropping if the queue is full.
|
|
* Charge it to the socket, dropping if the queue is full.
|
|
@@ -1027,7 +1038,10 @@ static int udp_queue_rcv_skb(struct sock * sk, struct sk_buff *skb)
|
|
skb->ip_summed = CHECKSUM_UNNECESSARY;
|
|
skb->ip_summed = CHECKSUM_UNNECESSARY;
|
|
}
|
|
}
|
|
|
|
|
|
- if (sock_queue_rcv_skb(sk,skb)<0) {
|
|
|
|
|
|
+ if ((rc = sock_queue_rcv_skb(sk,skb)) < 0) {
|
|
|
|
+ /* Note that an ENOMEM error is charged twice */
|
|
|
|
+ if (rc == -ENOMEM)
|
|
|
|
+ UDP_INC_STATS_BH(UDP_MIB_RCVBUFERRORS);
|
|
UDP_INC_STATS_BH(UDP_MIB_INERRORS);
|
|
UDP_INC_STATS_BH(UDP_MIB_INERRORS);
|
|
kfree_skb(skb);
|
|
kfree_skb(skb);
|
|
return -1;
|
|
return -1;
|