Re: UDP multicast packet loss not reported if TX ring overrun?

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Eric Dumazet
Date: Monday, August 24, 2009 - 3:02 pm

Christoph Lameter a écrit :

NET_XMIT_CN strikes again :)

Well, if ip_local_out() returns a negative error (say -EPERM for example),
 your patch disables OUTDISCARDS increments.

Maybe a simpler patch like this one ?

[PATCH] net: correctly updates OUTDISCARDS in ip_push_pending_frames()

ip_push_pending_frames() can fail to send a frame because of a congestioned
device. In this case, we increment SNMP OUTDISCARDS only if user set
IP_RECVERR, which is not RFC conformant.

Only case where we should not update OUTDISCARDS is when
ip_local_output() return value is NET_XMIT_CN (meaning
skb was xmitted but future frames might be dropped)

Signed-off-by: Christoph Lameter <cl@linux-foundation.org>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
---
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
index 7d08210..27a5b79 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -1301,19 +1301,15 @@ int ip_push_pending_frames(struct sock *sk)
 	/* Netfilter gets whole the not fragmented skb. */
 	err = ip_local_out(skb);
 	if (err) {
+		if (err != NET_XMIT_CN)
+			IP_INC_STATS(net, IPSTATS_MIB_OUTDISCARDS);
 		if (err > 0)
 			err = inet->recverr ? net_xmit_errno(err) : 0;
-		if (err)
-			goto error;
 	}
 
 out:
 	ip_cork_release(inet);
 	return err;
-
-error:
-	IP_INC_STATS(net, IPSTATS_MIB_OUTDISCARDS);
-	goto out;
 }
 
 /*
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
UDP multicast packet loss not reported if TX ring overrun?, Christoph Lameter, (Mon Aug 17, 1:01 pm)
Re: UDP multicast packet loss not reported if TX ring overrun?, Christoph Lameter, (Mon Aug 17, 1:46 pm)
Re: UDP multicast packet loss not reported if TX ring overrun?, Sridhar Samudrala, (Mon Aug 17, 2:50 pm)
Re: UDP multicast packet loss not reported if TX ring overrun?, Christoph Lameter, (Mon Aug 17, 3:13 pm)
Re: UDP multicast packet loss not reported if TX ring overrun?, Sridhar Samudrala, (Mon Aug 17, 3:43 pm)
Re: UDP multicast packet loss not reported if TX ring overrun?, Christoph Lameter, (Mon Aug 17, 3:52 pm)
Re: UDP multicast packet loss not reported if TX ring overrun?, Christoph Lameter, (Mon Aug 17, 3:57 pm)
Re: UDP multicast packet loss not reported if TX ring overrun?, Sridhar Samudrala, (Mon Aug 17, 5:12 pm)
Re: UDP multicast packet loss not reported if TX ring overrun?, Christoph Lameter, (Mon Aug 17, 5:25 pm)
Re: UDP multicast packet loss not reported if TX ring overrun?, Christoph Lameter, (Mon Aug 24, 10:40 am)
Re: UDP multicast packet loss not reported if TX ring overrun?, Eric Dumazet, (Mon Aug 24, 3:02 pm)
Re: UDP multicast packet loss not reported if TX ring overrun?, Sridhar Samudrala, (Mon Aug 24, 3:36 pm)
Re: UDP multicast packet loss not reported if TX ring overrun?, Christoph Lameter, (Tue Aug 25, 6:45 am)
Re: UDP multicast packet loss not reported if TX ring overrun?, Christoph Lameter, (Tue Aug 25, 6:46 am)
Re: UDP multicast packet loss not reported if TX ring overrun?, Christoph Lameter, (Tue Aug 25, 6:48 am)
Re: UDP multicast packet loss not reported if TX ring overrun?, Christoph Lameter, (Tue Aug 25, 7:00 am)
Re: UDP multicast packet loss not reported if TX ring overrun?, Christoph Lameter, (Tue Aug 25, 8:35 am)
Re: UDP multicast packet loss not reported if TX ring overrun?, Christoph Lameter, (Tue Aug 25, 9:11 am)
Re: UDP multicast packet loss not reported if TX ring overrun?, Christoph Lameter, (Tue Aug 25, 9:36 am)
Re: UDP multicast packet loss not reported if TX ring overrun?, Christoph Lameter, (Tue Aug 25, 10:01 am)
Re: UDP multicast packet loss not reported if TX ring overrun?, Christoph Lameter, (Tue Aug 25, 10:44 am)
Re: UDP multicast packet loss not reported if TX ring overrun?, Christoph Lameter, (Tue Aug 25, 10:53 am)
Re: UDP multicast packet loss not reported if TX ring overrun?, Sridhar Samudrala, (Tue Aug 25, 11:38 am)