Re: [PATCH net-next V3 4/4] net/sched: Introduce act_tunnel_key

2016-08-30 Thread Eric Dumazet
On Tue, 2016-08-30 at 16:17 +0300, Amir Vadai wrote: > On Tue, Aug 30, 2016 at 08:05:03AM -0400, Jamal Hadi Salim wrote: > > > > old = rtnl_dereference(mykey->p); > > if (ovr) > > spin_lock_bh(&mykey->tcf_lock); > Thanks for the detailed example :) > > what are we protecting with this spin lo

Re: [PATCH net-next V3 4/4] net/sched: Introduce act_tunnel_key

2016-08-30 Thread Amir Vadai
On Tue, Aug 30, 2016 at 08:05:03AM -0400, Jamal Hadi Salim wrote: > 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 > > > wrote: > > > > On Fri, 2016-08-26 at 11:26 -0700, Cong Wang wrote:

Re: [PATCH net-next V3 4/4] net/sched: Introduce act_tunnel_key

2016-08-30 Thread Eric Dumazet
On Tue, 2016-08-30 at 14:39 +0300, Amir Vadai wrote: > On Tue, Aug 30, 2016 at 02:03:08PM +0300, Amir Vadai wrote: > > Regarding the specific action in this patchset, correct me if I'm wrong, > > but I think that the lock could be removed safely. Sure ;) > > > > When the action is modified duri

Re: [PATCH net-next V3 4/4] net/sched: Introduce act_tunnel_key

2016-08-30 Thread Jamal Hadi Salim
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 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

Re: [PATCH net-next V3 4/4] net/sched: Introduce act_tunnel_key

2016-08-30 Thread Amir Vadai
On Tue, Aug 30, 2016 at 02:03:08PM +0300, 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 > > wrote: > > > On Fri, 2016-08-26 at 11:26 -0700, Cong Wang wrote: > > >> 1) Currently there are only a few actions using l

Re: [PATCH net-next V3 4/4] net/sched: Introduce act_tunnel_key

2016-08-30 Thread Amir Vadai
On Sun, Aug 28, 2016 at 10:04:21PM -0700, Cong Wang wrote: > On Fri, Aug 26, 2016 at 12:16 PM, Eric Dumazet wrote: > > On Fri, 2016-08-26 at 11:26 -0700, Cong Wang wrote: > >> 1) Currently there are only a few actions using lockless, and they are > >> questionable, as we already discussed before,

Re: [PATCH net-next V3 4/4] net/sched: Introduce act_tunnel_key

2016-08-28 Thread Cong Wang
On Fri, Aug 26, 2016 at 12:16 PM, Eric Dumazet wrote: > On Fri, 2016-08-26 at 11:26 -0700, Cong Wang wrote: >> 1) Currently there are only a few actions using lockless, and they are >> questionable, as we already discussed before, there could be some >> race condition when you modify an existing a

Re: [PATCH net-next V3 4/4] net/sched: Introduce act_tunnel_key

2016-08-26 Thread Eric Dumazet
On Fri, 2016-08-26 at 11:26 -0700, Cong Wang wrote: > On Thu, Aug 25, 2016 at 10:48 AM, Eric Dumazet wrote: > > > > Please find a better way than using a spinlock in this hot path. > > > > Maybe looking at > > 2ee22a90c7afac265bb6f7abea610b938195e2b8 net_sched: act_mirred: remove > > spinlock in

Re: [PATCH net-next V3 4/4] net/sched: Introduce act_tunnel_key

2016-08-26 Thread Cong Wang
On Thu, Aug 25, 2016 at 10:48 AM, Eric Dumazet wrote: > > Please find a better way than using a spinlock in this hot path. > > Maybe looking at > 2ee22a90c7afac265bb6f7abea610b938195e2b8 net_sched: act_mirred: remove > spinlock in fast path > 56e5d1ca183d8616fab377d7d466c244b4dbb3b9 net_sched: ac

Re: [PATCH net-next V3 4/4] net/sched: Introduce act_tunnel_key

2016-08-26 Thread Jiri Benc
On Thu, 25 Aug 2016 19:13:47 +0300, Hadar Hen Zion wrote: > +static int tunnel_key_act(struct sk_buff *skb, const struct tc_action *a, > + struct tcf_result *res) > +{ > + struct tcf_tunnel_key *t = to_tunnel_key(a); > + int action; > + > + spin_lock(&t->tcf_lock);

Re: [PATCH net-next V3 4/4] net/sched: Introduce act_tunnel_key

2016-08-25 Thread Or Gerlitz
On Thu, Aug 25, 2016 at 8:48 PM, Eric Dumazet wrote: > On Thu, 2016-08-25 at 19:13 +0300, Hadar Hen Zion wrote: >> From: Amir Vadai >> +static int tunnel_key_act(struct sk_buff *skb, const struct tc_action *a, >> + struct tcf_result *res) >> +{ >> + struct tcf_tunnel_ke

Re: [PATCH net-next V3 4/4] net/sched: Introduce act_tunnel_key

2016-08-25 Thread Eric Dumazet
On Thu, 2016-08-25 at 19:13 +0300, Hadar Hen Zion wrote: > From: Amir Vadai > > This action could be used before redirecting packets to a shared tunnel > device, or when redirecting packets arriving from a such a device. > > The action will release the metadata created by the tunnel device > (de

Re: [PATCH net-next V3 4/4] net/sched: Introduce act_tunnel_key

2016-08-25 Thread Shmulik Ladkani
Hi, On Thu, 25 Aug 2016 19:13:47 +0300 Hadar Hen Zion wrote: > +static int tunnel_key_act(struct sk_buff *skb, const struct tc_action *a, > + struct tcf_result *res) > +{ > + struct tcf_tunnel_key *t = to_tunnel_key(a); > + int action; > + > + spin_lock(&t->tcf_l

[PATCH net-next V3 4/4] net/sched: Introduce act_tunnel_key

2016-08-25 Thread Hadar Hen Zion
From: Amir Vadai This action could be used before redirecting packets to a shared tunnel device, or when redirecting packets arriving from a such a device. The action will release the metadata created by the tunnel device (decap), or set the metadata with the specified values for encap operation