* [PATCH net v1] net: taprio: Fix returning EINVAL when configuring without flags
@ 2019-10-08 23:20 Vinicius Costa Gomes
2019-10-08 23:58 ` Vladimir Oltean
2019-10-10 1:52 ` Jakub Kicinski
0 siblings, 2 replies; 5+ messages in thread
From: Vinicius Costa Gomes @ 2019-10-08 23:20 UTC (permalink / raw)
To: netdev; +Cc: Vinicius Costa Gomes, jhs, xiyou.wangcong, jiri, davem, olteanv
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 <vinicius.gomes@intel.com>
---
net/sched/sch_taprio.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/net/sched/sch_taprio.c b/net/sched/sch_taprio.c
index 68b543f85a96..6719a65169d4 100644
--- a/net/sched/sch_taprio.c
+++ b/net/sched/sch_taprio.c
@@ -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
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH net v1] net: taprio: Fix returning EINVAL when configuring without flags
2019-10-08 23:20 [PATCH net v1] net: taprio: Fix returning EINVAL when configuring without flags Vinicius Costa Gomes
@ 2019-10-08 23:58 ` Vladimir Oltean
2019-10-09 0:11 ` Vladimir Oltean
2019-10-09 0:22 ` Vinicius Costa Gomes
2019-10-10 1:52 ` Jakub Kicinski
1 sibling, 2 replies; 5+ messages in thread
From: Vladimir Oltean @ 2019-10-08 23:58 UTC (permalink / raw)
To: Vinicius Costa Gomes
Cc: netdev, Jamal Hadi Salim, Cong Wang, Jiri Pirko, David S. Miller
Hi Vinicius,
On Wed, 9 Oct 2019 at 02:19, Vinicius Costa Gomes
<vinicius.gomes@intel.com> wrote:
>
> 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 <vinicius.gomes@intel.com>
> ---
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 <olteanv@gmail.com>
> net/sched/sch_taprio.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/net/sched/sch_taprio.c b/net/sched/sch_taprio.c
> index 68b543f85a96..6719a65169d4 100644
> --- a/net/sched/sch_taprio.c
> +++ b/net/sched/sch_taprio.c
> @@ -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
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH net v1] net: taprio: Fix returning EINVAL when configuring without flags
2019-10-08 23:58 ` Vladimir Oltean
@ 2019-10-09 0:11 ` Vladimir Oltean
2019-10-09 0:22 ` Vinicius Costa Gomes
1 sibling, 0 replies; 5+ messages in thread
From: Vladimir Oltean @ 2019-10-09 0:11 UTC (permalink / raw)
To: Vinicius Costa Gomes
Cc: netdev, Jamal Hadi Salim, Cong Wang, Jiri Pirko, David S. Miller
On Wed, 9 Oct 2019 at 02:58, Vladimir Oltean <olteanv@gmail.com> wrote:
>
> Hi Vinicius,
>
> On Wed, 9 Oct 2019 at 02:19, Vinicius Costa Gomes
> <vinicius.gomes@intel.com> wrote:
> >
> > 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 <vinicius.gomes@intel.com>
> > ---
>
> 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 <olteanv@gmail.com>
>
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.
> > net/sched/sch_taprio.c | 4 ++++
> > 1 file changed, 4 insertions(+)
> >
> > diff --git a/net/sched/sch_taprio.c b/net/sched/sch_taprio.c
> > index 68b543f85a96..6719a65169d4 100644
> > --- a/net/sched/sch_taprio.c
> > +++ b/net/sched/sch_taprio.c
> > @@ -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
> >
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH net v1] net: taprio: Fix returning EINVAL when configuring without flags
2019-10-08 23:58 ` Vladimir Oltean
2019-10-09 0:11 ` Vladimir Oltean
@ 2019-10-09 0:22 ` Vinicius Costa Gomes
1 sibling, 0 replies; 5+ messages in thread
From: Vinicius Costa Gomes @ 2019-10-09 0:22 UTC (permalink / raw)
To: Vladimir Oltean
Cc: netdev, Jamal Hadi Salim, Cong Wang, Jiri Pirko, David S. Miller
Hi,
Vladimir Oltean <olteanv@gmail.com> writes:
> Hi Vinicius,
>
> On Wed, 9 Oct 2019 at 02:19, Vinicius Costa Gomes
> <vinicius.gomes@intel.com> wrote:
>>
>> 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 <vinicius.gomes@intel.com>
>> ---
>
> 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_TAI
Cheers,
--
Vinicius
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH net v1] net: taprio: Fix returning EINVAL when configuring without flags
2019-10-08 23:20 [PATCH net v1] net: taprio: Fix returning EINVAL when configuring without flags Vinicius Costa Gomes
2019-10-08 23:58 ` Vladimir Oltean
@ 2019-10-10 1:52 ` Jakub Kicinski
1 sibling, 0 replies; 5+ messages in thread
From: Jakub Kicinski @ 2019-10-10 1:52 UTC (permalink / raw)
To: Vinicius Costa Gomes; +Cc: netdev, jhs, xiyou.wangcong, jiri, davem, olteanv
On Tue, 8 Oct 2019 16:20:07 -0700, Vinicius Costa Gomes wrote:
> 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 <vinicius.gomes@intel.com>
Applied, thanks.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2019-10-10 1:53 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-10-08 23:20 [PATCH net v1] net: taprio: Fix returning EINVAL when configuring without flags Vinicius Costa Gomes
2019-10-08 23:58 ` Vladimir Oltean
2019-10-09 0:11 ` Vladimir Oltean
2019-10-09 0:22 ` Vinicius Costa Gomes
2019-10-10 1:52 ` Jakub Kicinski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).