From: "Hemendra M. Naik" <hemendranaik@gmail.com>
To: stephen@networkplumber.org
Cc: davem@davemloft.net, edumazet@google.com, hemendranaik@gmail.com,
horms@kernel.org, jhs@mojatatu.com, jiri@resnulli.us,
kuba@kernel.org, linux-kernel@vger.kernel.org,
linux-kselftest@vger.kernel.org, netdev@vger.kernel.org,
pabeni@redhat.com, shuah@kernel.org, tahiliani@nitk.edu.in,
vishy0777@gmail.com
Subject: Re: [PATCH net-next 1/2] net/sched: sch_fq_pie: add per-flow statistics via class ops
Date: Sat, 6 Jun 2026 13:14:32 +0530 [thread overview]
Message-ID: <20260606074432.22005-1-hemendranaik@gmail.com> (raw)
In-Reply-To: <20260531154149.592bb35f@phoenix.local>
On Sun, 31 May 2026 15:41:49 -0700, Stephen Hemminger wrote:
> Sorry, you can't change the kernel/userspace ABI like this.
> How will old iproute2 handle new kernel and vice/versa.
>
> The better safer way to do this is to either extend the
> existing structure and have iproute2 know how how to handle
> short (missing) class data; or use another netlink
> type for class data.
Hello Stephen,
Apologies for breaking the ABI.
We've been working on two fixes along the lines of what you suggested.
Approach #1
Append type and the union after the original 9 fields rather than
inserting them at the front:
struct tc_fq_pie_xstats {
__u32 packets_in; /* offset 0, untouched */
...
__u32 memory_usage; /* offset 32, untouched */
__u32 type; /* offset 36, new */
```
union {
struct tc_fq_pie_cl_stats class_stats;
struct tc_fq_pie_xqd_stats xqdisc_stats;
};
```
};
tc_fq_pie_xqd_stats is currently empty. It acts as a placeholder for
future qdisc stats if needed.
With this layout, older iproute2 versions receiving the new 64-byte
blob still see RTA_PAYLOAD(64) >= sizeof(36) and read the original
fields correctly since offsets 0-35 remain unchanged.
Conversely, newer iproute2 versions receiving the old 36-byte blob
take the memcpy path into a zeroed local struct, type defaults to 0
(QDISC), and execution falls back to the qdisc stats path.
Approach #2
Leave struct tc_fq_pie_xstats unchanged and export class stats
separately as an NLA blob via gnet_stats_copy_app():
enum {
TCA_FQ_PIE_XSTATS_UNSPEC,
TCA_FQ_PIE_XSTATS_TYPE,
TCA_FQ_PIE_XSTATS_CL_PROB,
TCA_FQ_PIE_XSTATS_CL_DELAY,
TCA_FQ_PIE_XSTATS_CL_AVG_DQ_RATE,
...
};
Adding any new stat, class or qdisc, is just a new enum entry and one
nla_put() call. Old iproute2 sees an unknown TYPE and skips it
gracefully via the default case. No struct versioning, no size math.
Let us know which approach you'd prefer, or if there's another
approach you think would work better, and we'll send a revised patch
accordingly.
Thanks,
Hemendra
next prev parent reply other threads:[~2026-06-06 7:45 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-31 12:53 [PATCH net-next 0/2] net/sched: sch_fq_pie: add per-flow class statistics Hemendra M. Naik
2026-05-31 12:53 ` [PATCH net-next 1/2] net/sched: sch_fq_pie: add per-flow statistics via class ops Hemendra M. Naik
2026-05-31 22:41 ` Stephen Hemminger
2026-06-06 7:44 ` Hemendra M. Naik [this message]
2026-05-31 12:53 ` [PATCH net-next 2/2] selftests: tc-testing: add fq_pie per-flow class stats test Hemendra M. Naik
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260606074432.22005-1-hemendranaik@gmail.com \
--to=hemendranaik@gmail.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=jhs@mojatatu.com \
--cc=jiri@resnulli.us \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=shuah@kernel.org \
--cc=stephen@networkplumber.org \
--cc=tahiliani@nitk.edu.in \
--cc=vishy0777@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox