* [PATCH] net: sched: fix ordering of qlen adjustment
@ 2024-12-02 16:22 Lion Ackermann
2024-12-03 8:48 ` Toke Høiland-Jørgensen
2024-12-04 13:00 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Lion Ackermann @ 2024-12-02 16:22 UTC (permalink / raw)
To: netdev
Cc: toke, jhs, xiyou.wangcong, jiri, davem, edumazet, kuba, pabeni,
nnamrec
Changes to sch->q.qlen around qdisc_tree_reduce_backlog() need to happen
_before_ a call to said function because otherwise it may fail to notify
parent qdiscs when the child is about to become empty.
Signed-off-by: Lion Ackermann <nnamrec@gmail.com>
---
net/sched/sch_cake.c | 2 +-
net/sched/sch_choke.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/sched/sch_cake.c b/net/sched/sch_cake.c
index 30955dd45779..a65fad45d556 100644
--- a/net/sched/sch_cake.c
+++ b/net/sched/sch_cake.c
@@ -1542,7 +1542,6 @@ static unsigned int cake_drop(struct Qdisc *sch, struct sk_buff **to_free)
b->backlogs[idx] -= len;
b->tin_backlog -= len;
sch->qstats.backlog -= len;
- qdisc_tree_reduce_backlog(sch, 1, len);
flow->dropped++;
b->tin_dropped++;
@@ -1553,6 +1552,7 @@ static unsigned int cake_drop(struct Qdisc *sch, struct sk_buff **to_free)
__qdisc_drop(skb, to_free);
sch->q.qlen--;
+ qdisc_tree_reduce_backlog(sch, 1, len);
cake_heapify(q, 0);
diff --git a/net/sched/sch_choke.c b/net/sched/sch_choke.c
index 19c851125901..a91959142208 100644
--- a/net/sched/sch_choke.c
+++ b/net/sched/sch_choke.c
@@ -123,10 +123,10 @@ static void choke_drop_by_idx(struct Qdisc *sch, unsigned int idx,
if (idx == q->tail)
choke_zap_tail_holes(q);
+ --sch->q.qlen;
qdisc_qstats_backlog_dec(sch, skb);
qdisc_tree_reduce_backlog(sch, 1, qdisc_pkt_len(skb));
qdisc_drop(skb, sch, to_free);
- --sch->q.qlen;
}
struct choke_skb_cb {
--
2.47.0
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] net: sched: fix ordering of qlen adjustment
2024-12-02 16:22 [PATCH] net: sched: fix ordering of qlen adjustment Lion Ackermann
@ 2024-12-03 8:48 ` Toke Høiland-Jørgensen
2024-12-04 13:00 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Toke Høiland-Jørgensen @ 2024-12-03 8:48 UTC (permalink / raw)
To: Lion Ackermann, netdev
Cc: jhs, xiyou.wangcong, jiri, davem, edumazet, kuba, pabeni, nnamrec
Lion Ackermann <nnamrec@gmail.com> writes:
> Changes to sch->q.qlen around qdisc_tree_reduce_backlog() need to happen
> _before_ a call to said function because otherwise it may fail to notify
> parent qdiscs when the child is about to become empty.
>
> Signed-off-by: Lion Ackermann <nnamrec@gmail.com>
For sch_cake:
Acked-by: Toke Høiland-Jørgensen <toke@toke.dk>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] net: sched: fix ordering of qlen adjustment
2024-12-02 16:22 [PATCH] net: sched: fix ordering of qlen adjustment Lion Ackermann
2024-12-03 8:48 ` Toke Høiland-Jørgensen
@ 2024-12-04 13:00 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-12-04 13:00 UTC (permalink / raw)
To: Lion Ackermann
Cc: netdev, toke, jhs, xiyou.wangcong, jiri, davem, edumazet, kuba,
pabeni
Hello:
This patch was applied to netdev/net.git (main)
by David S. Miller <davem@davemloft.net>:
On Mon, 2 Dec 2024 17:22:57 +0100 you wrote:
> Changes to sch->q.qlen around qdisc_tree_reduce_backlog() need to happen
> _before_ a call to said function because otherwise it may fail to notify
> parent qdiscs when the child is about to become empty.
>
> Signed-off-by: Lion Ackermann <nnamrec@gmail.com>
> ---
> net/sched/sch_cake.c | 2 +-
> net/sched/sch_choke.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
Here is the summary with links:
- net: sched: fix ordering of qlen adjustment
https://git.kernel.org/netdev/net/c/5eb7de8cd58e
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-12-04 13:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-02 16:22 [PATCH] net: sched: fix ordering of qlen adjustment Lion Ackermann
2024-12-03 8:48 ` Toke Høiland-Jørgensen
2024-12-04 13:00 ` patchwork-bot+netdevbpf
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).