🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #14658

Re: [PATCH net-next v10 4/4] Documentation/netlink/specs: tc: describe fq_pie per-flow class stats

#14658
From: netdev-bot+sashiko
Date: Wed, 11 Nov 2026 19:11
143 lines
13395 bytes
Thank you for your contribution! Sashiko AI review found 3 potential
issue(s) to consider.

Critical: 0 · High: 0 · Medium: 1 · Low: 2

If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).

- [Medium] This patch appends `type` (u32) and `class-stats` (binary,
  struct tc-fq-pie-cl-stats, 24 bytes) to the `tc-fq-pie-xstats` fixed…
- [Low] The commit message names one of the five fields "fq-rate-
  estimating".
- [Low] The new spec docs leave out how to interpret the fq_pie xstats
  payload, which now has two meanings.

--

Documentation/netlink/specs: tc: describe fq_pie per-flow class stats

This commit adds a tc-fq-pie-cl-stats struct to the tc netlink spec. The
struct describes the fq_pie per-flow class stats. The commit also extends
the tc-fq-pie-xstats fixed header with a type discriminator and a
class-stats member placed after the nine legacy qdisc counters.

> Add the tc-fq-pie-cl-stats header for fq_pie per flow (class) stats in Documentation/netlink/specs/tc.yaml
> with its five fields: prob, delay, deficit, avg-dq-rate, fq-rate-estimating.

[Severity: Low]
Should the fifth field be dq-rate-estimating rather than fq-rate-estimating?

The member this patch adds is dq-rate-estimating. The UAPI field is
dq_rate_estimating in struct tc_fq_pie_cl_stats, and
fq_pie_dump_class_stats() fills xstats.class_stats.dq_rate_estimating.

Two smaller points: the body lines are longer than 75 columns, and the
new struct is called a "header".

> diff --git a/Documentation/netlink/specs/tc.yaml b/Documentation/netlink/specs/tc.yaml
> index b6ccc645b0e33..b159c4b563c7a 100644
> --- a/Documentation/netlink/specs/tc.yaml
> +++ b/Documentation/netlink/specs/tc.yaml
> @@ -894,6 +894,30 @@ definitions:
>          name: memory-limit
>          type: u32
>          doc: Memory limit in bytes
> +  -
> +    name: tc-fq-pie-cl-stats
> +    type: struct
> +    members:
> +      -
> +        name: prob
> +        type: u64
> +        doc: Current drop probability of the flow

[ ... ]

> @@ -934,6 +958,15 @@ definitions:
>          name: memory-usage
>          type: u32
>          doc: Total memory across all queues
> +      -
> +        name: type
> +        type: u32
> +        doc: TCA_FQ_PIE_XSTATS_QDISC (0) or TCA_FQ_PIE_XSTATS_CLASS (1)

[Severity: Low]
Should the spec say which members are valid for each type value? Neither
this doc nor the existing docs for packets-in through memory-usage do.

fq_pie_dump_class_stats() zeroes the whole struct and fills only
class_stats:

net/sched/sch_fq_pie.c:fq_pie_dump_class_stats() {
    ...
		memset(&xstats, 0, sizeof(xstats));
		xstats.type = TCA_FQ_PIE_XSTATS_CLASS;
		xstats.class_stats.prob =
			READ_ONCE(flow->vars.prob) << BITS_PER_BYTE;
    ...
}

fq_pie_dump_stats() does the opposite. It sets type to
TCA_FQ_PIE_XSTATS_QDISC and leaves class_stats zeroed.

tca-stats-app-msg maps fq_pie to this one fixed header for both qdisc
and class messages, so YNL decodes and prints every member in both
cases. A class dump will show packets-in: 0, dropped: 0 and so on.

Could the docs note that the legacy counters only apply when type is
TCA_FQ_PIE_XSTATS_QDISC, and class-stats only when it is
TCA_FQ_PIE_XSTATS_CLASS?

The prob doc in tc-fq-pie-cl-stats also just says "Current drop
probability of the flow". Because of the << BITS_PER_BYTE above, the
value is a fixed-point fraction where U64_MAX means 100%. Can the doc
state that scale? The existing tc-pie-xstats prob doc doesn't give a
scale either.

> +      -
> +        name: class-stats
> +        type: binary
> +        struct: tc-fq-pie-cl-stats
> +        doc: Class statistics of a particular flow (invoked via tc class show)

[Severity: Medium]
Does this break YNL decoding against kernels from before the per-flow
stats change?

