netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Cong Wang <xiyou.wangcong@gmail.com>
Cc: netdev@vger.kernel.org, jhs@mojatatu.com, jiri@resnulli.us,
	victor@mojatatu.com, Gerrard Tai <gerrard.tai@starlabs.sg>
Subject: Re: [Patch net v2 05/11] sch_ets: make est_qlen_notify() idempotent
Date: Mon, 7 Apr 2025 13:14:09 +0100	[thread overview]
Message-ID: <20250407121409.GC395307@horms.kernel.org> (raw)
In-Reply-To: <20250403211033.166059-6-xiyou.wangcong@gmail.com>

On Thu, Apr 03, 2025 at 02:10:27PM -0700, Cong Wang wrote:
> est_qlen_notify() deletes its class from its active list with

nit: ets_class_qlen_notify()

> list_del() when qlen is 0, therefore, it is not idempotent and
> not friendly to its callers, like fq_codel_dequeue().
> 
> Let's make it idempotent to ease qdisc_tree_reduce_backlog() callers'
> life. Also change other list_del()'s to list_del_init() just to be
> extra safe.
> 
> Reported-by: Gerrard Tai <gerrard.tai@starlabs.sg>
> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
> ---
>  net/sched/sch_ets.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/net/sched/sch_ets.c b/net/sched/sch_ets.c
> index 516038a44163..c3bdeb14185b 100644
> --- a/net/sched/sch_ets.c
> +++ b/net/sched/sch_ets.c
> @@ -293,7 +293,7 @@ static void ets_class_qlen_notify(struct Qdisc *sch, unsigned long arg)
>  	 * to remove them.
>  	 */
>  	if (!ets_class_is_strict(q, cl) && sch->q.qlen)
> -		list_del(&cl->alist);
> +		list_del_init(&cl->alist);
>  }
>  
>  static int ets_class_dump(struct Qdisc *sch, unsigned long arg,
> @@ -488,7 +488,7 @@ static struct sk_buff *ets_qdisc_dequeue(struct Qdisc *sch)
>  			if (unlikely(!skb))
>  				goto out;
>  			if (cl->qdisc->q.qlen == 0)
> -				list_del(&cl->alist);
> +				list_del_init(&cl->alist);
>  			return ets_qdisc_dequeue_skb(sch, skb);
>  		}
>  
> @@ -657,7 +657,7 @@ static int ets_qdisc_change(struct Qdisc *sch, struct nlattr *opt,
>  	}
>  	for (i = q->nbands; i < oldbands; i++) {
>  		if (i >= q->nstrict && q->classes[i].qdisc->q.qlen)
> -			list_del(&q->classes[i].alist);
> +			list_del_init(&q->classes[i].alist);
>  		qdisc_tree_flush_backlog(q->classes[i].qdisc);
>  	}
>  	WRITE_ONCE(q->nstrict, nstrict);
> @@ -713,7 +713,7 @@ static void ets_qdisc_reset(struct Qdisc *sch)
>  
>  	for (band = q->nstrict; band < q->nbands; band++) {
>  		if (q->classes[band].qdisc->q.qlen)
> -			list_del(&q->classes[band].alist);
> +			list_del_init(&q->classes[band].alist);
>  	}
>  	for (band = 0; band < q->nbands; band++)
>  		qdisc_reset(q->classes[band].qdisc);
> -- 
> 2.34.1
> 
> 

  reply	other threads:[~2025-04-07 12:14 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-03 21:10 [Patch net v2 00/11] net_sched: make ->qlen_notify() idempotent Cong Wang
2025-04-03 21:10 ` [Patch net v2 01/11] sch_htb: make htb_qlen_notify() idempotent Cong Wang
2025-04-07 12:14   ` Simon Horman
2025-04-03 21:10 ` [Patch net v2 02/11] sch_drr: make drr_qlen_notify() idempotent Cong Wang
2025-04-07 12:15   ` Simon Horman
2025-04-03 21:10 ` [Patch net v2 03/11] sch_hfsc: make hfsc_qlen_notify() idempotent Cong Wang
2025-04-07 12:15   ` Simon Horman
2025-04-03 21:10 ` [Patch net v2 04/11] sch_qfq: make qfq_qlen_notify() idempotent Cong Wang
2025-04-07 12:15   ` Simon Horman
2025-04-03 21:10 ` [Patch net v2 05/11] sch_ets: make est_qlen_notify() idempotent Cong Wang
2025-04-07 12:14   ` Simon Horman [this message]
2025-04-03 21:16 ` [Patch net v2 06/11] codel: remove sch->q.qlen check before qdisc_tree_reduce_backlog() Cong Wang
2025-04-03 21:16   ` [Patch net v2 07/11] selftests/tc-testing: Add a test case for FQ_CODEL with HTB parent Cong Wang
2025-04-04 16:57     ` Victor Nogueira
2025-04-03 21:16   ` [Patch net v2 08/11] selftests/tc-testing: Add a test case for FQ_CODEL with QFQ parent Cong Wang
2025-04-04 16:58     ` Victor Nogueira
2025-04-03 21:16   ` [Patch net v2 09/11] selftests/tc-testing: Add a test case for FQ_CODEL with HFSC parent Cong Wang
2025-04-04 16:58     ` Victor Nogueira
2025-04-03 21:16   ` [Patch net v2 10/11] selftests/tc-testing: Add a test case for FQ_CODEL with DRR parent Cong Wang
2025-04-04 16:59     ` Victor Nogueira
2025-04-03 21:16   ` [Patch net v2 11/11] selftests/tc-testing: Add a test case for FQ_CODEL with ETS parent Cong Wang
2025-04-04 16:59     ` Victor Nogueira
2025-04-04 18:41       ` Jakub Kicinski
2025-04-04 19:03         ` Victor Nogueira
2025-04-07 20:09           ` Jakub Kicinski
2025-04-07 20:20             ` Victor Nogueira
2025-04-07 12:16   ` [Patch net v2 06/11] codel: remove sch->q.qlen check before qdisc_tree_reduce_backlog() Simon Horman
2025-04-07 20:35 ` [Patch net v2 00/11] net_sched: make ->qlen_notify() idempotent Jamal Hadi Salim
2025-04-08  9:01 ` Paolo Abeni
2025-04-08  9:10 ` patchwork-bot+netdevbpf

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=20250407121409.GC395307@horms.kernel.org \
    --to=horms@kernel.org \
    --cc=gerrard.tai@starlabs.sg \
    --cc=jhs@mojatatu.com \
    --cc=jiri@resnulli.us \
    --cc=netdev@vger.kernel.org \
    --cc=victor@mojatatu.com \
    --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 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).