Skip to contentSkip to conversation

Parse FQ band weights correctly

PATCH In review [email protected] 2 participants 2 messages Jun 3, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Parse FQ band weights correctly

From: Hemanth Malla <[email protected]>

Currently, NEXT_ARG() is called twice resulting in the first weight being skipped. This results in the following errors:

$ sudo tc qdisc replace dev enP64183s1 root fq weights 589824 196608 65536
Not enough elements in weights
$ sudo tc qdisc replace dev enP64183s1 root fq weights 589824 196608 65536 nopacing
Illegal "weights" element, positive number expected
Fixes 567eb4e41045 ("tc: fq: add TCA_FQ_WEIGHTS handling")
---
 tc/q_fq.c | 1 -
 1 file changed, 1 deletion(-)
tc/q_fq.c +0 -1
index 51a43122..13c5a896 100644
@@ -258,7 +258,6 @@ static int fq_parse_opt(const struct qdisc_util *qu, int argc, char **argv,
                                fprintf(stderr, "Duplicate \"weights\"\n");
                                return -1;
                        }
-                       NEXT_ARG();
                        for (idx = 0; idx < FQ_BANDS; ++idx) {
                                int val;
 

--
2.43.0

Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · On Mon, Jun 2, 2025 at 8:41 PM <[email protected]> wrote:

From: Hemanth Malla <[email protected]>

Currently, NEXT_ARG() is called twice resulting in the first weight being skipped. This results in the following errors:

Quoted 8 lines
$ sudo tc qdisc replace dev enP64183s1 root fq weights 589824 196608 65536
Not enough elements in weights
$ sudo tc qdisc replace dev enP64183s1 root fq weights 589824 196608 65536 nopacing
Illegal "weights" element, positive number expected
Fixes 567eb4e41045 ("tc: fq: add TCA_FQ_WEIGHTS handling")