[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANn89iKKSCwcjcS2wr0gOGXd3SeWexYKd28=f=iwxnc11dRh_Q@mail.gmail.com>
Date: Tue, 28 May 2024 07:41:21 +0200
From: Eric Dumazet <edumazet@...gle.com>
To: Vladimir Oltean <vladimir.oltean@....com>
Cc: netdev@...r.kernel.org, linux-kselftest@...r.kernel.org,
Vinicius Costa Gomes <vinicius.gomes@...el.com>, Jamal Hadi Salim <jhs@...atatu.com>,
Cong Wang <xiyou.wangcong@...il.com>, Jiri Pirko <jiri@...nulli.us>,
"David S. Miller" <davem@...emloft.net>, Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Shuah Khan <shuah@...nel.org>, Pedro Tammela <pctammela@...atatu.com>
Subject: Re: [PATCH net 1/2] net/sched: taprio: make q->picos_per_byte
available to fill_sched_entry()
On Mon, May 27, 2024 at 5:40 PM Vladimir Oltean <vladimir.oltean@....com> wrote:
>
> In commit b5b73b26b3ca ("taprio: Fix allowing too small intervals"), a
> comparison of user input against length_to_duration(q, ETH_ZLEN) was
> introduced, to avoid RCU stalls due to frequent hrtimers.
>
> The implementation of length_to_duration() depends on q->picos_per_byte
> being set for the link speed. The blamed commit in the Fixes: tag has
> moved this too late, so the checks introduced above are ineffective.
> The q->picos_per_byte is zero at parse_taprio_schedule() ->
> parse_sched_list() -> parse_sched_entry() -> fill_sched_entry() time.
>
> Move the taprio_set_picos_per_byte() call as one of the first things in
> taprio_change(), before the bulk of the netlink attribute parsing is
> done. That's because it is needed there.
>
> Add a selftest to make sure the issue doesn't get reintroduced.
>
> Fixes: 09dbdf28f9f9 ("net/sched: taprio: fix calculation of maximum gate durations")
> Signed-off-by: Vladimir Oltean <vladimir.oltean@....com>
Reviewed-by: Eric Dumazet <edumazet@...gle.com>
Thanks!
Powered by blists - more mailing lists