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 ACC3C28C024; Wed, 7 May 2025 19:12:08 +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=1746645128; cv=none; b=nJV03p1z1nqyyziB0me+xawgc5Yj9EyKYq0KMehCt3E227/KL88zTm08QMtQPCm5NQHahZsfwYpI1AFYTxwy455WmUheV9hgrMsfjdlXuW91qLuh7UkImWwl5CyYEJKcdDru5fX3hsS3Zp8uoyM5eHWOxBXj6fJdWEL1NZUyM2o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746645128; c=relaxed/simple; bh=EuImWDjYE3czbJ7hElb3ZGxEEmQZ6D2Qe2CRjiHuetY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=A+fJ+pV94DQOD0prQP7ygvJPd8CgnvNk0qSs+Gwqy2qyPYigpGOznywY14tOyDwhY/KgUpWqcozbssyGrdG3/77jQRu6ZIy41BqilnIJhGoq+iz8ChrLyfm79KHXCN+6/x15daFwQ+cCIhUq3GPy+AFZOrgkVa/BmVaFAEIu/i4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Ua06W8J9; 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="Ua06W8J9" Received: by smtp.kernel.org (Postfix) with ESMTPSA id F1456C4CEE2; Wed, 7 May 2025 19:12:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1746645128; bh=EuImWDjYE3czbJ7hElb3ZGxEEmQZ6D2Qe2CRjiHuetY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ua06W8J9xk362nw0JGtjGQF3R6uPcoq3wESHAK4IlzlDDyR5zainJXz7f8BRrg9cW AqBOHWVoUd6w5nsJufvWHXuk6F8aqgf93k5qPguMKMCP70fxHCoXX5ZAB0skotGF+0 QNqNqrq6LxSdem2hyuPb9nQcDjMMoIKyP/7FE2qk= 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 Subject: [PATCH 6.6 102/129] sch_qfq: make qfq_qlen_notify() idempotent Date: Wed, 7 May 2025 20:40:38 +0200 Message-ID: <20250507183817.632452736@linuxfoundation.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250507183813.500572371@linuxfoundation.org> References: <20250507183813.500572371@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 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Cong Wang commit 55f9eca4bfe30a15d8656f915922e8c98b7f0728 upstream. qfq_qlen_notify() always deletes its class from its active list with list_del_init() _and_ calls qfq_deactivate_agg() when the whole list becomes empty. To make it idempotent, just skip everything when it is not in the active list. 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-5-xiyou.wangcong@gmail.com Acked-by: Jamal Hadi Salim Signed-off-by: Paolo Abeni Signed-off-by: Greg Kroah-Hartman --- net/sched/sch_qfq.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) --- a/net/sched/sch_qfq.c +++ b/net/sched/sch_qfq.c @@ -352,7 +352,7 @@ static void qfq_deactivate_class(struct struct qfq_aggregate *agg = cl->agg; - list_del(&cl->alist); /* remove from RR queue of the aggregate */ + list_del_init(&cl->alist); /* remove from RR queue of the aggregate */ if (list_empty(&agg->active)) /* agg is now inactive */ qfq_deactivate_agg(q, agg); } @@ -482,6 +482,7 @@ static int qfq_change_class(struct Qdisc gnet_stats_basic_sync_init(&cl->bstats); cl->common.classid = classid; cl->deficit = lmax; + INIT_LIST_HEAD(&cl->alist); cl->qdisc = qdisc_create_dflt(sch->dev_queue, &pfifo_qdisc_ops, classid, NULL); @@ -990,7 +991,7 @@ static struct sk_buff *agg_dequeue(struc cl->deficit -= (int) len; if (cl->qdisc->q.qlen == 0) /* no more packets, remove from list */ - list_del(&cl->alist); + list_del_init(&cl->alist); else if (cl->deficit < qdisc_pkt_len(cl->qdisc->ops->peek(cl->qdisc))) { cl->deficit += agg->lmax; list_move_tail(&cl->alist, &agg->active); @@ -1421,6 +1422,8 @@ static void qfq_qlen_notify(struct Qdisc struct qfq_sched *q = qdisc_priv(sch); struct qfq_class *cl = (struct qfq_class *)arg; + if (list_empty(&cl->alist)) + return; qfq_deactivate_class(q, cl); }