Re: [PATCH net-next v3] net: sched: bump refcount for new action in ACT replace mode

2021-03-31 Thread Vlad Buslov
e422f379f3 ("net: sched: use reference counting action init") > Signed-off-by: Kumar Kartikeya Dwivedi > --- > Changelog: > > v2 -> v3 > Cleanup new action on rollback after raising refcount (Cong) > > v1 -> v2 > Remove erroneous tcf_action_put_many call

Re: [PATCH v2 1/1] net: sched: bump refcount for new action in ACT replace mode

2021-03-31 Thread Vlad Buslov
r; It looks like here the modules for all actions that successfully completed their init has already been release by either tcf_action_init_1() on action overwrite or by tcf_action_destroy() on action create. I'll try to come up with tests that validate these corner cases. Regards, Vlad

[PATCH net-next] tc-testing: add simple action change test

2021-03-30 Thread Vlad Buslov
correctly. Signed-off-by: Vlad Buslov --- .../tc-testing/tc-tests/actions/simple.json | 24 +++ 1 file changed, 24 insertions(+) diff --git a/tools/testing/selftests/tc-testing/tc-tests/actions/simple.json b/tools/testing/selftests/tc-testing/tc-tests/actions/simple.json index

Re: [PATCH v2 1/1] net: sched: bump refcount for new action in ACT replace mode

2021-03-30 Thread Vlad Buslov
module for the same action. In case of action creation, there > is no existing action, so no tcf_exts_destroy callback happens. > > This means no code changes for CLS API. > > Fixes: cae422f379f3 ("net: sched: use reference counting action init") > Signed-off-by: K

Re: [PATCH bpf-next 3/5] libbpf: add low level TC-BPF API

2021-03-29 Thread Vlad Buslov
On Mon 29 Mar 2021 at 15:32, Toke Høiland-Jørgensen wrote: > Vlad Buslov writes: > >> On Thu 25 Mar 2021 at 14:00, Kumar Kartikeya Dwivedi >> wrote: >>> This adds functions that wrap the netlink API used for adding, >>> manipulating, and removing filters

Re: [PATCH bpf-next 3/5] libbpf: add low level TC-BPF API

2021-03-29 Thread Vlad Buslov
On Thu 25 Mar 2021 at 14:00, Kumar Kartikeya Dwivedi wrote: > This adds functions that wrap the netlink API used for adding, > manipulating, and removing filters and actions. These functions operate > directly on the loaded prog's fd, and return a handle to the filter and > action using an out

Re: [PATCH 1/1] net: sched: extend lifetime of new action in replace mode

2021-03-29 Thread Vlad Buslov
Hi Kumar, Thanks for the patch! On Sun 28 Mar 2021 at 09:45, Kumar Kartikeya Dwivedi wrote: > When creating an action in replace mode, in tcf_action_add, the refcount > of existing actions is rightly raised during tcf_idr_check_alloc call, > but for new actions a dummy placeholder entry is

Re: [PATCH] net/mlx5e: fix mlx5e_tc_tun_update_header_ipv6 dummy definition

2021-03-01 Thread Vlad Buslov
lx5e_encap_entry *e) > { return -EOPNOTSUPP; } > #endif > int mlx5e_tc_tun_route_lookup(struct mlx5e_priv *priv, Thanks Arnd! Reviewed-by: Vlad Buslov

[PATCH net] net: sched: fix police ext initialization

2021-02-16 Thread Vlad Buslov
ction insertions together") Reported-by: syzbot+151e3e714d34ae4ce...@syzkaller.appspotmail.com Signed-off-by: Vlad Buslov --- include/net/act_api.h | 1 + net/sched/act_api.c | 2 +- net/sched/cls_api.c | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/include/net/act_api.h b/i

Re: KASAN: null-ptr-deref Read in tcf_idrinfo_destroy

2021-02-16 Thread Vlad Buslov
ion_net_exit include/net/act_api.h:151 [inline] >> police_exit_net+0x168/0x360 net/sched/act_police.c:390 > > This is really strange. It seems we still left some -EBUSY placeholders > in the idr, however, we actually call tcf_action_destroy() to clean up > everything including -E

Re: linux-next: Tree for Feb 11