Adding type and class-stats makes YNL compute tc-fq-pie-xstats as 64
bytes. Older kernels send a 36-byte TCA_STATS_APP payload for fq_pie:
nine __u32 counters, copied with sizeof(st) in fq_pie_dump_stats().

The fq_pie entry in tca-stats-app-msg only has
fixed-header: tc-fq-pie-xstats. So _decode_sub_msg() passes attr.raw
directly to _decode_struct(), and _decode_struct() does not check the
remaining length:

tools/net/ynl/pyynl/lib/ynl.py:_decode_struct() {
    ...
            else:
                format_ = NlAttr.get_format(m.type, m.byte_order)
                [ value ] = format_.unpack_from(data, offset)
                offset += format_.size
    ...
}

The type member sits at offset 36. On a 36-byte buffer, unpack_from()
raises struct.error, and nothing in ynl.py catches it.

So with the updated spec, a getqdisc stats dump on an older kernel with
an fq_pie qdisc configured fails to decode.

The previous 36-byte definition worked with both old kernels (exact fit)
and new ones (trailing bytes ignored). Could _decode_struct() handle
short payloads, or could the spec be changed in some other way so it
still decodes against older kernels?

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261109071017.438478-1-hemendranaik%40gmail.com
Technical Details
Message-ID: <179442431519.2199510.8426788814997312828@kernel.org>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-361240-linux-kernel-netdev=dewy.ru
References: <20261109071017.438478-5-hemendranaik@gmail.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-361240-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v10 4/4] Documentation/netlink/specs: tc:
 describe fq_pie per-flow class stats
Date: Wed, 11 Nov 2026 19:11:55 +0000
Organization: Usenet Network
Message-ID: <179442431519.2199510.8426788814997312828@kernel.org>
References: <20261109071017.438478-5-hemendranaik@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="920064"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:DHRVzE9fpZcT7U33xDROcg+a3Lg= sha256:oZe1omCpc14zzLfsJuqpKuQ6fTdasQq/+Fk/GOr0awk=
	sha1:7oOCzGpuiacgF+tl3AZ9nCrJgfQ= sha256:TSYqNjfO3mYnvE0hnHJ+XNsp6hy+c2KwZXeJQ4Mlj/o=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 0DBBB113F9D; Wed, 11 Nov 2026 22:15:01 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.501
