From eric.dumazet@gmail.com Tue Aug 25 12:50:34 2009 Date: Tue, 25 Aug 2009 18:48:53 +0200 From: Eric Dumazet To: Christoph Lameter Cc: Sridhar Samudrala , Nivedita Singhvi , netdev@vger.kernel.org, David S. Miller Subject: Re: UDP multicast packet loss not reported if TX ring overrun? [ The following text is in the "ISO-8859-1" character set. ] [ Your display is set for the "ANSI_X3.4-1968" character set. ] [ Some characters may be displayed incorrectly. ] Christoph Lameter a ?crit : > On Tue, 25 Aug 2009, Eric Dumazet wrote: > >>> I read this just yesterday. IP_RECVERR means that the application wants to >>> see details on each loss. We just want some counters that give us accurate >>> statistics to gauge where packet loss is occurring. Applications are >>> usually not interested in tracking the fate of each packet. >> Yep, but IP_RECVERR also has the side effect of letting kernel returns -ENOBUFS error >> in sending and congestion, which was your initial point :) > > The initial point was that the SNMP counters are not updated if IP_RECVERR > is not set which is clearly a bug and your and my patch addresses that. Technically speaking, the send() syscall is in error. Frame is not sent, so there is no drop at all. Like trying to send() from a bad user buffer, or write() to a too big file... > > Then Sridhar noted that there are other tx drop counters. qdisc counters > are also not updated. Wish we would maintain tx drops counters there as > well so that we can track down which NIC drops it. > > Then came the wishlist of UDP counters for tx drops and socket based > tx_drop accounting for tuning and tracking down which app is sending > too fast .... ;-) > > The apps could be third party apps. Just need to be able to troubleshoot > packet loss. > Question is : should we just allow send() to return an error (-ENOBUF) regardless of IP_RECVERR being set or not ? I dont think it would be so bad after all. Most apps probably dont care, or already handle the error. --- net/ipv4/ip_output.c | 2 +- net/ipv6/ip6_output.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) Index: linux-2.6/net/ipv4/ip_output.c =================================================================== --- linux-2.6.orig/net/ipv4/ip_output.c 2009-08-25 21:15:03.000000000 +0000 +++ linux-2.6/net/ipv4/ip_output.c 2009-08-25 21:15:23.000000000 +0000 @@ -1302,7 +1302,7 @@ int ip_push_pending_frames(struct sock * err = ip_local_out(skb); if (err) { if (err > 0) - err = inet->recverr ? net_xmit_errno(err) : 0; + err = net_xmit_errno(err); if (err) goto error; } Index: linux-2.6/net/ipv6/ip6_output.c =================================================================== --- linux-2.6.orig/net/ipv6/ip6_output.c 2009-08-12 23:23:00.000000000 +0000 +++ linux-2.6/net/ipv6/ip6_output.c 2009-08-25 21:15:23.000000000 +0000 @@ -1526,7 +1526,7 @@ int ip6_push_pending_frames(struct sock err = ip6_local_out(skb); if (err) { if (err > 0) - err = np->recverr ? net_xmit_errno(err) : 0; + err = net_xmit_errno(err); if (err) goto error; }