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

2019-04-24 Thread Vlad Buslov
On Tue 23 Apr 2019 at 19:51, Jakub Kicinski wrote: > On Tue, 23 Apr 2019 07:34:20 +, Vlad Buslov wrote: >> >> @@ -382,6 +395,8 @@ static void fl_hw_destroy_filter(struct tcf_proto >> >> *tp, struct cls_fl_filter *f, >> >> >> >> tc_setup_cb_call(block, TC_SETUP_CLSFLOWER, &cls_flower, fa

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

2019-04-24 Thread Vlad Buslov
On Tue 23 Apr 2019 at 19:52, Saeed Mahameed wrote: > On Tue, 2019-04-23 at 07:43 +, Vlad Buslov wrote: >> On Mon 22 Apr 2019 at 23:34, Saeed Mahameed >> wrote: >> > On Mon, 2019-04-22 at 10:21 +0300, Vlad Buslov wrote: >> > > Recent changes that introduced unlocked flower did not properly >>

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

2019-04-23 Thread Saeed Mahameed
On Tue, 2019-04-23 at 07:43 +, Vlad Buslov wrote: > On Mon 22 Apr 2019 at 23:34, Saeed Mahameed > wrote: > > On Mon, 2019-04-22 at 10:21 +0300, Vlad Buslov wrote: > > > Recent changes that introduced unlocked flower did not properly > > > account for > > > case when reoffload is initiated conc

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

2019-04-23 Thread Jakub Kicinski
On Tue, 23 Apr 2019 07:34:20 +, Vlad Buslov wrote: > >> @@ -382,6 +395,8 @@ static void fl_hw_destroy_filter(struct tcf_proto *tp, > >> struct cls_fl_filter *f, > >> > >>tc_setup_cb_call(block, TC_SETUP_CLSFLOWER, &cls_flower, false); > >>spin_lock(&tp->lock); > >> + if (!list_empty

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

2019-04-23 Thread Vlad Buslov
On Mon 22 Apr 2019 at 23:34, Saeed Mahameed wrote: > On Mon, 2019-04-22 at 10:21 +0300, Vlad Buslov wrote: >> 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

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

2019-04-23 Thread Vlad Buslov
On Tue 23 Apr 2019 at 00:02, Jakub Kicinski wrote: > On Mon, 22 Apr 2019 10:21:34 +0300, Vlad Buslov wrote: >> 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

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

2019-04-22 Thread Jakub Kicinski
On Mon, 22 Apr 2019 10:21:34 +0300, Vlad Buslov wrote: > 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

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

2019-04-22 Thread Saeed Mahameed
On Mon, 2019-04-22 at 10:21 +0300, Vlad Buslov wrote: > 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

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

2019-04-22 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 when it

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