2021-02-12 Thread Vlad Buslov
l match_level; > | ^~~ > drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.h:27:26: warning: 'struct > mlx5e_encap_entry' declared inside parameter list will not be visible outside > of this definition or declaration >27 | int (*calc_hl

Re: INFO: task hung in tcf_ife_init

2020-09-03 Thread Vlad Buslov
On Thu 03 Sep 2020 at 18:33, syzbot wrote: > syzbot has bisected this issue to: > > commit 4e8ddd7f1758ca4ddd0c1f7cf3e66fce736241d2 > Author: Vlad Buslov > Date: Thu Jul 5 14:24:30 2018 + > > net: sched: don't release reference on action overwrite >

Re: [v2,net-next] net: qos offload add flow status with dropped count

2020-06-19 Thread Vlad Buslov
uce dropped frames which is necessary for user. Status > update shows how many filtered packets increasing and how many dropped > in those packets. > > v2: Changes > - Update commit comments suggest by Jiri Pirko. > > Signed-off-by: Po Liu > --- Reviewed-by: Vlad Buslov

Re: [v4,net-next 2/4] net: schedule: add action gate offloading

2020-04-29 Thread Vlad Buslov
On Tue 28 Apr 2020 at 06:34, Po Liu wrote: > Add the gate action to the flow action entry. Add the gate parameters to > the tc_setup_flow_action() queueing to the entries of flow_action_entry > array provide to the driver. > > Signed-off-by: Po Liu > --- > include/net/flow_offload.h | 10

Re: [v4,net-next 1/4] net: qos: introduce a gate control flow action

2020-04-29 Thread Vlad Buslov
Hi Po, On Tue 28 Apr 2020 at 06:34, Po Liu wrote: > Introduce a ingress frame gate control flow action. > Tc gate action does the work like this: > Assume there is a gate allow specified ingress frames can be passed at > specific time slot, and be dropped at specific time slot. Tc filter >

Re: BUG: sleeping function called from invalid context in tcf_chain0_head_change_cb_del

2019-09-17 Thread Vlad Buslov
On Tue 17 Sep 2019 at 20:03, Cong Wang wrote: > On Tue, Sep 17, 2019 at 1:27 AM Vlad Buslov wrote: >> Hi Cong, >> >> Don't see why we would need qdisc tree lock while releasing the >> reference to (or destroying) previous Qdisc. I've skimmed through other >> sc

Re: BUG: sleeping function called from invalid context in tcf_chain0_head_change_cb_del

2019-09-17 Thread Vlad Buslov
1e >> compiler: clang version 9.0.0 (/home/glider/llvm/clang >> 80fee25776c2fb61e74c1ecb1a523375c2500b69) >> syz repro: https://syzkaller.appspot.com/x/repro.syz?x=116c4b1160 >> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=15ff270d60 >> >> The bug was bisected to:

Re: [PATCH 00/12] introduce percpu block scan_hint

2019-02-28 Thread Vlad Buslov
+++ > 5 files changed, 404 insertions(+), 177 deletions(-) > > Thanks, > Dennis Hi Dennis, Thank you very much for doing this! I applied the patches on top of current net-next and can confirm that tc filter insertion rate is significantly improved and is better compared to version with offending commit simply reverted. Regards, Vlad

Re: general protection fault in tc_ctl_chain

2019-02-19 Thread Vlad Buslov
This is fixed by Dan Carpenter's patch "net: sched: potential NULL dereference in tcf_block_find()" that was submitted yesterday. On Mon 18 Feb 2019 at 20:02, Cong Wang wrote: > (Cc'ing Vlad, please fix it) > > On Wed, Feb 13, 2019 at 9:56 AM syzbot > wrote: >>

Re: LPC Traffic Shaping w/ BPF Talk - percpu followup

2018-11-21 Thread Vlad Dumitrescu
On Tue, Nov 20, 2018 at 2:17 PM Dennis Zhou wrote: > > Hi Eddie, Vlad, and Willem, > > A few people mentioned to me that you guys were experiencing issues with > the percpu memory allocator. I saw the talk slides mention the > following two bullets: > > 1) allocation p

Re: LPC Traffic Shaping w/ BPF Talk - percpu followup

2018-11-21 Thread Vlad Dumitrescu
On Tue, Nov 20, 2018 at 2:17 PM Dennis Zhou wrote: > > Hi Eddie, Vlad, and Willem, > > A few people mentioned to me that you guys were experiencing issues with > the percpu memory allocator. I saw the talk slides mention the > following two bullets: > > 1) allocation p

Re: [PATCH 00/14] Modify action API for implementing lockless actions

2018-05-25 Thread Vlad Buslov
On Thu 24 May 2018 at 23:34, Cong Wang <xiyou.wangc...@gmail.com> wrote: > On Mon, May 14, 2018 at 7:27 AM, Vlad Buslov <vla...@mellanox.com> wrote: >> Currently, all netlink protocol handlers for updating rules, actions and >> qdiscs are protected with single global

Re: [PATCH 00/14] Modify action API for implementing lockless actions

2018-05-25 Thread Vlad Buslov
On Thu 24 May 2018 at 23:34, Cong Wang wrote: > On Mon, May 14, 2018 at 7:27 AM, Vlad Buslov wrote: >> Currently, all netlink protocol handlers for updating rules, actions and >> qdiscs are protected with single global rtnl lock which removes any >> possibility for parall

Re: [PATCH net-next v3] net: sched: don't disable bh when accessing action idr

2018-05-24 Thread Vlad Buslov
On Wed 23 May 2018 at 23:14, Cong Wang <xiyou.wangc...@gmail.com> wrote: > On Wed, May 23, 2018 at 1:52 AM, Vlad Buslov <vla...@mellanox.com> wrote: >> Initial net_device implementation used ingress_lock spinlock to synchronize >> ingress path of device. This lock was

