All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net_sched/hhf: update hierarchical backlog when drop packet
@ 2017-08-21  8:12 Konstantin Khlebnikov
  2017-08-21 16:52 ` Cong Wang
  0 siblings, 1 reply; 4+ messages in thread
From: Konstantin Khlebnikov @ 2017-08-21  8:12 UTC (permalink / raw)
  To: netdev, David S. Miller; +Cc: Cong Wang, Jiri Pirko

When hhf_enqueue() drops packet from another bucket it
have to update backlog at upper qdiscs too.

Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
Fixes: 2ccccf5fb43f ("net_sched: update hierarchical backlog too")
---
 net/sched/sch_hhf.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/net/sched/sch_hhf.c b/net/sched/sch_hhf.c
index 51d3ba682af9..c8d84436e427 100644
--- a/net/sched/sch_hhf.c
+++ b/net/sched/sch_hhf.c
@@ -406,8 +406,11 @@ static int hhf_enqueue(struct sk_buff *skb, struct Qdisc *sch,
 	/* Return Congestion Notification only if we dropped a packet from this
 	 * bucket.
 	 */
-	if (hhf_drop(sch, to_free) == idx)
+	if (hhf_drop(sch, to_free) == idx) {
+		qdisc_tree_reduce_backlog(sch, 0,
+					  prev_backlog - sch->qstats.backlog);
 		return NET_XMIT_CN;
+	}
 
 	/* As we dropped a packet, better let upper stack know this. */
 	qdisc_tree_reduce_backlog(sch, 1, prev_backlog - sch->qstats.backlog);

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] net_sched/hhf: update hierarchical backlog when drop packet
  2017-08-21  8:12 [PATCH] net_sched/hhf: update hierarchical backlog when drop packet Konstantin Khlebnikov
@ 2017-08-21 16:52 ` Cong Wang
       [not found]   ` <16531503334617@webcorp01h.yandex-team.ru>
  0 siblings, 1 reply; 4+ messages in thread
From: Cong Wang @ 2017-08-21 16:52 UTC (permalink / raw)
  To: Konstantin Khlebnikov
  Cc: Linux Kernel Network Developers, David S. Miller, Jiri Pirko

On Mon, Aug 21, 2017 at 1:12 AM, Konstantin Khlebnikov
<khlebnikov@yandex-team.ru> wrote:
> When hhf_enqueue() drops packet from another bucket it
> have to update backlog at upper qdiscs too.
>
> Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
> Fixes: 2ccccf5fb43f ("net_sched: update hierarchical backlog too")
> ---
>  net/sched/sch_hhf.c |    5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/net/sched/sch_hhf.c b/net/sched/sch_hhf.c
> index 51d3ba682af9..c8d84436e427 100644
> --- a/net/sched/sch_hhf.c
> +++ b/net/sched/sch_hhf.c
> @@ -406,8 +406,11 @@ static int hhf_enqueue(struct sk_buff *skb, struct Qdisc *sch,
>         /* Return Congestion Notification only if we dropped a packet from this
>          * bucket.
>          */
> -       if (hhf_drop(sch, to_free) == idx)
> +       if (hhf_drop(sch, to_free) == idx) {
> +               qdisc_tree_reduce_backlog(sch, 0,


It should be 1 here instead of 0, because one packet is dropped
even if hhf_drop() == idx.


> +                                         prev_backlog - sch->qstats.backlog);
>                 return NET_XMIT_CN;
> +       }
>
>         /* As we dropped a packet, better let upper stack know this. */
>         qdisc_tree_reduce_backlog(sch, 1, prev_backlog - sch->qstats.backlog);
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] net_sched/hhf: update hierarchical backlog when drop packet
       [not found]   ` <16531503334617@webcorp01h.yandex-team.ru>
@ 2017-08-21 16:59     ` David Miller
  2017-08-21 17:03     ` Cong Wang
  1 sibling, 0 replies; 4+ messages in thread
From: David Miller @ 2017-08-21 16:59 UTC (permalink / raw)
  To: khlebnikov; +Cc: xiyou.wangcong, netdev, jiri


Emails encoded in HTML will be blocked by the list server, and quite frankly
I just outright delete all emails which I receive which are HTML encoded
as well.

Just FYI...

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] net_sched/hhf: update hierarchical backlog when drop packet
       [not found]   ` <16531503334617@webcorp01h.yandex-team.ru>
  2017-08-21 16:59     ` David Miller
@ 2017-08-21 17:03     ` Cong Wang
  1 sibling, 0 replies; 4+ messages in thread
From: Cong Wang @ 2017-08-21 17:03 UTC (permalink / raw)
  To: Konstantin Khlebnikov
  Cc: Linux Kernel Network Developers, David S. Miller, Jiri Pirko

On Mon, Aug 21, 2017 at 9:56 AM, Konstantin Khlebnikov
<khlebnikov@yandex-team.ru> wrote:
> Current packet wouldn't be counted by parent either. So queue length isn't
> changed.
>

But the qdisc_tree_reduce_backlog() right below uses 1 too:


        /* As we dropped a packet, better let upper stack know this. */
        qdisc_tree_reduce_backlog(sch, 1, prev_backlog - sch->qstats.backlog);
        return NET_XMIT_SUCCESS;

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-08-21 17:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-21  8:12 [PATCH] net_sched/hhf: update hierarchical backlog when drop packet Konstantin Khlebnikov
2017-08-21 16:52 ` Cong Wang
     [not found]   ` <16531503334617@webcorp01h.yandex-team.ru>
2017-08-21 16:59     ` David Miller
2017-08-21 17:03     ` Cong Wang

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.