All of lore.kernel.org
 help / color / mirror / Atom feed
From: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
To: Eric Dumazet <eric.dumazet@gmail.com>,
	netdev@vger.kernel.org, "David S. Miller" <davem@davemloft.net>
Cc: Cong Wang <xiyou.wangcong@gmail.com>,
	Jiri Pirko <jiri@resnulli.us>,
	Jamal Hadi Salim <jhs@mojatatu.com>
Subject: Re: [PATCH] net_sched: blackhole: tell upper qdisc about dropped packets
Date: Fri, 15 Jun 2018 16:21:55 +0300	[thread overview]
Message-ID: <fe86812c-f0bb-157f-d489-ba08a02b43c7@yandex-team.ru> (raw)
In-Reply-To: <e654c245-7745-f49a-c995-7071e0e57153@gmail.com>

On 15.06.2018 16:13, Eric Dumazet wrote:
> 
> 
> On 06/15/2018 03:27 AM, Konstantin Khlebnikov wrote:
>> When blackhole is used on top of classful qdisc like hfsc it breaks
>> qlen and backlog counters because packets are disappear without notice.
>>
>> In HFSC non-zero qlen while all classes are inactive triggers warning:
>> WARNING: ... at net/sched/sch_hfsc.c:1393 hfsc_dequeue+0xba4/0xe90 [sch_hfsc]
>> and schedules watchdog work endlessly.
>>
>> This patch return __NET_XMIT_BYPASS in addition to NET_XMIT_SUCCESS,
>> this flag tells upper layer: this packet is gone and isn't queued.
>>
>> Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
>> ---
>>   net/sched/sch_blackhole.c |    2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/net/sched/sch_blackhole.c b/net/sched/sch_blackhole.c
>> index c98a61e980ba..9c4c2bb547d7 100644
>> --- a/net/sched/sch_blackhole.c
>> +++ b/net/sched/sch_blackhole.c
>> @@ -21,7 +21,7 @@ static int blackhole_enqueue(struct sk_buff *skb, struct Qdisc *sch,
>>   			     struct sk_buff **to_free)
>>   {
>>   	qdisc_drop(skb, sch, to_free);
>> -	return NET_XMIT_SUCCESS;
>> +	return NET_XMIT_SUCCESS | __NET_XMIT_BYPASS;
> 
> Why do not we use instead :
> 
> 	return qdisc_drop(skb, sch, to_free);
> 
> Although noop_enqueue() seems to use :
> 
> 	return NET_XMIT_CN;
> 
> Oh well.
> 
> 

I suppose "blackhole" should work like "successful" xmit, but counted as drop.

  reply	other threads:[~2018-06-15 13:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-15 10:27 [PATCH] net_sched: blackhole: tell upper qdisc about dropped packets Konstantin Khlebnikov
2018-06-15 13:13 ` Eric Dumazet
2018-06-15 13:21   ` Konstantin Khlebnikov [this message]
2018-06-16  4:00     ` Cong Wang
2018-06-16  4:03       ` Cong Wang
2018-06-16 23:42 ` David Miller

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=fe86812c-f0bb-157f-d489-ba08a02b43c7@yandex-team.ru \
    --to=khlebnikov@yandex-team.ru \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=jhs@mojatatu.com \
    --cc=jiri@resnulli.us \
    --cc=netdev@vger.kernel.org \
    --cc=xiyou.wangcong@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.