Re: [PATCH net-next v3] net: sched: don't disable bh when accessing action idr

2018-05-24 Thread Vlad Buslov
On Wed 23 May 2018 at 23:14, Cong Wang wrote: > On Wed, May 23, 2018 at 1:52 AM, Vlad Buslov wrote: >> Initial net_device implementation used ingress_lock spinlock to synchronize >> ingress path of device. This lock was used in both process and bh context. >> In some code

[PATCH net-next v3] net: sched: don't disable bh when accessing action idr

2018-05-23 Thread Vlad Buslov
eplace all action idr spinlock usage with regular calls that do not disable bh. Acked-by: Jiri Pirko <j...@mellanox.com> Acked-by: Jamal Hadi Salim <j...@mojatatu.com> Signed-off-by: Vlad Buslov <vla...@mellanox.com> --- Changes from V2 to V3: - Expanded commit message. Changes

[PATCH net-next v3] net: sched: don't disable bh when accessing action idr

2018-05-23 Thread Vlad Buslov
eplace all action idr spinlock usage with regular calls that do not disable bh. Acked-by: Jiri Pirko Acked-by: Jamal Hadi Salim Signed-off-by: Vlad Buslov --- Changes from V2 to V3: - Expanded commit message. Changes from V1 to V2: - Expanded commit message. net/sched/act_api.c | 20 ++

Re: [PATCH net-next v2] net: sched: don't disable bh when accessing action idr

2018-05-23 Thread Vlad Buslov
On Wed 23 May 2018 at 01:10, Cong Wang <xiyou.wangc...@gmail.com> wrote: > On Mon, May 21, 2018 at 1:03 PM, Vlad Buslov <vla...@mellanox.com> wrote: >> Initial net_device implementation used ingress_lock spinlock to synchronize >> ingress path of device. This lock was

Re: [PATCH net-next v2] net: sched: don't disable bh when accessing action idr

2018-05-23 Thread Vlad Buslov
On Wed 23 May 2018 at 01:10, Cong Wang wrote: > On Mon, May 21, 2018 at 1:03 PM, Vlad Buslov wrote: >> Initial net_device implementation used ingress_lock spinlock to synchronize >> ingress path of device. This lock was used in both process and bh context. >> In some code

[PATCH net-next v2] net: sched: don't disable bh when accessing action idr

2018-05-21 Thread Vlad Buslov
ls that do not disable bh. Signed-off-by: Vlad Buslov <vla...@mellanox.com> --- net/sched/act_api.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/net/sched/act_api.c b/net/sched/act_api.c index 72251241665a..3f4cf930f809 100644 --- a/net/sched/act

[PATCH net-next v2] net: sched: don't disable bh when accessing action idr

2018-05-21 Thread Vlad Buslov
ls that do not disable bh. Signed-off-by: Vlad Buslov --- net/sched/act_api.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/net/sched/act_api.c b/net/sched/act_api.c index 72251241665a..3f4cf930f809 100644 --- a/net/sched/act_api.c +++ b/net/sched

Re: [PATCH 09/14] net: sched: don't release reference on action overwrite

2018-05-20 Thread Vlad Buslov
On Sat 19 May 2018 at 21:52, Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> wrote: > On Mon, May 14, 2018 at 05:27:10PM +0300, Vlad Buslov wrote: >> Return from action init function with reference to action taken, >> even when overwriting existing action. > >

Re: [PATCH 09/14] net: sched: don't release reference on action overwrite

2018-05-20 Thread Vlad Buslov
On Sat 19 May 2018 at 21:52, Marcelo Ricardo Leitner wrote: > On Mon, May 14, 2018 at 05:27:10PM +0300, Vlad Buslov wrote: >> Return from action init function with reference to action taken, >> even when overwriting existing action. > > Isn't this patch necessary before

Re: [PATCH 06/14] net: sched: implement reference counted action release

2018-05-20 Thread Vlad Buslov
On Sun 20 May 2018 at 06:22, Jiri Pirko <j...@resnulli.us> wrote: > Sat, May 19, 2018 at 11:43:27PM CEST, marcelo.leit...@gmail.com wrote: >>On Mon, May 14, 2018 at 05:27:07PM +0300, Vlad Buslov wrote: >>... >>> @@ -1052,6 +1088,36 @@ static int tca_action

Re: [PATCH 06/14] net: sched: implement reference counted action release

