netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: David Miller <davem@davemloft.net>
Cc: cl@linux-foundation.org, sri@us.ibm.com, dlstevens@us.ibm.com,
	netdev@vger.kernel.org, niv@linux.vnet.ibm.com,
	mtk.manpages@gmail.com
Subject: Re: [PATCH net-next-2.6] ip: Report qdisc packet drops
Date: Mon, 31 Aug 2009 14:09:50 +0200	[thread overview]
Message-ID: <4A9BBD8E.2010303@gmail.com> (raw)
In-Reply-To: <20090828.233858.256193304.davem@davemloft.net>

David Miller a écrit :
> From: Eric Dumazet <eric.dumazet@gmail.com>
> Date: Fri, 28 Aug 2009 19:26:04 +0200
> 
>> [PATCH] ip: Report qdisc packet drops
>>
>> Christoph Lameter pointed out that packet drops at qdisc level where not
>> accounted in SNMP counters. Only if application sets IP_RECVERR, drops
>> are reported to user and SNMP counters updated.
>>
>> IP_RECVERR is used to enable extended reliable error message passing.
>> In case of tx drops at qdisc level, no error packet will be generated.
>> It seems un-necessary to hide the qdisc drops for non IP_RECVERR enabled
>> sockets (as probably most sockets are)
>>
>> By removing the check of IP_RECVERR enabled sockets in ip_push_pending_frames()/
>> raw_send_hdrinc() / ip6_push_pending_frames() / rawv6_send_hdrinc(),
>> we can properly update IPSTATS_MIB_OUTDISCARDS, and in case of UDP, update
>> UDP_MIB_SNDBUFERRORS SNMP counters.
>>
>> Application send() syscalls, instead of returning an OK status (thus lying),
>> will return -ENOBUFS error.
>>
>> Note : send() manual page explicitly says for -ENOBUFS error :
>>
>>  "The output queue for a network interface was full.
>>   This generally indicates that the interface has stopped sending,
>>   but may be caused by transient congestion.
>>   (Normally, this does not occur in Linux. Packets are just silently
>>   dropped when a device queue overflows.) "
>>
>> This was not true for IP_RECVERR enabled sockets for < 2.6.32 linuxes,
>> and starting from linux 2.6.32, last part wont be true at all.
>>
>> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
>> Signed-off-by: Christoph Lameter <cl@linux-foundation.org>
> 
> The core question in all of this is what IP_RECVERR means.
> 
> As far as I remember Alexey Kuznetsov's intentions, it means that the
> application is interested in learning about errors caused by the
> infrastructure of the network between local and remote stacks.
> 
> Reporting a qdisc level drop to the application by default has the
> potential to break applications, because BSD and other stacks do not
> do this.
> 
> I can see why we might be able to get away with making this change
> now.  And I also can see the benefits of it, for sure.
> 
> Let me think about this some more.

Yes I do agree this is risky.

Re-reading again this stuff, I realized ip6_push_pending_frames()
was not updating IPSTATS_MIB_OUTDISCARDS, even if IP_RECVERR was set.

May I suggest following path :

1) Correct ip6_push_pending_frames() to properly
account for dropped-by-qdisc frames when IP_RECVERR is set

2) Submit a patch to account for qdisc-dropped frames in SNMP counters
but still return a OK to user application, to not break them ?

Thanks

[PATCH] ipv6: ip6_push_pending_frames() should increment IPSTATS_MIB_OUTDISCARDS

qdisc drops should be notified to IP_RECVERR enabled sockets, as done in IPV4.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
---
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
index 6ad5aad..a931229 100644
--- a/net/ipv6/ip6_output.c
+++ b/net/ipv6/ip6_output.c
@@ -1520,6 +1520,7 @@ out:
 	ip6_cork_release(inet, np);
 	return err;
 error:
+	IP6_INC_STATS(net, rt->rt6i_idev, IPSTATS_MIB_OUTDISCARDS);
 	goto out;
 }
 

  reply	other threads:[~2009-08-31 12:09 UTC|newest]

