From: "Abdul Rahim, Faizal" <faizal.abdul.rahim@linux.intel.com>
To: Vladimir Oltean <vladimir.oltean@nxp.com>
Cc: Vinicius Costa Gomes <vinicius.gomes@intel.com>,
Jamal Hadi Salim <jhs@mojatatu.com>,
Cong Wang <xiyou.wangcong@gmail.com>,
Jiri Pirko <jiri@resnulli.us>,
"David S . Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 net 6/7] net/sched: taprio: fix q->current_entry is NULL before its expiry
Date: Wed, 15 Nov 2023 19:56:35 +0800 [thread overview]
Message-ID: <ee7624e7-02e0-4fee-b4ac-48e7c79cd221@linux.intel.com> (raw)
In-Reply-To: <20231109115527.loaz76xp5wxwbqav@skbuf>
On 9/11/2023 7:55 pm, Vladimir Oltean wrote:
> On Tue, Nov 07, 2023 at 06:20:22AM -0500, Faizal Rahim wrote:
>> Fix the issue of prematurely setting q->current_entry to NULL in the
>> setup_first_end_time() function when a new admin schedule arrives
>> while the oper schedule is still running but hasn't transitioned yet.
>> This premature setting causes problems because any reference to
>> q->current_entry, such as in taprio_dequeue(), will result in NULL
>> during this period, which is incorrect. q->current_entry should remain
>> valid until the currently running entry expires.
>>
>> To address this issue, only set q->current_entry to NULL when there is
>> no oper schedule currently running.
>>
>> Fixes: 5a781ccbd19e ("tc: Add support for configuring the taprio scheduler")
>
> The "Fixes" tag represents the commit where the code started becoming a
> problem, not when the code that you're changing was first introduced.
>
> I find it hard to believe that the problem was in commit 5a781ccbd19e
> ("tc: Add support for configuring the taprio scheduler"), because we
> didn't support admin -> oper dynamic schedules back then.
>
My bad, will update accordingly.
>> Signed-off-by: Faizal Rahim <faizal.abdul.rahim@linux.intel.com>
>> ---
>> net/sched/sch_taprio.c | 3 ++-
>> 1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/net/sched/sch_taprio.c b/net/sched/sch_taprio.c
>> index 01b114edec30..c60e9e7ac193 100644
>> --- a/net/sched/sch_taprio.c
>> +++ b/net/sched/sch_taprio.c
>> @@ -1375,7 +1375,8 @@ static void setup_first_end_time(struct taprio_sched *q,
>> first->gate_close_time[tc] = ktime_add_ns(base, first->gate_duration[tc]);
>> }
>>
>> - rcu_assign_pointer(q->current_entry, NULL);
>> + if (!hrtimer_active(&q->advance_timer))
>> + rcu_assign_pointer(q->current_entry, NULL);
>> }
>>
>> static void taprio_start_sched(struct Qdisc *sch,
>> --
>> 2.25.1
>>
next prev parent reply other threads:[~2023-11-15 11:56 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-07 11:20 [PATCH v2 net 0/7] qbv cycle time extension/truncation Faizal Rahim
2023-11-07 11:20 ` [PATCH v2 net 1/7] net/sched: taprio: fix too early schedules switching Faizal Rahim
2023-11-08 22:27 ` Vladimir Oltean
2023-11-15 11:54 ` Abdul Rahim, Faizal
2023-11-12 10:31 ` Simon Horman
2023-11-16 5:59 ` Abdul Rahim, Faizal
2023-11-07 11:20 ` [PATCH v2 net 2/7] net/sched: taprio: fix cycle time adjustment for next entry Faizal Rahim
2023-11-08 23:20 ` Vladimir Oltean
2023-11-15 11:55 ` Abdul Rahim, Faizal
2023-11-07 11:20 ` [PATCH v2 net 3/7] net/sched: taprio: update impacted fields during cycle time adjustment Faizal Rahim
2023-11-08 23:41 ` Vladimir Oltean
2023-11-15 11:55 ` Abdul Rahim, Faizal
2023-11-07 11:20 ` [PATCH v2 net 4/7] net/sched: taprio: get corrected value of cycle_time and interval Faizal Rahim
2023-11-07 22:45 ` kernel test robot
2023-11-09 11:11 ` Vladimir Oltean
2023-11-15 11:55 ` Abdul Rahim, Faizal
2023-11-17 2:36 ` Vinicius Costa Gomes
2023-11-09 12:01 ` Vladimir Oltean
2023-11-10 19:15 ` kernel test robot
2023-11-07 11:20 ` [PATCH v2 net 5/7] net/sched: taprio: fix delayed switching to new schedule after timer expiry Faizal Rahim
2023-11-09 11:50 ` Vladimir Oltean
2023-11-15 11:56 ` Abdul Rahim, Faizal
2023-11-09 12:24 ` Vladimir Oltean
2023-11-07 11:20 ` [PATCH v2 net 6/7] net/sched: taprio: fix q->current_entry is NULL before its expiry Faizal Rahim
2023-11-09 11:55 ` Vladimir Oltean
2023-11-15 11:56 ` Abdul Rahim, Faizal [this message]
2023-11-07 11:20 ` [PATCH v2 net 7/7] net/sched: taprio: enable cycle time adjustment for current entry Faizal Rahim
2023-11-09 13:18 ` Vladimir Oltean
2023-11-15 11:57 ` Abdul Rahim, Faizal
2023-11-08 15:51 ` [PATCH v2 net 0/7] qbv cycle time extension/truncation Vladimir Oltean
2023-11-10 11:06 ` Abdul Rahim, Faizal
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ee7624e7-02e0-4fee-b4ac-48e7c79cd221@linux.intel.com \
--to=faizal.abdul.rahim@linux.intel.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=jhs@mojatatu.com \
--cc=jiri@resnulli.us \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=vinicius.gomes@intel.com \
--cc=vladimir.oltean@nxp.com \
--cc=xiyou.wangcong@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.