-----Original Message----- From: Jakub Kicinski kuba@kernel.org Sent: Wednesday, July 9, 2025 2:31 AM To: Chia-Yu Chang (Nokia) chia-yu.chang@nokia-bell-labs.com Cc: Paolo Abeni pabeni@redhat.com; alok.a.tiwari@oracle.com; pctammela@mojatatu.com; horms@kernel.org; donald.hunter@gmail.com; xandfury@gmail.com; netdev@vger.kernel.org; dave.taht@gmail.com; jhs@mojatatu.com; stephen@networkplumber.org; xiyou.wangcong@gmail.com; jiri@resnulli.us; davem@davemloft.net; edumazet@google.com; andrew+netdev@lunn.ch; ast@fiberby.net; liuhangbin@gmail.com; shuah@kernel.org; linux-kselftest@vger.kernel.org; ij@kernel.org; ncardwell@google.com; Koen De Schepper (Nokia) koen.de_schepper@nokia-bell-labs.com; g.white@cablelabs.com; ingemar.s.johansson@ericsson.com; mirja.kuehlewind@ericsson.com; cheshire@apple.com; rs.ietf@gmx.at; Jason_Livingood@comcast.com; vidhi_goel@apple.com Subject: Re: [PATCH v21 net-next 1/6] sched: Struct definition and parsing of dualpi2 qdisc
CAUTION: This is an external email. Please be very careful when clicking links or opening attachments. See the URL nok.it/ext for additional information.
On Tue, 8 Jul 2025 20:22:23 +0000 Chia-Yu Chang (Nokia) wrote:
The original patch looks like below, and I see the option is mandatory otherwise it will return -EINVAL.
Is this what you mean in your comments or you mean other things?
if (!opt) {
NL_SET_ERR_MSG_MOD(extack, "Dualpi2 options are reuqired");
return -EINVAL;
}
To speed this up a bit across timezones -- I'm pretty sure what Paolo means is that you reject the situation where user provides no [TCA_OPTIONS] at the netlink level. But if the user provides an empty one its fine.
So normal config looks something like eg (indent means nesting):
[TCA_KIND] [TCA_OPTIONS] [TCA_DUALPI2_LIMIT] [TCA_DUALPI2_TARGET]
If there is no TCA_OPTIONS you'd error out:
[TCA_KIND]
But if TCA_OPTIONS is empty you dont:
[TCA_KIND] [TCA_OPTIONS]
Just return 0 instead of an error if TCA_OPTIONS is not there.
Thanks for clarification, then I will add one extra "int opt_flag = 0" and set the flag (e.g., opt_flag += 1 << TCA_DUALPI2_LIMIT).
At the end will return an error message if no flag is set, like below example:
if (!opt_flag) { sch_tree_unlock(sch); NL_SET_ERR_MSG_MOD(extack, "Dualpi2 options are empty"); return -EINVAL; }
Or is there any other suggested ways to do it, please let me know, thanks.