Thread overview: 73+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-17 20:01 UDP multicast packet loss not reported if TX ring overrun? Christoph Lameter
2009-08-17 20:40 ` Nivedita Singhvi
2009-08-17 20:46   ` Christoph Lameter
2009-08-17 21:50     ` Sridhar Samudrala
2009-08-17 22:13       ` Christoph Lameter
2009-08-17 22:43         ` Sridhar Samudrala
2009-08-17 22:52           ` Christoph Lameter
2009-08-17 22:57             ` Christoph Lameter
2009-08-18  0:12             ` Sridhar Samudrala
2009-08-18  0:25               ` Christoph Lameter
2009-08-24 17:40               ` Christoph Lameter
2009-08-24 22:02                 ` Eric Dumazet
2009-08-24 22:36                   ` Sridhar Samudrala
2009-08-25 13:48                     ` Christoph Lameter
2009-08-25 19:03                       ` David Stevens
2009-08-25 19:08                         ` David Miller
2009-08-25 19:15                         ` Christoph Lameter
2009-08-25 19:56                           ` Joe Perches
2009-08-25 22:35                           ` Sridhar Samudrala
2009-08-26 14:08                             ` Christoph Lameter
2009-08-26 14:22                               ` Eric Dumazet
2009-08-26 15:27                                 ` Christoph Lameter
2009-08-26 16:29                             ` Christoph Lameter
2009-08-26 17:50                               ` Sridhar Samudrala
2009-08-26 19:09                                 ` Christoph Lameter
2009-08-26 22:11                                   ` Sridhar Samudrala
2009-08-27 15:40                                     ` Christoph Lameter
2009-08-27 20:23                                       ` Christoph Lameter
2009-08-28 13:53                                         ` Christoph Lameter
2009-08-28 15:07                                           ` Eric Dumazet
2009-08-28 16:15                                             ` Christoph Lameter
2009-08-28 17:26                                               ` [PATCH net-next-2.6] ip: Report qdisc packet drops Eric Dumazet
2009-08-29  6:38                                                 ` David Miller
2009-08-31 12:09                                                   ` Eric Dumazet [this message]
2009-09-02  1:41                                                     ` David Miller
2009-09-02 14:43                                                       ` Eric Dumazet
2009-09-02 16:11                                                         ` Sridhar Samudrala
2009-09-02 16:20                                                           ` Eric Dumazet
2009-09-02 19:37                                                         ` Christoph Lameter
2009-09-02 16:05                                                           ` Eric Dumazet
2009-09-02 22:26                                                         ` Eric Dumazet
2009-09-03  1:05                                                           ` David Miller
2009-09-03 17:57                                                           ` Christoph Lameter
2009-09-03 14:12                                                             ` Eric Dumazet
2009-09-03 18:35                                                               ` Christoph Lameter
2009-09-02 18:22                                                       ` Christoph Lameter
2009-09-03  1:09                                                         ` David Miller
2009-08-28 19:26                                               ` UDP multicast packet loss not reported if TX ring overrun? David Miller
2009-08-28 20:00                                                 ` Christoph Lameter
2009-08-28 20:04                                                   ` David Miller
2009-08-28 19:24                                           ` David Miller
2009-08-28 19:53                                             ` Christoph Lameter
2009-08-28 20:03                                               ` David Miller
2009-08-28 20:09                                                 ` Christoph Lameter
2009-08-30  0:21                                             ` Mark Smith
2009-08-25 13:46                   ` Christoph Lameter
2009-08-25 13:48                     ` Eric Dumazet
2009-08-25 14:00                       ` Christoph Lameter
2009-08-25 15:32                         ` Eric Dumazet
2009-08-25 15:35                           ` Christoph Lameter
2009-08-25 15:58                             ` Eric Dumazet
2009-08-25 16:11                               ` Christoph Lameter
2009-08-25 16:27                                 ` Eric Dumazet
2009-08-25 16:36                                   ` Christoph Lameter
2009-08-25 16:48                                     ` Eric Dumazet
2009-08-25 17:01                                       ` Christoph Lameter
2009-08-25 17:08                                         ` Eric Dumazet
2009-08-25 17:44                                           ` Christoph Lameter
2009-08-25 17:53                                           ` Christoph Lameter
2009-08-25 18:38                                       ` Sridhar Samudrala
2009-08-24 23:14             ` Eric Dumazet
2009-08-25  6:46               ` Eric Dumazet
2009-08-25 13:45               ` Christoph Lameter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A9BBD8E.2010303@gmail.com \
    --to=eric.dumazet@gmail.com \
    --cc=cl@linux-foundation.org \
    --cc=davem@davemloft.net \
    --cc=dlstevens@us.ibm.com \
    --cc=mtk.manpages@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=niv@linux.vnet.ibm.com \
    --cc=sri@us.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).