X-Spam-Status: No, score=-3.501 tagged_above=-9999 required=6.31
	tests=[DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1,
	RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001]
	autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=kernel.org
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id iKX37ojwUQMc;
	Wed, 11 Nov 2026 22:14:56 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-361240-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74])
	by mail.dewy.ru (Postfix) with ESMTPS id 1DA27113F92; Wed, 11 Nov 2026 22:14:48 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sto.lore.kernel.org (Postfix) with ESMTP id 272CB6244D0; Wed, 11 Nov 2026 19:12:21 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1794424317;
	b=KEeizA1TRxsnm86Z9XyvQA4am5/pfVruSZDD0Fryb4/1YKwdN37DFRXdmak2jwSFXipK
	 vYGDuGTDO6i099N2+t8KD2Vipx57wTRm+o+VUlO29CZ+nnIuzOaTnzUDMPGMCzHlul3iO
	 9BNj3lMPTLmt5/KKgZIahPz2vj7sBKLukEJNjvZdaMYt2+S18sduH7RCr271mRcf+aCwu
	 MlIu/GNFWVqjfi/afmiiFK2B4k+WUqHjb1grzJpZP+0N+zCCqqQX/32H72xlEpISIxjm0
	 92WbKXS/FU5mGVlL4ZN99tpU8CptfVBuc/iz0WMiUf8NkS1PgTbvOZc4jr+3ER6I3Fw==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794424317;
	h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc:
	 Date:Message-ID:In-Reply-To:References:X-sashiko-severity:
	 Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id:
	 List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
	 Precedence:MIME-Version;
	bh=V+6WZHCRtJF3EdEXXqVZ/AebE53HIs1Rd0AeGRHLVjw=;
	b=eGl2PTUQrnD8bS1fBz5VDjY6cwmJRz1Vb1BezfsnrSJCbW06oEeYkJ2qVeMUYe5zl/k0
	 M34r0iJ+jH5cit7hQRVGOSgtFLs6cjrfk6CUycRx5Di3sqRhqU3+Fc5lxxh8qLGo+OuMq
	 +2rCsd1HvU5Rc9MS9wK+9OmYi2xuXv6znSSVK/ykeboCnf81l+/x9O2g6k8h1WHul41R9
	 Bdyl9RiOfZ1VnOFXlN7j5fAgoANtvud5xjD/pwgSJCBqr6pe5y2br+3i74+UEfqMRicbo
	 5OVSErnANnNXIon3WgpkftAJ0x2rtua0lfqMTaWQHlS3MH90JI7vrns305ehsQwMqfg==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=X0Sf6r3k;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 85A95606A8B4;
	Wed, 11 Nov 2026 19:11:57 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=X0Sf6r3k
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1794424316;
	b=H256oMgvbaR+naSZnWf8FPjpNrZjYhosC7uB9TA92v6XU9YlECegY2fdfmZIxKVcgHoo
	 tiexiLk7efgopDvfNHwHOpL+7+rDC2QUXQP9w+vZroRLKqyDWjGfIVZBxFdXDbRF2/m8j
	 9Dw1Y2yt89tFMd+u0UcV5KmQMeTLfXu39y1AfG+svf0QVIeXpgJKmLXKOeLkR35KmkEUB
	 A5GaP29faNup4Iuql/Xv7ir7RcOKUFpU5i07GkjShBmCTNZk7BNu8jphOBGNhWorK21v8
	 0tt2JqXqF6oTnvV01GZM9xHU/9HDhvxCq/YYuOr2dRiTox2dx6t4J9mFIDgLT786gUw==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794424316;
	h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID:
	 In-Reply-To:References:X-sashiko-severity:Content-Type:
	 Content-Transfer-Encoding:MIME-Version;
	bh=V+6WZHCRtJF3EdEXXqVZ/AebE53HIs1Rd0AeGRHLVjw=;
	b=42qXR+EqdNHrMD7jVj6TE4cZLpfwMa2ndOQgXosooP9GCfSiG6exSFM/tc4uIhFDOzg4
	 QSJ72WO0SnYpfeSET4KjNNIxpigF3Wzw58THk3ImLhgmDU0WpE/0k8xu1SBy7ZexkHhTE
	 xo6BFYkLw2T90d9LpAMpGVwTs9PKSVlQxeREcvljRinv1oaLK1X5VKaZxHTfoA33hrc93
	 mMvvCOMJxGPSfkUl6HlhccV9vjJ9MBkInZJJmbHzeuSvNTv4W5GbwPeUCw6oIQUT/pGOD
	 v7Cl3yx2F+2M2/NrWhbzBtkhX/ItYQLd05reWJu+pr5gkkOJKIQUqlnVX1ZPR3OOe7A==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=X0Sf6r3k;
	arc=none smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id A510F606A8A5;
	Wed, 11 Nov 2026 19:11:56 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 954451F00A0F;
	Wed, 11 Nov 2026 19:11:55 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1794424316;
	bh=V+6WZHCRtJF3EdEXXqVZ/AebE53HIs1Rd0AeGRHLVjw=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=X0Sf6r3kbjnaBzI71fNu/ftDEhVZZgXNEoIYKBoTBL9uIGr+PLZwNQYpJaSerKtLz
	 huN6et3TylS6rLj6/bdJDdTzKNvTxqBqF5CA5+A8PEUHULKwntNLhhvzmdUMutIiiE
	 WXQWtNOiaQq0sE0HzBz34wHRM5oi/vBZzkHxxb+6oZym5uFAfOEbVJrMwuM3XNirZZ
	 s4DM2FyJPs2BwLP1Mg2O4fXGSHsZl/8WG0rGUDd5e5D8MRNR+hGoKS0M+auviFer52
	 5HBFy/eaUiZX4qmfv2pFmeahVooRJZk0v21erXRAIgUvcAJbdm6awBXZVjyKg3NxyG
	 NYL4icGP8H4lA==
X-Cc: netdev@vger.kernel.org, davem@davemloft.net, edumazet@kernel.org,
 kuba@kernel.org, pabeni@redhat.com, horms@kernel.org, jiri@resnulli.us,
 jhs@mojatatu.com, shuah@kernel.org, donald.hunter@gmail.com, ast@fiberby.net,
 toke@redhat.com, liuhangbin@kylinos.cn, j.koeppeler@tu-berlin.de,
 linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
 vishy0777@gmail.com, tahiliani@nitk.edu.in
X-In-Reply-To: <20261109071017.438478-5-hemendranaik@gmail.com>
X-sashiko-severity: Medium
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list