Re: [Bridge] [PATCH net-next 0/7] net: bridge: convert fdbs to use bitops

2019-10-29 Thread David Miller
From: Nikolay Aleksandrov Date: Tue, 29 Oct 2019 13:45:52 +0200 > We'd like to have a well-defined behaviour when changing fdb flags. The > problem is that we've added new fields which are changed from all > contexts without any locking. We are aware of the bit test/change races > and these are

[Bridge] [PATCH net-next 7/7] net: bridge: fdb: set flags directly in fdb_create

2019-10-29 Thread Nikolay Aleksandrov
No need to have separate arguments for each flag, just set the flags to whatever was passed to fdb_create() before the fdb is published. Signed-off-by: Nikolay Aleksandrov --- net/bridge/br_fdb.c | 18 +++--- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git

[Bridge] [PATCH net-next 6/7] net: bridge: fdb: convert offloaded to use bitops

2019-10-29 Thread Nikolay Aleksandrov
Convert the offloaded field to a flag and use bitops. Signed-off-by: Nikolay Aleksandrov --- net/bridge/br_fdb.c | 9 - net/bridge/br_private.h | 2 +- net/bridge/br_switchdev.c | 6 -- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/net/bridge/br_fdb.c

[Bridge] [PATCH net-next 3/7] net: bridge: fdb: convert is_sticky to bitops

2019-10-29 Thread Nikolay Aleksandrov
Straight-forward convert of the is_sticky field to bitops. Signed-off-by: Nikolay Aleksandrov --- net/bridge/br_fdb.c | 12 ++-- net/bridge/br_private.h | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/net/bridge/br_fdb.c b/net/bridge/br_fdb.c index

[Bridge] [PATCH net-next 5/7] net: bridge: fdb: convert added_by_external_learn to use bitops

2019-10-29 Thread Nikolay Aleksandrov
Convert the added_by_external_learn field to a flag and use bitops. Signed-off-by: Nikolay Aleksandrov --- net/bridge/br_fdb.c | 19 +-- net/bridge/br_private.h | 4 ++-- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/net/bridge/br_fdb.c

[Bridge] [PATCH net-next 1/7] net: bridge: fdb: convert is_local to bitops

2019-10-29 Thread Nikolay Aleksandrov
The patch adds a new fdb flags field in the hole between the two cache lines and uses it to convert is_local to bitops. Signed-off-by: Nikolay Aleksandrov --- net/bridge/br_fdb.c | 32 +++- net/bridge/br_input.c | 2 +- net/bridge/br_private.h | 9 +++--

[Bridge] [PATCH net-next 2/7] net: bridge: fdb: convert is_static to bitops

2019-10-29 Thread Nikolay Aleksandrov
Convert the is_static to bitops, make use of the combined test_and_set/clear_bit to simplify expressions in fdb_add_entry. Signed-off-by: Nikolay Aleksandrov --- net/bridge/br_fdb.c | 40 +++- net/bridge/br_private.h | 4 ++-- 2 files changed, 21

[Bridge] [PATCH net-next 0/7] net: bridge: convert fdbs to use bitops

2019-10-29 Thread Nikolay Aleksandrov
Hi, We'd like to have a well-defined behaviour when changing fdb flags. The problem is that we've added new fields which are changed from all contexts without any locking. We are aware of the bit test/change races and these are fine (we can remove them later), but it is considered undefined