-----Original Message----- From: David Ahern dsahern@kernel.org Sent: Wednesday, July 30, 2025 1:45 AM To: Chia-Yu Chang (Nokia) chia-yu.chang@nokia-bell-labs.com; alok.a.tiwari@oracle.com; donald.hunter@gmail.com; xandfury@gmail.com; netdev@vger.kernel.org; dave.taht@gmail.com; pabeni@redhat.com; jhs@mojatatu.com; kuba@kernel.org; stephen@networkplumber.org; xiyou.wangcong@gmail.com; jiri@resnulli.us; davem@davemloft.net; edumazet@google.com; horms@kernel.org; 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 Cc: Olga Albisser olga@albisser.org; Olivier Tilmans (Nokia) olivier.tilmans@nokia.com; Bob Briscoe research@bobbriscoe.net; Henrik Steen henrist@henrist.net Subject: Re: [PATCH v11 iproute2-next 1/1] tc: add dualpi2 scheduler module
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 7/17/25 5:23 PM, chia-yu.chang@nokia-bell-labs.com wrote:
diff --git a/include/uapi/linux/pkt_sched.h b/include/uapi/linux/pkt_sched.h index 958d9407..15d1a37a 100644 --- a/include/uapi/linux/pkt_sched.h +++ b/include/uapi/linux/pkt_sched.h
you can drop the uapi changes.
Hi,
Sorry for the late reply, this will be done along with the following two requests.
[...]
--git a/lib/utils.c b/lib/utils.c index 706e93c3..dd242d4d 100644 --- a/lib/utils.c +++ b/lib/utils.c @@ -220,6 +220,36 @@ int get_unsigned(unsigned int *val, const char *arg, int base) return 0; }
+int get_float(float *val, const char *arg) {
float res;
char *ptr;
if (!arg || !*arg)
return -1;
res = strtof(arg, &ptr);
if (!ptr || ptr == arg || *ptr)
return -1;
*val = res;
return 0;
+}
Put the move of get_float in a standlone patch indicating it is a code move.
+int get_float_min_max(float *val, const char *arg, float min, float +max) {
float res;
char *ptr;
if (!arg || !*arg)
return -1;
res = strtof(arg, &ptr);
if (!ptr || ptr == arg || *ptr)
return -1;
if (res < min || res > max)
return -1;
*val = res;
return 0;
+}
/*
- get_time_rtt is "translated" from a similar routine "get_time" in
- tc_util.c. We don't use the exact same routine because tc passes
Add get_float_min_max in a standalone patch.
diff --git a/tc/q_dualpi2.c b/tc/q_dualpi2.c new file mode 100644 index 00000000..50d52aad --- /dev/null +++ b/tc/q_dualpi2.c @@ -0,0 +1,528 @@
[...]
+static int get_packets(uint32_t *val, const char *arg) {
unsigned long res;
char *ptr;
if (!arg || !*arg)
return -1;
res = strtoul(arg, &ptr, 10);
if (!ptr || ptr == arg ||
!(matches(ptr, "pkts") == 0 || matches(ptr, "packets") ==
- 0))
we are not allowing any more uses of "matches".
Then, is it allowed to use strncmp iteratively?
Or any other suggested function could be used?
return -1;
if (res == ULONG_MAX && errno == ERANGE)
return -1;
if (res > 0xFFFFFFFFUL)
return -1;
*val = res;
return 0;
+}
[...]
+static int dualpi2_parse_opt(const struct qdisc_util *qu, int argc,
char **argv, struct nlmsghdr *n, const char
+*dev) {
uint32_t limit = 0;
uint32_t memory_limit = 0;
uint32_t target = 0;
uint32_t tupdate = 0;
uint32_t alpha = DEFAULT_ALPHA_BETA;
uint32_t beta = DEFAULT_ALPHA_BETA;
int32_t coupling_factor = -1;
uint8_t ecn_mask = 0;
int step_unit = __TCA_DUALPI2_MAX;
uint32_t step_thresh = 0;
uint32_t min_qlen_step = 0;
bool set_min_qlen_step = false;
int c_protection = -1;
uint8_t drop_early = __TCA_DUALPI2_DROP_EARLY_MAX;
uint8_t drop_overload = __TCA_DUALPI2_DROP_OVERLOAD_MAX;
uint8_t split_gso = __TCA_DUALPI2_SPLIT_GSO_MAX;
uint32_t rtt_max = 0;
uint32_t rtt_typ = 0;
struct rtattr *tail;
iproute2 follows kernel coding standards and netdev's preference for reverse xmas tree listing of variables.
Sure, I will take correspondence course of actions.
Chia-Yu