[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <bd4cb7ee-1f7e-eefe-760e-0fa53257390e@mojatatu.com>
Date: Tue, 30 Aug 2016 08:05:03 -0400
From: Jamal Hadi Salim <jhs@...atatu.com>
To: Amir Vadai <amir@...ai.me>, Cong Wang <xiyou.wangcong@...il.com>,
Eric Dumazet <eric.dumazet@...il.com>
Cc: Hadar Hen Zion <hadarh@...lanox.com>,
"David S. Miller" <davem@...emloft.net>,
Linux Kernel Network Developers <netdev@...r.kernel.org>,
Jiri Pirko <jiri@...lanox.com>, Jiri Benc <jbenc@...hat.com>,
Shmulik Ladkani <shmulik.ladkani@...il.com>,
Tom Herbert <tom@...bertland.com>,
Or Gerlitz <ogerlitz@...lanox.com>,
Amir Vadai <amirva@...lanox.com>
Subject: Re: [PATCH net-next V3 4/4] net/sched: Introduce act_tunnel_key
On 16-08-30 07:03 AM, Amir Vadai wrote:
> On Sun, Aug 28, 2016 at 10:04:21PM -0700, Cong Wang wrote:
>> On Fri, Aug 26, 2016 at 12:16 PM, Eric Dumazet <eric.dumazet@...il.com> wrote:
>>> On Fri, 2016-08-26 at 11:26 -0700, Cong Wang wrote:
> Regarding the specific action in this patchset, correct me if I'm wrong,
> but I think that the lock could be removed safely.
>
From what Eric suggested (refer to my posting on skbmod),
this becomes:
+struct tcf_tunnel_key_p {
+ int tcft_action;
+ struct metadata_dst *tcft_enc_metadata;
+};
/* rcu protected */
+struct tcf_tunnel_key {
+ struct tc_action common;
+ struct tcf_tunnel_key_p *p;
+};
At init() - always alloc struct tcf_tunnel_key_p, new
old = rtnl_dereference(mykey->p);
if (ovr)
spin_lock_bh(&mykey->tcf_lock);
... update all params here ..
rcu_assign_pointer(mykey->p, new);
if (ovr) {
spin_unlock_bh(&mykey->tcf_lock);
synchronize_rcu();
}
kfree(old);
at act():
rcu_read_lock();
struct tcf_tunnel_key_p *p = rcu_dereference(mykey->p);
... use p here ...
rcu_read_unlock();
Cong was looking to do something more generic for all actions.
cheers,
jamal
Powered by blists - more mailing lists