From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 320D634AAFE; Tue, 26 Aug 2025 14:43:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756219422; cv=none; b=h1MHBZJf13yYbplhf9ggypkmc+2RDSJb3IVQLS0uevP6vWKwvx703LsGfLRx2lEryamdgvL9ODTQ8eCt8D0sygGKYnhNkCTNUNXTpmSxU+oTjAFfRweue5pHbBD/KjcLlhgj7e30XEmf1U264cRuc7EGN7Rj07Ppo1l3c4tgvKc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756219422; c=relaxed/simple; bh=dty5BJVgPNX3XCLNf0em9eH1JtgGDhNxFyy/65lX4ic=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DYTlwJ/zXYRBsCyeZZVUzkUBQva2/3TAziXn/f0NJ+QNIeDTB6xXVH5PplVVVBvUdrTaUZ9u9xt8IiuphVP+9Of6PtnXoqfS6Jv9s4dEb3/ZWGK1SRR5nK3jJM9A6vpphwupBtItkjZqGSb2/EYgYOMykyDUlFYCCTM4AjPESw0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=yRrdO3LC; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="yRrdO3LC" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B29D3C4CEF1; Tue, 26 Aug 2025 14:43:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1756219422; bh=dty5BJVgPNX3XCLNf0em9eH1JtgGDhNxFyy/65lX4ic=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yRrdO3LCtROpKn2NCltGDqeEyV/XBu71BJHzogOz4ZWyPs0SvQfg3WpUdFgB1TihA HGZzrEhtcQaFNdOY8SYWFaPv+fhhkQrkMLFf1PjKv/sILnsYnVVvE8Wj+SPgf8RwLx X6XsojUm4z2ktqMeVRNAwn7931jOznyaDL/SKoy0= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Gerrard Tai , Cong Wang , Simon Horman , Jamal Hadi Salim , Paolo Abeni , Siddh Raman Pant Subject: [PATCH 5.4 375/403] sch_drr: make drr_qlen_notify() idempotent Date: Tue, 26 Aug 2025 13:11:41 +0200 Message-ID: <20250826110917.376315395@linuxfoundation.org> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250826110905.607690791@linuxfoundation.org> References: <20250826110905.607690791@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Cong Wang commit df008598b3a00be02a8051fde89ca0fbc416bd55 upstream. drr_qlen_notify() always deletes the DRR class from its active list with list_del(), 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 Signed-off-by: Cong Wang Reviewed-by: Simon Horman Link: https://patch.msgid.link/20250403211033.166059-3-xiyou.wangcong@gmail.com Acked-by: Jamal Hadi Salim Signed-off-by: Paolo Abeni Signed-off-by: Siddh Raman Pant Signed-off-by: Greg Kroah-Hartman --- net/sched/sch_drr.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) --- a/net/sched/sch_drr.c +++ b/net/sched/sch_drr.c @@ -111,6 +111,7 @@ static int drr_change_class(struct Qdisc if (cl == NULL) return -ENOBUFS; + INIT_LIST_HEAD(&cl->alist); cl->common.classid = classid; cl->quantum = quantum; cl->qdisc = qdisc_create_dflt(sch->dev_queue, @@ -234,7 +235,7 @@ static void drr_qlen_notify(struct Qdisc { struct drr_class *cl = (struct drr_class *)arg; - list_del(&cl->alist); + list_del_init(&cl->alist); } static int drr_dump_class(struct Qdisc *sch, unsigned long arg, @@ -401,7 +402,7 @@ static struct sk_buff *drr_dequeue(struc if (unlikely(skb == NULL)) goto out; if (cl->qdisc->q.qlen == 0) - list_del(&cl->alist); + list_del_init(&cl->alist); bstats_update(&cl->bstats, skb); qdisc_bstats_update(sch, skb); @@ -442,7 +443,7 @@ static void drr_reset_qdisc(struct Qdisc for (i = 0; i < q->clhash.hashsize; i++) { hlist_for_each_entry(cl, &q->clhash.hash[i], common.hnode) { if (cl->qdisc->q.qlen) - list_del(&cl->alist); + list_del_init(&cl->alist); qdisc_reset(cl->qdisc); } }