From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796498265; b=4cqgPRpbIUtOohfw7bBVQcHytlIP0hJEz7cvke30WaYWi8dulXyA8TH6C1gm5qzbjXfm DNW0onjAEhvflHR0lnTBggd89I7MIQPgx9GQFjwTgSuPYrinLXaIg/zCmKDF6nBbrjTSe dX32v+IiwZS18lSc2sonAFnxg89KXbPc6rZ+N5SblJ1QYzEDyCtaTW6YYMGbCgoZQDS1p zfGHiUy7sVm/sjBJCtmuMEZTXMqTtpV8QqY4OjSlvd/tyOWTqUd3vUHIIULCZGc1BnVXB v4p20MVMC5/z8IppZHmjyoVVWofT1dS7NveDVvOsz2H2t8sYMuYFZmSDaRPCNdNvrJA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796498265; 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=FrRCwzic3ossuCoyQR6QIAAuGdAW01Qd9CK6QLAEcgY=; b=Y0g8Rc8P+ynovx6Aaq3HK57uBurmGSJzs7iehnR63TDsWW7omCNt72RxJmubU1I9pSd6 U5q88zTowXKVgFpl/oGdM+givNh+vhhdk1EsFsIHON40wUFY2fkAxsU7QZ826BagXfO2A Zr3/3xwF3mwVOknSFoCGUYCLDmbmVbIQN1/MySvOkfWt7HKYZNyhKhQVcBpFrVNZ3fDOc QEIXdzjOWTcB+pjoMpBkqo9Od4Y9DyA+Uypg+gAjYrpmIuPTnG/J5HQUiLV/AXBEFswRr Zdt/wPrleRtPhMbka+DLlwVe7dxNbTENg08mQwnIFHUxun6No+NtrJBuDR7Gw2bPeNA== 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=VLBKoqL6; arc=none smtp.remote-ip=100.103.45.18 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 1EE24606A333; Sat, 5 Dec 2026 19:17:45 +0000 (UTC) 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=VLBKoqL6 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0AF441F00A12; Sat, 5 Dec 2026 19:17:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796498265; bh=FrRCwzic3ossuCoyQR6QIAAuGdAW01Qd9CK6QLAEcgY=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=VLBKoqL667ZFltmTChHQs+aRhJOxUZjLEBpk7CMLh9vyGxjVpo0j3pIYF/0DmviNy OHavdO1nPwRqnzi/adDKcq7NxlgCHDAXda3eqMGX5t3aSyLdWl6zVateIPIczlXc36 qCXWmYI1L4XCmXFhK8REFJCyyFW3WgQUhnPP1o+gcJH//TwT3Sh9AtWD7uutOjcqvS 5n7QxfuYBipVhqJ60EkCZ4lXiIaolG2B57DiM11Qp93YjcjB26RL72rl1Vp7N/rXbF +Rkss4iV87OwxrF7xOiz5LRL1DFKn9INHRbmF264v8WQ0i+2lU5QeawPniy0GgU8br z+3WQvm50IeIQ== Subject: Re: [PATCH net-next v11 4/4] Documentation/netlink/specs: tc: describe fq_pie per-flow class stats From: netdev-bot+sashiko@kernel.org To: hemendranaik@gmail.com 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 Date: Sat, 05 Dec 2026 19:17:43 +0000 Message-ID: <179649826362.3148.7609035964951816843@kernel.org> In-Reply-To: <20261204190143.633361-5-hemendranaik@gmail.com> References: <20261204190143.633361-5-hemendranaik@gmail.com> X-sashiko-severity: Medium Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider. Critical: 0 · High: 0 · Medium: 1 · Low: 0 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] The spec now describes the fq_pie xstats fixed header as 64 bytes. -- 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. It also extends the tc-fq-pie-xstats fixed header with a type discriminator and a class-stats member, and corrects the units in the tc-pie-xstats member docs. > diff --git a/Documentation/netlink/specs/tc.yaml b/Documentation/netlink/specs/tc.yaml > index b6ccc645b0e33..ff71042e31c15 100644 > --- a/Documentation/netlink/specs/tc.yaml > +++ b/Documentation/netlink/specs/tc.yaml [ ... ] > @@ -901,39 +926,48 @@ definitions: [ ... ] > - > name: memory-usage > type: u32 > - doc: Total memory across all queues > + doc: Total memory across all queues (qdisc dumps only) > + - > + name: type > + type: u32 > + doc: TCA_FQ_PIE_XSTATS_QDISC (0) or TCA_FQ_PIE_XSTATS_CLASS (1) > + - > + 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] With these two members appended, the fq_pie fixed header described by the spec grows from 36 bytes to 64 bytes. Kernels without the earlier change in this series, "net/sched: sch_fq_pie: add per-flow statistics via class ops", still send the 36-byte struct tc_fq_pie_xstats (nine __u32 counters) from fq_pie_dump_stats(): gnet_stats_copy_app(d, &st, sizeof(st)); Can the in-tree YNL decoder handle that shorter payload? The fq_pie entry in tca-stats-app-msg maps to fixed-header tc-fq-pie-xstats. YnlFamily._decode_sub_msg() therefore calls _decode_struct() on the TCA_XSTATS and TCA_STATS_APP payloads, and _decode_struct() in tools/net/ynl/pyynl/lib/ynl.py walks every member without checking len(data): format_ = NlAttr.get_format(m.type, m.byte_order) [ value ] = format_.unpack_from(data, offset) offset += format_.size For the new type member this becomes unpack_from(data, 36) on a 36-byte buffer, which raises struct.error. Nothing in the decode path catches it. As a result, something like: cli.py --spec Documentation/netlink/specs/tc.yaml --dump getqdisc run against an older kernel with an fq_pie qdisc configured would fail to decode the whole message. Before this patch it decoded the nine legacy counters correctly. tc-fq-qd-stats seems to have the same limitation, since it lists members that older kernels lack. This patch adds a new instance of it for fq_pie, though. Could _decode_struct() stop at the end of the available data, or could the spec stay decodable for the legacy 36-byte layout in some other way? [ ... ] -- Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261204190143.633361-1-hemendranaik%40gmail.com