2018-05-20 Thread Vlad Buslov
On Sun 20 May 2018 at 06:22, Jiri Pirko wrote: > Sat, May 19, 2018 at 11:43:27PM CEST, marcelo.leit...@gmail.com wrote: >>On Mon, May 14, 2018 at 05:27:07PM +0300, Vlad Buslov wrote: >>... >>> @@ -1052,6 +1088,36 @@ static int tca_action_flush(struct net *net,

Re: [PATCH 02/14] net: sched: change type of reference and bind counters

2018-05-20 Thread Vlad Buslov
On Sat 19 May 2018 at 21:04, Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> wrote: > On Mon, May 14, 2018 at 05:27:03PM +0300, Vlad Buslov wrote: >> Change type of action reference counter to refcount_t. >> >> Change type of action bind counter to atomic_t. &g

Re: [PATCH 02/14] net: sched: change type of reference and bind counters

2018-05-20 Thread Vlad Buslov
On Sat 19 May 2018 at 21:04, Marcelo Ricardo Leitner wrote: > On Mon, May 14, 2018 at 05:27:03PM +0300, Vlad Buslov wrote: >> Change type of action reference counter to refcount_t. >> >> Change type of action bind counter to atomic_t. >> This type is used to allo

Re: [PATCH] net: sched: don't disable bh when accessing action idr

2018-05-19 Thread Vlad Buslov
On Sat 19 May 2018 at 02:59, Cong Wang <xiyou.wangc...@gmail.com> wrote: > On Fri, May 18, 2018 at 8:45 AM, Vlad Buslov <vla...@mellanox.com> wrote: >> Underlying implementation of action map has changed and doesn't require >> disabling bh anymore. Replace al

Re: [PATCH] net: sched: don't disable bh when accessing action idr

2018-05-19 Thread Vlad Buslov
On Sat 19 May 2018 at 02:59, Cong Wang wrote: > On Fri, May 18, 2018 at 8:45 AM, Vlad Buslov wrote: >> Underlying implementation of action map has changed and doesn't require >> disabling bh anymore. Replace all action idr spinlock usage with regular >> calls that do not d

[PATCH] tc-testing: fix ip address in u32 test

2018-05-18 Thread Vlad Buslov
Fix expected ip address to actually match configured ip address. Fix test to expect single matched filter. Signed-off-by: Vlad Buslov <vla...@mellanox.com> --- tools/testing/selftests/tc-testing/tc-tests/filters/tests.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff

[PATCH] tc-testing: fix ip address in u32 test

2018-05-18 Thread Vlad Buslov
Fix expected ip address to actually match configured ip address. Fix test to expect single matched filter. Signed-off-by: Vlad Buslov --- tools/testing/selftests/tc-testing/tc-tests/filters/tests.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing

[PATCH] tc-testing: flush gact actions on test teardown

2018-05-18 Thread Vlad Buslov
Test 6fb4 creates one mirred and one pipe action, but only flushes mirred on teardown. Leaking pipe action causes failures in other tests. Add additional teardown command to also flush gact actions. Signed-off-by: Vlad Buslov <vla...@mellanox.com> --- tools/testing/selftests/tc-testing/tc

[PATCH] tc-testing: flush gact actions on test teardown

2018-05-18 Thread Vlad Buslov
Test 6fb4 creates one mirred and one pipe action, but only flushes mirred on teardown. Leaking pipe action causes failures in other tests. Add additional teardown command to also flush gact actions. Signed-off-by: Vlad Buslov --- tools/testing/selftests/tc-testing/tc-tests/actions/mirred.json

[PATCH] net: sched: don't disable bh when accessing action idr

2018-05-18 Thread Vlad Buslov
Underlying implementation of action map has changed and doesn't require disabling bh anymore. Replace all action idr spinlock usage with regular calls that do not disable bh. Signed-off-by: Vlad Buslov <vla...@mellanox.com> --- net/sched/act_api.c | 20 ++-- 1 file chang

[PATCH] net: sched: don't disable bh when accessing action idr

2018-05-18 Thread Vlad Buslov
Underlying implementation of action map has changed and doesn't require disabling bh anymore. Replace all action idr spinlock usage with regular calls that do not disable bh. Signed-off-by: Vlad Buslov --- net/sched/act_api.c | 20 ++-- 1 file changed, 10 insertions(+), 10

Re: [PATCH 12/14] net: sched: retry action check-insert on concurrent modification

2018-05-16 Thread Vlad Buslov
@resnulli.us> wrote: >>>>>>> Mon, May 14, 2018 at 04:27:13PM CEST, vla...@mellanox.com wrote: >>>>>>>>Retry check-insert sequence in action init functions if action with same >>>>>>>>index was inserted concurrently. &g

Re: [PATCH 12/14] net: sched: retry action check-insert on concurrent modification

2018-05-16 Thread Vlad Buslov
la...@mellanox.com wrote: >>>>>>>>Retry check-insert sequence in action init functions if action with same >>>>>>>>index was inserted concurrently. >>>>>>>> >>>>>>>>Signed-off-by: Vlad Buslov >>&g

Re: [PATCH 12/14] net: sched: retry action check-insert on concurrent modification

2018-05-16 Thread Vlad Buslov
ox.com wrote: >>>> >>>>On Wed 16 May 2018 at 09:59, Jiri Pirko <j...@resnulli.us> wrote: >>>>> Mon, May 14, 2018 at 04:27:13PM CEST, vla...@mellanox.com wrote: >>>>>>Retry check-insert sequence in action init functions if action with same

Re: [PATCH 12/14] net: sched: retry action check-insert on concurrent modification

2018-05-16 Thread Vlad Buslov
t;On Wed 16 May 2018 at 09:59, Jiri Pirko wrote: >>>>> Mon, May 14, 2018 at 04:27:13PM CEST, vla...@mellanox.com wrote: >>>>>>Retry check-insert sequence in action init functions if action with same >>>>>>index was inserted concurrently. >>>>

Re: [PATCH 12/14] net: sched: retry action check-insert on concurrent modification

2018-05-16 Thread Vlad Buslov
ox.com wrote: >>>>Retry check-insert sequence in action init functions if action with same >>>>index was inserted concurrently. >>>> >>>>Signed-off-by: Vlad Buslov <vla...@mellanox.com> >>>>--- >>>> net/sched/act_bpf.c

Re: [PATCH 12/14] net: sched: retry action check-insert on concurrent modification

2018-05-16 Thread Vlad Buslov
rt sequence in action init functions if action with same >>>>index was inserted concurrently. >>>> >>>>Signed-off-by: Vlad Buslov >>>>--- >>>> net/sched/act_bpf.c| 8 +++- >>>> net/sched/act_connmark.c | 8 +

Re: [PATCH 12/14] net: sched: retry action check-insert on concurrent modification

2018-05-16 Thread Vlad Buslov
On Wed 16 May 2018 at 09:59, Jiri Pirko <j...@resnulli.us> wrote: > Mon, May 14, 2018 at 04:27:13PM CEST, vla...@mellanox.com wrote: >>Retry check-insert sequence in action init functions if action with same >>index was inserted concurrently. >> >>Signed-off-by:

Re: [PATCH 12/14] net: sched: retry action check-insert on concurrent modification

2018-05-16 Thread Vlad Buslov
On Wed 16 May 2018 at 09:59, Jiri Pirko wrote: > Mon, May 14, 2018 at 04:27:13PM CEST, vla...@mellanox.com wrote: >>Retry check-insert sequence in action init functions if action with same >>index was inserted concurrently. >> >>Signed-off-by: Vlad Buslov >>---

Re: [PATCH 11/14] net: core: add new/replace rate estimator lock parameter

2018-05-16 Thread Vlad Buslov
ter from >>concurrent modification. >> >>Signed-off-by: Vlad Buslov <vla...@mellanox.com> > > [...] > > >> /** >> * gen_new_estimator - create a new rate estimator >> * @bstats: basic statistics >> * @cpu_bstats: bstats per cpu >> * @rate_e

Re: [PATCH 11/14] net: core: add new/replace rate estimator lock parameter

2018-05-16 Thread Vlad Buslov
tion. >> >>Signed-off-by: Vlad Buslov > > [...] > > >> /** >> * gen_new_estimator - create a new rate estimator >> * @bstats: basic statistics >> * @cpu_bstats: bstats per cpu >> * @rate_est: rate estimator statistics >>+ * @rate_e

Re: [PATCH 14/14] net: sched: implement delete for all actions

2018-05-16 Thread Vlad Buslov
deletes action >>only if it is still in action idr. This implementation prevents concurrent >>threads from deleting same action twice. >> >>Signed-off-by: Vlad Buslov <vla...@mellanox.com> >>--- >> net/sched/act_bpf.c| 8 >> net/sc

Re: [PATCH 14/14] net: sched: implement delete for all actions

2018-05-16 Thread Vlad Buslov
s still in action idr. This implementation prevents concurrent >>threads from deleting same action twice. >> >>Signed-off-by: Vlad Buslov >>--- >> net/sched/act_bpf.c| 8 >> net/sched/act_connmark.c | 8 >> net/sched/ac

Re: [PATCH 13/14] net: sched: use unique idr insert function in unlocked actions

2018-05-16 Thread Vlad Buslov
On Wed 16 May 2018 at 09:50, Jiri Pirko <j...@resnulli.us> wrote: > Mon, May 14, 2018 at 04:27:14PM CEST, vla...@mellanox.com wrote: >>Substitute calls to action insert function with calls to action insert >>unique function that warns if insertion overwrites index in idr. >

Re: [PATCH 13/14] net: sched: use unique idr insert function in unlocked actions

2018-05-16 Thread Vlad Buslov
On Wed 16 May 2018 at 09:50, Jiri Pirko wrote: > Mon, May 14, 2018 at 04:27:14PM CEST, vla...@mellanox.com wrote: >>Substitute calls to action insert function with calls to action insert >>unique function that warns if insertion overwrites index in idr. >> >>

Re: [PATCH 10/14] net: sched: extend act API for lockless actions

2018-05-16 Thread Vlad Buslov
.com wrote: >>>>Implement new action API function to atomically delete action with >>>>specified index and to atomically insert unique action. These functions are >>>>required to implement init and delete functions for specific actions that >>>&g

Re: [PATCH 10/14] net: sched: extend act API for lockless actions

2018-05-16 Thread Vlad Buslov
on API function to atomically delete action with >>>>specified index and to atomically insert unique action. These functions are >>>>required to implement init and delete functions for specific actions that >>>>do not rely on rtnl lock. >>>> >&

Re: [PATCH 10/14] net: sched: extend act API for lockless actions

2018-05-16 Thread Vlad Buslov
ctions are >>required to implement init and delete functions for specific actions that >>do not rely on rtnl lock. >> >>Signed-off-by: Vlad Buslov <vla...@mellanox.com> >>--- >> include/net/act_api.h | 2 ++ >> net/sched/act_api.c | 45 ++

Re: [PATCH 10/14] net: sched: extend act API for lockless actions

2018-05-16 Thread Vlad Buslov
red to implement init and delete functions for specific actions that >>do not rely on rtnl lock. >> >>Signed-off-by: Vlad Buslov >>--- >> include/net/act_api.h | 2 ++ >> net/sched/act_api.c | 45 + >> 2 files chan

Re: [PATCH 09/14] net: sched: don't release reference on action overwrite

2018-05-16 Thread Vlad Buslov
ehavior to always take reference to action before returning >>successfully. > > Where's the balance? Who does the release instead? I'm probably missing > something. I've resplit these patches for V2 to always do take/release in same patch. > >> >>Signed-off-by: V

Re: [PATCH 09/14] net: sched: don't release reference on action overwrite

2018-05-16 Thread Vlad Buslov
ence to action before returning >>successfully. > > Where's the balance? Who does the release instead? I'm probably missing > something. I've resplit these patches for V2 to always do take/release in same patch. > >> >>Signed-off-by: Vlad Buslov >>--- &g

Re: [PATCH 00/14] Modify action API for implementing lockless actions

2018-05-15 Thread Vlad Buslov
On Tue 15 May 2018 at 18:25, Jamal Hadi Salim <j...@mojatatu.com> wrote: > On 14/05/18 04:46 PM, Vlad Buslov wrote: >> >> On Mon 14 May 2018 at 18:03, Jamal Hadi Salim <j...@mojatatu.com> wrote: >>> On 14/05/18 10:27 AM, Vlad Buslov wrote: > > &g

Re: [PATCH 00/14] Modify action API for implementing lockless actions

2018-05-15 Thread Vlad Buslov
On Tue 15 May 2018 at 18:25, Jamal Hadi Salim wrote: > On 14/05/18 04:46 PM, Vlad Buslov wrote: >> >> On Mon 14 May 2018 at 18:03, Jamal Hadi Salim wrote: >>> On 14/05/18 10:27 AM, Vlad Buslov wrote: > > >> Hello Jamal, >> >> I'm trying t

Re: [PATCH 07/14] net: sched: use reference counting action init

2018-05-15 Thread Vlad Buslov
gt;>modifications so user must always hold reference to it. >>>>>> >>>>>>Implement helper put list function to atomically release list of actions >>>>>>after action API init code is done using them. >>>>>> >>>

Re: [PATCH 07/14] net: sched: use reference counting action init

2018-05-15 Thread Vlad Buslov
gt;>>> >>>>>>Implement helper put list function to atomically release list of actions >>>>>>after action API init code is done using them. >>>>>> >>>>>>Signed-off-by: Vlad Buslov >>>>>>--- >>

Re: [PATCH 05/14] net: sched: always take reference to action

2018-05-15 Thread Vlad Buslov
>>>>idr check function that atomically looks up action in idr and increments >>>>its reference and bind counters. >>>> >>>>Implement both action search and check using new safe function. >>>> >>>>Signed-off-by: Vlad B

Re: [PATCH 05/14] net: sched: always take reference to action

2018-05-15 Thread Vlad Buslov
atomically looks up action in idr and increments >>>>its reference and bind counters. >>>> >>>>Implement both action search and check using new safe function. >>>> >>>>Signed-off-by: Vlad Buslov >>>>--- >>>> net/sched/act_

Re: [PATCH 07/14] net: sched: use reference counting action init

2018-05-15 Thread Vlad Buslov
ne. At this point action becomes accessible for concurrent >>>>modifications so user must always hold reference to it. >>>> >>>>Implement helper put list function to atomically release list of actions >>>>after acti

Re: [PATCH 07/14] net: sched: use reference counting action init

2018-05-15 Thread Vlad Buslov
ible for concurrent >>>>modifications so user must always hold reference to it. >>>> >>>>Implement helper put list function to atomically release list of actions >>>>after action API init code is done using them. >>>> >>>>Signed-off-b

Re: [PATCH 07/14] net: sched: use reference counting action init

2018-05-15 Thread Vlad Buslov
ist of actions >>after action API init code is done using them. >> >>Signed-off-by: Vlad Buslov <vla...@mellanox.com> >>--- >> net/sched/act_api.c | 38 +- >> 1 file changed, 17 insertions(+), 21 deletions(-) >> > >

Re: [PATCH 07/14] net: sched: use reference counting action init

2018-05-15 Thread Vlad Buslov
t;>after action API init code is done using them. >> >>Signed-off-by: Vlad Buslov >>--- >> net/sched/act_api.c | 38 +- >> 1 file changed, 17 insertions(+), 21 deletions(-) >> > > [...] > > >>@@ -1196,8 +1190,

Re: [PATCH 06/14] net: sched: implement reference counted action release

2018-05-15 Thread Vlad Buslov
On Tue 15 May 2018 at 09:03, Jiri Pirko wrote: > Mon, May 14, 2018 at 09:07:06PM CEST, vla...@mellanox.com wrote: >> >>On Mon 14 May 2018 at 16:47, Jiri Pirko wrote: >>> Mon, May 14, 2018 at 04:27:07PM CEST, vla...@mellanox.com wrote: >>> >>> [...] >>> >>>

Re: [PATCH 06/14] net: sched: implement reference counted action release

2018-05-15 Thread Vlad Buslov
On Tue 15 May 2018 at 09:03, Jiri Pirko wrote: > Mon, May 14, 2018 at 09:07:06PM CEST, vla...@mellanox.com wrote: >> >>On Mon 14 May 2018 at 16:47, Jiri Pirko wrote: >>> Mon, May 14, 2018 at 04:27:07PM CEST, vla...@mellanox.com wrote: >>> >>> [...] >>> >>> +static int

Re: [PATCH 00/14] Modify action API for implementing lockless actions

2018-05-14 Thread Vlad Buslov
On Mon 14 May 2018 at 18:03, Jamal Hadi Salim <j...@mojatatu.com> wrote: > On 14/05/18 10:27 AM, Vlad Buslov wrote: >> Currently, all netlink protocol handlers for updating rules, actions and >> qdiscs are protected with single global rtnl lock which removes any >>

Re: [PATCH 00/14] Modify action API for implementing lockless actions

2018-05-14 Thread Vlad Buslov
On Mon 14 May 2018 at 18:03, Jamal Hadi Salim wrote: > On 14/05/18 10:27 AM, Vlad Buslov wrote: >> Currently, all netlink protocol handlers for updating rules, actions and >> qdiscs are protected with single global rtnl lock which removes any >> possibility for parall

Re: [PATCH 06/14] net: sched: implement reference counted action release

2018-05-14 Thread Vlad Buslov
On Mon 14 May 2018 at 16:47, Jiri Pirko wrote: > Mon, May 14, 2018 at 04:27:07PM CEST, vla...@mellanox.com wrote: > > [...] > > >>+static int tcf_action_del_1(struct net *net, char *kind, u32 index, >>+ struct netlink_ext_ack *extack) >>+{ >>+ const

Re: [PATCH 06/14] net: sched: implement reference counted action release

2018-05-14 Thread Vlad Buslov
On Mon 14 May 2018 at 16:47, Jiri Pirko wrote: > Mon, May 14, 2018 at 04:27:07PM CEST, vla...@mellanox.com wrote: > > [...] > > >>+static int tcf_action_del_1(struct net *net, char *kind, u32 index, >>+ struct netlink_ext_ack *extack) >>+{ >>+ const struct

Re: [PATCH 05/14] net: sched: always take reference to action

2018-05-14 Thread Vlad Buslov
urrently) >> >>Remove unsafe action idr lookup function. Instead of it, implement safe tcf >>idr check function that atomically looks up action in idr and increments >>its reference and bind counters. >> >>Implement both action search and check using new safe funct

Re: [PATCH 05/14] net: sched: always take reference to action

2018-05-14 Thread Vlad Buslov
gt;Remove unsafe action idr lookup function. Instead of it, implement safe tcf >>idr check function that atomically looks up action in idr and increments >>its reference and bind counters. >> >>Implement both action search and check using new safe function. >> >&g

[PATCH 03/14] net: sched: add 'delete' function to action ops

2018-05-14 Thread Vlad Buslov
Extend action ops with 'delete' function. Each action type to implement its own delete function that doesn't depend on rtnl lock. Signed-off-by: Vlad Buslov <vla...@mellanox.com> --- include/net/act_api.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/net/act_api.h b/inclu

[PATCH 03/14] net: sched: add 'delete' function to action ops

2018-05-14 Thread Vlad Buslov
Extend action ops with 'delete' function. Each action type to implement its own delete function that doesn't depend on rtnl lock. Signed-off-by: Vlad Buslov --- include/net/act_api.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/net/act_api.h b/include/net/act_api.h index e634014

[PATCH 05/14] net: sched: always take reference to action

2018-05-14 Thread Vlad Buslov
its reference and bind counters. Implement both action search and check using new safe function. Signed-off-by: Vlad Buslov <vla...@mellanox.com> --- net/sched/act_api.c | 38 -- 1 file changed, 16 insertions(+), 22 deletions(-) diff --git a/net/sched/act

[PATCH 05/14] net: sched: always take reference to action

2018-05-14 Thread Vlad Buslov
its reference and bind counters. Implement both action search and check using new safe function. Signed-off-by: Vlad Buslov --- net/sched/act_api.c | 38 -- 1 file changed, 16 insertions(+), 22 deletions(-) diff --git a/net/sched/act_api.c b/net/sched/act_api.c

[PATCH 09/14] net: sched: don't release reference on action overwrite

2018-05-14 Thread Vlad Buslov
to always take reference to action before returning successfully. Signed-off-by: Vlad Buslov <vla...@mellanox.com> --- net/sched/act_bpf.c| 8 net/sched/act_connmark.c | 5 +++-- net/sched/act_csum.c | 8 net/sched/act_gact.c | 5 +++-- net/sched/act

[PATCH 09/14] net: sched: don't release reference on action overwrite

2018-05-14 Thread Vlad Buslov
to always take reference to action before returning successfully. Signed-off-by: Vlad Buslov --- net/sched/act_bpf.c| 8 net/sched/act_connmark.c | 5 +++-- net/sched/act_csum.c | 8 net/sched/act_gact.c | 5 +++-- net/sched/act_ife.c| 12

[PATCH 02/14] net: sched: change type of reference and bind counters

2018-05-14 Thread Vlad Buslov
Change type of action reference counter to refcount_t. Change type of action bind counter to atomic_t. This type is used to allow decrementing bind counter without testing for 0 result. Signed-off-by: Vlad Buslov <vla...@mellanox.com> --- include/net/act_api.h | 5 +++-- net

[PATCH 02/14] net: sched: change type of reference and bind counters

2018-05-14 Thread Vlad Buslov
Change type of action reference counter to refcount_t. Change type of action bind counter to atomic_t. This type is used to allow decrementing bind counter without testing for 0 result. Signed-off-by: Vlad Buslov --- include/net/act_api.h | 5 +++-- net/sched/act_api.c| 32

[PATCH 07/14] net: sched: use reference counting action init

2018-05-14 Thread Vlad Buslov
user must always hold reference to it. Implement helper put list function to atomically release list of actions after action API init code is done using them. Signed-off-by: Vlad Buslov <vla...@mellanox.com> --- net/sched/act_api.c | 38 +- 1 file chang

[PATCH 07/14] net: sched: use reference counting action init

2018-05-14 Thread Vlad Buslov
user must always hold reference to it. Implement helper put list function to atomically release list of actions after action API init code is done using them. Signed-off-by: Vlad Buslov --- net/sched/act_api.c | 38 +- 1 file changed, 17 insertions(+), 21

[PATCH 08/14] net: sched: account for temporary action reference

2018-05-14 Thread Vlad Buslov
it to userspace. Signed-off-by: Vlad Buslov <vla...@mellanox.com> --- net/sched/act_api.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/sched/act_api.c b/net/sched/act_api.c index 3f02cd1..2772276e 100644 --- a/net/sched/act_api.c +++ b/net/sched/act_api.c @@

[PATCH 08/14] net: sched: account for temporary action reference

2018-05-14 Thread Vlad Buslov
it to userspace. Signed-off-by: Vlad Buslov --- net/sched/act_api.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/sched/act_api.c b/net/sched/act_api.c index 3f02cd1..2772276e 100644 --- a/net/sched/act_api.c +++ b/net/sched/act_api.c @@ -935,7 +935,7

[PATCH 06/14] net: sched: implement reference counted action release

2018-05-14 Thread Vlad Buslov
on rtnl lock. Remove rtnl lock assertions that are no longer needed. Signed-off-by: Vlad Buslov <vla...@mellanox.com> --- net/sched/act_api.c | 98 - net/sched/cls_api.c | 1 - 2 files changed, 82 insertions(+), 17 deletions(-) diff --git

[PATCH 06/14] net: sched: implement reference counted action release

2018-05-14 Thread Vlad Buslov
on rtnl lock. Remove rtnl lock assertions that are no longer needed. Signed-off-by: Vlad Buslov --- net/sched/act_api.c | 98 - net/sched/cls_api.c | 1 - 2 files changed, 82 insertions(+), 17 deletions(-) diff --git a/net/sched/act_api.c b/net

[PATCH 04/14] net: sched: implement unlocked action init API

2018-05-14 Thread Vlad Buslov
Add additional 'unlocked' argument to act API init functions. Argument is true when rtnl lock is not taken and false otherwise. It is required to implement actions that need to release rtnl lock before loading kernel module and reacquire if afterwards. Signed-off-by: Vlad Buslov <

[PATCH 04/14] net: sched: implement unlocked action init API

2018-05-14 Thread Vlad Buslov
Add additional 'unlocked' argument to act API init functions. Argument is true when rtnl lock is not taken and false otherwise. It is required to implement actions that need to release rtnl lock before loading kernel module and reacquire if afterwards. Signed-off-by: Vlad Buslov --- include/net

[PATCH 13/14] net: sched: use unique idr insert function in unlocked actions

2018-05-14 Thread Vlad Buslov
Substitute calls to action insert function with calls to action insert unique function that warns if insertion overwrites index in idr. Signed-off-by: Vlad Buslov <vla...@mellanox.com> --- net/sched/act_bpf.c| 2 +- net/sched/act_connmark.c | 2 +- net/sched/act_csum.c

  1   2   3   4   5   6   7   >