Re: UDP multicast packet loss not reported if TX ring overrun?
From: Christoph Lameter <hidden>
Date: 2009-08-24 17:49:01
On Mon, 17 Aug 2009, Sridhar Samudrala wrote:
So it is possible that there is some other place in the stack where the packets are gettting dropped but not counted.
Such a deed occurs in ip_push_pending_frames():
/* Netfilter gets whole the not fragmented skb. */
err = ip_local_out(skb);
if (err) {
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;
So if ip_local_out returns NET_XMIT_DROP then its simply going to be
replaced by 0. Then we check err again and there is no error!!!!
The statistics are only generated if IP_RECVERR is set.
Could we move the increment of IPSTATS_MIB_OUTDISCARDS up so that it
is incremented regardless of the setting of IP_RECVERR?
F.e?
Subject: Report TX drops
Incrementing of TX drop counters currently does not work if errors from the
network stack are suppressed (IP_RECVERR off). Increment the statistics
independently of the setting of IP_RECVERR.
Signed-off-by: Christoph Lameter <redacted>
---
net/ipv4/ip_output.c | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
Index: linux-2.6/net/ipv4/ip_output.c
===================================================================--- linux-2.6.orig/net/ipv4/ip_output.c 2009-08-24 17:04:27.000000000 +0000
+++ linux-2.6/net/ipv4/ip_output.c 2009-08-24 17:32:05.000000000 +0000@@ -1300,20 +1300,21 @@ int ip_push_pending_frames(struct sock * /* Netfilter gets whole the not fragmented skb. */ err = ip_local_out(skb); - if (err) { - if (err > 0) - err = inet->recverr ? net_xmit_errno(err) : 0; - if (err) - goto error; + if (err > 0) { + /* The packet was dropped by the network subsystem */ + IP_INC_STATS(net, IPSTATS_MIB_OUTDISCARDS); + + /* + * Errors are not passed on if the socket + * does not process errors (see IP_RECVERR). + * net_xmit_errno filters NET_XMIT_CN. + */ + err = inet->recverr ? net_xmit_errno(err) : 0; } out: ip_cork_release(inet); return err; - -error: - IP_INC_STATS(net, IPSTATS_MIB_OUTDISCARDS); - goto out; } /*