net: taprio: Fix returning EINVAL when configuring without flags
Subsystems (4)
Vinicius Costa Gomes
maintainerPATCH 1/1 net: taprio: Fix returning EINVAL when configuring without flags
When configuring a taprio instance if "flags" is not specified (or it's zero), taprio currently replies with an "Invalid argument" error.
So, set the return value to zero after we are done with all the checks.
--- net/sched/sch_taprio.c | 4 ++++ 1 file changed, 4 insertions(+)
net/sched/sch_taprio.c +4 -0
@@ -1341,6 +1341,10 @@ static int taprio_parse_clockid(struct Qdisc *sch, struct nlattr **tb,NL_SET_ERR_MSG (extack,"Specifying a 'clockid' is mandatory" ); goto out; } + +/* Everything went ok, return success. */ + err =0 ; + out:return err; }
Signature · 1 line
2.23.0
Hi Vinicius,
Quoted 10 lines · Vinicius Costa Gomes
When configuring a taprio instance if "flags" is not specified (or it's zero), taprio currently replies with an "Invalid argument" error.
So, set the return value to zero after we are done with all the checks.
Fixes 9c66d1564676 ("taprio: Add support for hardware offloading")Signed-off-by Vinicius Costa Gomes <[email protected]>---
You mean clockid, not flags, right?
Otherwise the patch looks correct, sorry for the bug. Once you fix the commit message:
Quoted 21 lines
net/sched/sch_taprio.c | 4 ++++ 1 file changed, 4 insertions(+)net/sched/sch_taprio.c +4
-1@@ -1341,6 +1341,10 @@ static int taprio_parse_clockid(struct Qdisc *sch, struct nlattr **tb,NL_SET_ERR_MSG (extack,"Specifying a 'clockid' is mandatory" ); goto out; } + +/* Everything went ok, return success. */ + err =0 ; + out:return err; } --2.23.0
Quoted 16 lines · Vladimir Oltean
Hi Vinicius,
Quoted 10 lines · Vinicius Costa Gomes
When configuring a taprio instance if "flags" is not specified (or it's zero), taprio currently replies with an "Invalid argument" error.
So, set the return value to zero after we are done with all the checks.
Fixes 9c66d1564676 ("taprio: Add support for hardware offloading")Signed-off-by Vinicius Costa Gomes <[email protected]>---
Quoted 6 lines
You mean clockid, not flags, right?
Otherwise the patch looks correct, sorry for the bug. Once you fix the commit message:Acked-by Vladimir Oltean <[email protected]>
No, you are actually right to phrase it this way, but the description is still confusing. When 'flags' is zero, the driver takes a code path which is buggy and always returns a negative error code. Although I'm not really sure how much better this can be phrased. I'm fine with the description now too.
Quoted 21 lines
Quoted 21 lines
net/sched/sch_taprio.c | 4 ++++ 1 file changed, 4 insertions(+)net/sched/sch_taprio.c +4
-1@@ -1341,6 +1341,10 @@ static int taprio_parse_clockid(struct Qdisc *sch, struct nlattr **tb,NL_SET_ERR_MSG (extack,"Specifying a 'clockid' is mandatory" ); goto out; } + +/* Everything went ok, return success. */ + err =0 ; + out:return err; } --2.23.0
Vinicius Costa Gomes
maintainerHi,
Quoted 8 lines · Vladimir Oltean
Hi Vinicius,
Quoted 4 lines · Vinicius Costa Gomes
When configuring a taprio instance if "flags" is not specified (or it's zero), taprio currently replies with an "Invalid argument" error.
Quoted 8 lines
Quoted 6 lines
So, set the return value to zero after we are done with all the checks.
Fixes 9c66d1564676 ("taprio: Add support for hardware offloading")Signed-off-by Vinicius Costa Gomes <[email protected]>---
You mean clockid, not flags, right?
I do mean "flags", yeah. The case I was testing was something like this:
$ tc qdisc replace dev $IFACE parent root handle 100 taprio \
num_tc 3 \
map 2 2 1 0 2 2 2 2 2 2 2 2 2 2 2 2 \
queues 1@0 1@1 2@2 \
base-time $BASE_TIME \
sched-entry S 01 300000 \
sched-entry S 02 300000 \
sched-entry S 04 400000 \
clockid CLOCK_TAICheers,
--
Vinicius
Jakub Kicinski
AppliedQuoted 8 lines · Vinicius Costa Gomes
When configuring a taprio instance if "flags" is not specified (or it's zero), taprio currently replies with an "Invalid argument" error.
So, set the return value to zero after we are done with all the checks.
Fixes 9c66d1564676 ("taprio: Add support for hardware offloading")Signed-off-by Vinicius Costa Gomes <[email protected]>
Applied, thanks.