All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Pirko <jiri@resnulli.us>
To: Vlad Buslov <vladbu@mellanox.com>
Cc: netdev@vger.kernel.org, davem@davemloft.net, jhs@mojatatu.com,
	xiyou.wangcong@gmail.com, pablo@netfilter.org,
	kadlec@blackhole.kfki.hu, fw@strlen.de, ast@kernel.org,
	daniel@iogearbox.net, edumazet@google.com, keescook@chromium.org,
	marcelo.leitner@gmail.com
Subject: Re: [PATCH net-next 12/14] net: sched: act_mirred: remove dependency on rtnl lock
Date: Wed, 8 Aug 2018 10:54:08 +0200	[thread overview]
Message-ID: <20180808085408.GD1998@nanopsycho> (raw)
In-Reply-To: <vbfwot12qk7.fsf@reg-r-vrt-018-180.mtr.labs.mlnx>

Wed, Aug 08, 2018 at 10:47:04AM CEST, vladbu@mellanox.com wrote:
>
>On Wed 08 Aug 2018 at 08:03, Jiri Pirko <jiri@resnulli.us> wrote:
>> Wed, Aug 08, 2018 at 09:40:35AM CEST, vladbu@mellanox.com wrote:
>>>
>>>On Tue 07 Aug 2018 at 16:36, Jiri Pirko <jiri@resnulli.us> wrote:
>>>> Mon, Aug 06, 2018 at 08:54:23AM CEST, vladbu@mellanox.com wrote:
>>>>
>>>> [...]
>>>>
>>>>>diff --git a/include/net/tc_act/tc_tunnel_key.h b/include/net/tc_act/tc_tunnel_key.h
>>>>>index 46b8c7f1c8d5..e6e475d788c6 100644
>>>>>--- a/include/net/tc_act/tc_tunnel_key.h
>>>>>+++ b/include/net/tc_act/tc_tunnel_key.h
>>>>>@@ -30,26 +30,47 @@ struct tcf_tunnel_key {
>>>>> 
>>>>> static inline bool is_tcf_tunnel_set(const struct tc_action *a)
>>>>> {
>>>>>+	bool ret = false;
>>>>> #ifdef CONFIG_NET_CLS_ACT
>>>>> 	struct tcf_tunnel_key *t = to_tunnel_key(a);
>>>>>-	struct tcf_tunnel_key_params *params = rtnl_dereference(t->params);
>>>>>+	struct tcf_tunnel_key_params *params;
>>>>> 
>>>>>+	rcu_read_lock();
>>>>>+	params = rcu_dereference(t->params);
>>>>> 	if (a->ops && a->ops->type == TCA_ACT_TUNNEL_KEY)
>>>>>-		return params->tcft_action == TCA_TUNNEL_KEY_ACT_SET;
>>>>>+		ret = params->tcft_action == TCA_TUNNEL_KEY_ACT_SET;
>>>>>+	rcu_read_unlock();
>>>>> #endif
>>>>>-	return false;
>>>>>+	return ret;
>>>>> }
>>>>> 
>>>>> static inline bool is_tcf_tunnel_release(const struct tc_action *a)
>>>>
>>>> Why are these tunnel things in a mirred patch?
>>>
>>>Mistake during re-slit. Will move those to tunnel_key patch.
>>
>> Are you sure that the changes are safe? I just quickly looked over it
>> and it smells:
>> drivers/net/ethernet/mellanox/mlx5/core/en_tc.c:
>>                 if (is_tcf_tunnel_set(a)) {
>>                         info = tcf_tunnel_info(a);
>>
>> Why the "t->params" can't be nulled in the middle?
>
>First of all, no API is actually "unlocked" with this patch. It is a
>preparation, rtnl mutex is still in use.
>
>Callers of these functions will have to be updated, for example, to use
>their _rcu version while holding rcu_read_lock.

I don't see any rcu version of these. I think that it would be good to
convert the callers to rcu and you can avoid these changes.

>
>
>
>

  reply	other threads:[~2018-08-08 11:15 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-06  6:54 [PATCH net-next 00/14] Remove rtnl lock dependency from all action implementations Vlad Buslov
2018-08-06  6:54 ` [PATCH net-next 01/14] net: sched: act_bpf: remove dependency on rtnl lock Vlad Buslov
2018-08-06  6:54 ` [PATCH net-next 02/14] net: sched: act_csum: " Vlad Buslov
2018-08-06  6:54 ` [PATCH net-next 03/14] net: sched: act_gact: " Vlad Buslov
2018-08-06  6:54 ` [PATCH net-next 04/14] net: sched: act_ife: " Vlad Buslov
2018-08-06  6:54 ` [PATCH net-next 05/14] net: sched: act_ipt: " Vlad Buslov
2018-08-06  6:54 ` [PATCH net-next 06/14] net: sched: act_pedit: " Vlad Buslov
2018-08-06  6:54 ` [PATCH net-next 07/14] net: sched: act_sample: " Vlad Buslov
2018-08-06  6:54 ` [PATCH net-next 08/14] net: sched: act_simple: " Vlad Buslov
2018-08-06  6:54 ` [PATCH net-next 09/14] net: sched: act_skbmod: " Vlad Buslov
2018-08-06  6:54 ` [PATCH net-next 10/14] net: sched: act_tunnel_key: " Vlad Buslov
2018-08-06  6:54 ` [PATCH net-next 11/14] net: sched: act_vlan: " Vlad Buslov
2018-08-06  6:54 ` [PATCH net-next 12/14] net: sched: act_mirred: " Vlad Buslov
2018-08-07 16:36   ` Jiri Pirko
2018-08-08  7:40     ` Vlad Buslov
2018-08-08  8:03       ` Jiri Pirko
2018-08-08  8:47         ` Vlad Buslov
2018-08-08  8:54           ` Jiri Pirko [this message]
2018-08-08 11:21             ` Vlad Buslov
2018-08-06  6:54 ` [PATCH net-next 13/14] net: core: add new/replace rate estimator lock parameter Vlad Buslov
2018-08-08  1:37   ` Marcelo Ricardo Leitner
2018-08-08 12:30     ` Vlad Buslov
2018-08-08 14:18       ` Marcelo Ricardo Leitner
2018-08-06  6:54 ` [PATCH net-next 14/14] net: sched: act_police: remove dependency on rtnl lock Vlad Buslov

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=20180808085408.GD1998@nanopsycho \
    --to=jiri@resnulli.us \
    --cc=ast@kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=fw@strlen.de \
    --cc=jhs@mojatatu.com \
    --cc=kadlec@blackhole.kfki.hu \
    --cc=keescook@chromium.org \
    --cc=marcelo.leitner@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pablo@netfilter.org \
    --cc=vladbu@mellanox.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.