Re: [RFC PATCH net-next] net: sched: flower: refactor reoffload for concurrent access

2019-04-18 Thread Vlad Buslov
On Thu 18 Apr 2019 at 20:46, Jakub Kicinski wrote: > On Thu, 18 Apr 2019 16:33:22 +, Vlad Buslov wrote: >> Considering this, I tried to improve my solution to remove possibility >> of multiple adds of same filter and it seems to me that it would be >> enough to move hw_filters list managemen

Re: [RFC PATCH net-next] net: sched: flower: refactor reoffload for concurrent access

2019-04-18 Thread Jakub Kicinski
On Thu, 18 Apr 2019 18:13:37 +, Vlad Buslov wrote: > On Thu 18 Apr 2019 at 21:02, Jakub Kicinski > wrote: > > On Thu, 18 Apr 2019 17:58:26 +, Vlad Buslov wrote: > >> On Thu 18 Apr 2019 at 20:46, Jakub Kicinski > >> wrote: > >> > On Thu, 18 Apr 2019 16:33:22 +, Vlad Buslov wrote:

Re: [RFC PATCH net-next] net: sched: flower: refactor reoffload for concurrent access

2019-04-18 Thread Vlad Buslov
On Thu 18 Apr 2019 at 21:02, Jakub Kicinski wrote: > On Thu, 18 Apr 2019 17:58:26 +, Vlad Buslov wrote: >> On Thu 18 Apr 2019 at 20:46, Jakub Kicinski >> wrote: >> > On Thu, 18 Apr 2019 16:33:22 +, Vlad Buslov wrote: >> >> Considering this, I tried to improve my solution to remove po

Re: [RFC PATCH net-next] net: sched: flower: refactor reoffload for concurrent access

2019-04-18 Thread Jakub Kicinski
On Thu, 18 Apr 2019 17:58:26 +, Vlad Buslov wrote: > On Thu 18 Apr 2019 at 20:46, Jakub Kicinski > wrote: > > On Thu, 18 Apr 2019 16:33:22 +, Vlad Buslov wrote: > >> Considering this, I tried to improve my solution to remove possibility > >> of multiple adds of same filter and it seems

Re: [RFC PATCH net-next] net: sched: flower: refactor reoffload for concurrent access

2019-04-18 Thread Jakub Kicinski
On Thu, 18 Apr 2019 16:33:22 +, Vlad Buslov wrote: > Considering this, I tried to improve my solution to remove possibility > of multiple adds of same filter and it seems to me that it would be > enough to move hw_filters list management in flower offloads functions: > add filter to list while

Re: [RFC PATCH net-next] net: sched: flower: refactor reoffload for concurrent access

2019-04-18 Thread Vlad Buslov
On Wed 17 Apr 2019 at 19:34, Jakub Kicinski wrote: > On Wed, 17 Apr 2019 07:29:36 +, Vlad Buslov wrote: >> On Wed 17 Apr 2019 at 00:49, Jakub Kicinski >> wrote: >> > On Tue, 16 Apr 2019 17:20:47 +0300, Vlad Buslov wrote: >> >> @@ -1551,6 +1558,10 @@ static int fl_change(struct net *net, st

Re: [RFC PATCH net-next] net: sched: flower: refactor reoffload for concurrent access

2019-04-17 Thread Vlad Buslov
On Wed 17 Apr 2019 at 19:34, Jakub Kicinski wrote: > On Wed, 17 Apr 2019 07:29:36 +, Vlad Buslov wrote: >> On Wed 17 Apr 2019 at 00:49, Jakub Kicinski >> wrote: >> > On Tue, 16 Apr 2019 17:20:47 +0300, Vlad Buslov wrote: >> >> @@ -1551,6 +1558,10 @@ static int fl_change(struct net *net, st

Re: [RFC PATCH net-next] net: sched: flower: refactor reoffload for concurrent access

2019-04-17 Thread Jakub Kicinski
On Wed, 17 Apr 2019 07:29:36 +, Vlad Buslov wrote: > On Wed 17 Apr 2019 at 00:49, Jakub Kicinski > wrote: > > On Tue, 16 Apr 2019 17:20:47 +0300, Vlad Buslov wrote: > >> @@ -1551,6 +1558,10 @@ static int fl_change(struct net *net, struct > >> sk_buff *in_skb, > >>goto errout_ma

Re: [RFC PATCH net-next] net: sched: flower: refactor reoffload for concurrent access

2019-04-17 Thread Vlad Buslov
On Wed 17 Apr 2019 at 00:49, Jakub Kicinski wrote: > On Tue, 16 Apr 2019 17:20:47 +0300, Vlad Buslov wrote: >> @@ -1551,6 +1558,10 @@ static int fl_change(struct net *net, struct sk_buff >> *in_skb, >> goto errout_mask; >> >> if (!tc_skip_hw(fnew->flags)) { >> +spi

Re: [RFC PATCH net-next] net: sched: flower: refactor reoffload for concurrent access

2019-04-16 Thread Jakub Kicinski
On Tue, 16 Apr 2019 17:20:47 +0300, Vlad Buslov wrote: > @@ -1551,6 +1558,10 @@ static int fl_change(struct net *net, struct sk_buff > *in_skb, > goto errout_mask; > > if (!tc_skip_hw(fnew->flags)) { > + spin_lock(&tp->lock); > + list_add(&fnew->hw_lis

[RFC PATCH net-next] net: sched: flower: refactor reoffload for concurrent access

2019-04-16 Thread Vlad Buslov
Recent changes that introduced unlocked flower did not properly account for case when reoffload is initiated concurrently with filter updates. To fix the issue, extend flower with 'hw_filters' list that is used to store filters that don't have 'skip_hw' flag set. Filter is added to the list before