From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 86CDD265606; Tue, 21 Jul 2026 19:46:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784663182; cv=none; b=geglNePmI3lL8w7vcBv7yJXcV+R+SmJu9R72BTLEEbjTGIJZ/2QnVDm7PRsFB+1MaIH7OPcFRTkQS7n1UXk6ti6R7ELuse7HkfzKVP6hhMYrHKO3ZYHXpBaJODUvoo2Kv4VnXEu8p05I5byNdmc3YCaeaWIII4IoHsX4mcETCLI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784663182; c=relaxed/simple; bh=QfoxwdVsDKAPz9eAj2ZDA8WfAQlpjbbZ0JoqE2+MLoI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=gXqxsicMU9BP8KN41FYSE60B3yEDHwIxI/oO5ld2OhG+iFd1RZnO31eS63uVQbn0tVk4gphcEcomy3sXDBFr4SefxMGyuHSNymAf0Af9x17QCQLgojPMO/pMmcMf13vJZgTHCptcFmgq52xcAeTIb/znE0cGNk/w/VtVL8ngGTU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=kMroAAl0; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="kMroAAl0" Received: by smtp.kernel.org (Postfix) with ESMTPSA id ECFA61F000E9; Tue, 21 Jul 2026 19:46:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1784663181; bh=t1tpqPV3zBs51nvucNRIvy2f4QfZvXX9qQULjWyeaoQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=kMroAAl0Zs0DILCEpR4WMSfomqrE6TU5FFcHOmMZYov1Lj0bLcMHpnAD4XU+S/kal qN1En3+1hU84q/Zy52ifjlpxT0Dxqh1x6SqDgO9mAEZS0JwylIEo7BzV4GNoy5/zYs bUvTrQblg62JOKhcyf6wJ2anpFZwqavG/jvNUkCQ= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Samuel Moelius , "David S. Miller" , Sasha Levin Subject: [PATCH 6.12 0725/1276] net/sched: hhf: clear heavy-hitter state on reset Date: Tue, 21 Jul 2026 17:19:28 +0200 Message-ID: <20260721152502.311929945@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260721152446.065700225@linuxfoundation.org> References: <20260721152446.065700225@linuxfoundation.org> User-Agent: quilt/0.69 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.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Samuel Moelius [ Upstream commit a225f8c20712713406ae47024b8df42deacddd4a ] HHF reset does not clear the classifier state used to identify heavy hitters. Packets after reset can therefore be scheduled using flow history from before the reset. The reset operation should return the qdisc to an empty state. Clear the heavy-hitter classifier tables when HHF is reset. Fixes: 10239edf86f1 ("net-qdisc-hhf: Heavy-Hitter Filter (HHF) qdisc") Assisted-by: Codex:gpt-5.5-cyber-preview Signed-off-by: Samuel Moelius Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- net/sched/sch_hhf.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/net/sched/sch_hhf.c b/net/sched/sch_hhf.c index 914e9854277442..f9d2cf7533faa2 100644 --- a/net/sched/sch_hhf.c +++ b/net/sched/sch_hhf.c @@ -461,12 +461,39 @@ static struct sk_buff *hhf_dequeue(struct Qdisc *sch) return skb; } +static void hhf_reset_classifier(struct hhf_sched_data *q) +{ + int i; + + if (!q->hh_flows) + return; + + for (i = 0; i < HH_FLOWS_CNT; i++) { + struct hh_flow_state *flow, *next; + struct list_head *head = &q->hh_flows[i]; + + list_for_each_entry_safe(flow, next, head, flowchain) { + list_del(&flow->flowchain); + kfree(flow); + } + } + WRITE_ONCE(q->hh_flows_current_cnt, 0); + + for (i = 0; i < HHF_ARRAYS_CNT; i++) { + if (q->hhf_valid_bits[i]) + bitmap_zero(q->hhf_valid_bits[i], HHF_ARRAYS_LEN); + } + q->hhf_arrays_reset_timestamp = hhf_time_stamp(); +} + static void hhf_reset(struct Qdisc *sch) { + struct hhf_sched_data *q = qdisc_priv(sch); struct sk_buff *skb; while ((skb = hhf_dequeue(sch)) != NULL) rtnl_kfree_skbs(skb, skb); + hhf_reset_classifier(q); } static void hhf_destroy(struct Qdisc *sch) -- 2.53.0