Netdev List
 help / color / mirror / Atom feed
From: Jinjie Ruan <ruanjinjie@huawei.com>
To: Jakub Kicinski <kuba@kernel.org>
Cc: <jhs@mojatatu.com>, <jiri@resnulli.us>, <davem@davemloft.net>,
	<edumazet@google.com>, <pabeni@redhat.com>, <horms@kernel.org>,
	<netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH net-next v3] net: sched: act_gact: use acquire/release for tcfg_ptype
Date: Mon, 7 Sep 2026 16:05:45 +0800	[thread overview]
Message-ID: <25327839-d493-4e12-9b6b-1dda1f1b8704@huawei.com> (raw)
In-Reply-To: <20260905134221.233ae6b5@kernel.org>



在 2026/9/6 4:42, Jakub Kicinski 写道:
> On Wed, 2 Sep 2026 15:16:59 +0800 Jinjie Ruan wrote:
>> @@ -160,7 +155,8 @@ TC_INDIRECT_SCOPE int tcf_gact_act(struct sk_buff *skb,
>>  
>>  #ifdef CONFIG_GACT_PROB
>>  	{
>> -	u32 ptype = READ_ONCE(gact->tcfg_ptype);
>> +	/* Pairs with smp_store_release() in tcf_gact_init() */
>> +	u32 ptype = smp_load_acquire(&gact->tcfg_ptype);
>>  
>>  	if (ptype)
>>  		action = gact_rand[ptype](gact);
> 
> Clashiko points out that you are turning what used to be a conditional
> barrier into one that's always obeyed, even if ptype is 0.

What do you think of the following fix?

 #ifdef CONFIG_GACT_PROB
        {
-       u32 ptype = READ_ONCE(gact->tcfg_ptype);
+               u32 ptype = READ_ONCE(gact->tcfg_ptype);

-       if (ptype)
-               action = gact_rand[ptype](gact);
+               if (ptype) {
+                       /* Pairs with smp_store_release() in
tcf_gact_init() */
+                       ptype = smp_load_acquire(&gact->tcfg_ptype);
+                       if (ptype)
+                               action = gact_rand[ptype](gact);
+               }
        }




      reply	other threads:[~2026-09-07  8:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-02  7:16 [PATCH net-next v3] net: sched: act_gact: use acquire/release for tcfg_ptype Jinjie Ruan
2026-09-02 14:19 ` Jamal Hadi Salim
2026-09-05 20:42 ` Jakub Kicinski
2026-09-07  8:05   ` Jinjie Ruan [this message]

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=25327839-d493-4e12-9b6b-1dda1f1b8704@huawei.com \
    --to=ruanjinjie@huawei.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --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 \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox