Re: [Bridge] [PATCH net] net: bridge: br_vlan_get_pvid_rcu() should dereference the VLAN group under RCU

2020-09-21 Thread David Miller
From: Vladimir Oltean Date: Tue, 22 Sep 2020 01:07:09 +0300 > When calling the RCU brother of br_vlan_get_pvid(), lockdep warns: > > = > WARNING: suspicious RCU usage > 5.9.0-rc3-01631-g13c17acb8e38-dirty #814 Not tainted > - >

Re: [Bridge] [PATCH net-next 06/16] net: bridge: mcast: rename br_ip's u member to dst

2020-09-21 Thread Nikolay Aleksandrov
3-MLDv2-fast-path-part-2/20200921-185933 > base: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git > 3cec0369905d086a56a7515f3449982403057599 > config: riscv-allyesconfig (attached as .config) > compiler: riscv64-linux-gcc (GCC) 9.3.0 > reproduce (this i

[Bridge] [PATCH net-next 09/16] net: bridge: mcast: when igmpv3/mldv2 are enabled lookup (S, G) first, then (*, G)

2020-09-21 Thread Nikolay Aleksandrov
From: Nikolay Aleksandrov If (S,G) entries are enabled (igmpv3/mldv2) then look them up first. If there isn't a present (S,G) entry then try to find (*,G). Signed-off-by: Nikolay Aleksandrov --- net/bridge/br_multicast.c | 18 ++ 1 file changed, 18 insertions(+) diff --git

[Bridge] [PATCH net-next 03/16] net: bridge: mdb: use extack in br_mdb_add() and br_mdb_add_group()

2020-09-21 Thread Nikolay Aleksandrov
From: Nikolay Aleksandrov Pass and use extack all the way down to br_mdb_add_group(). Signed-off-by: Nikolay Aleksandrov --- net/bridge/br_mdb.c | 54 +++-- 1 file changed, 42 insertions(+), 12 deletions(-) diff --git a/net/bridge/br_mdb.c

[Bridge] [PATCH net-next 16/16] net: bridge: mcast: when forwarding handle filter mode and blocked flag

2020-09-21 Thread Nikolay Aleksandrov
From: Nikolay Aleksandrov We need to avoid forwarding to ports in MCAST_INCLUDE filter mode when the mdst entry is a *,G or when the port has the blocked flag. Signed-off-by: Nikolay Aleksandrov --- net/bridge/br_forward.c | 15 ++- 1 file changed, 14 insertions(+), 1 deletion(-)

[Bridge] [PATCH net-next 01/16] net: bridge: mdb: use extack in br_mdb_parse()

2020-09-21 Thread Nikolay Aleksandrov
From: Nikolay Aleksandrov We can drop the pr_info() calls and just use extack to return a meaningful error to user-space when br_mdb_parse() fails. Signed-off-by: Nikolay Aleksandrov --- net/bridge/br_mdb.c | 60 + 1 file changed, 39 insertions(+),

[Bridge] [PATCH net-next 13/16] net: bridge: mcast: handle port group filter modes

2020-09-21 Thread Nikolay Aleksandrov
From: Nikolay Aleksandrov We need to handle group filter mode transitions and initial state. To change a port group's INCLUDE -> EXCLUDE mode (or when we have added a new port group in EXCLUDE mode) we need to add that port to all of *,G ports' S,G entries for proper replication. When the

[Bridge] [PATCH net-next 00/16] net: bridge: mcast: IGMPv3/MLDv2 fast-path (part 2)

2020-09-21 Thread Nikolay Aleksandrov
From: Nikolay Aleksandrov Hi, This is the second part of the IGMPv3/MLDv2 support which adds support for the fast-path. In order to be able to handle source entries we add mdb support for S,G entries (i.e. we add source address support to br_ip), that requires to extend the current mdb netlink

[Bridge] [PATCH net-next 05/16] net: bridge: mcast: use br_ip's src for src groups and querier address

2020-09-21 Thread Nikolay Aleksandrov
From: Nikolay Aleksandrov Now that we have src and dst in br_ip it is logical to use the src field for the cases where we need to work with a source address such as querier source address and group source address. Signed-off-by: Nikolay Aleksandrov --- net/bridge/br_mdb.c | 4 +--

[Bridge] [PATCH net-next 08/16] net: bridge: mdb: add support for add/del/dump of entries with source

2020-09-21 Thread Nikolay Aleksandrov
From: Nikolay Aleksandrov Add new mdb attributes (MDBE_ATTR_SOURCE for setting, MDBA_MDB_EATTR_SOURCE for dumping) to allow add/del and dump of mdb entries with a source address (S,G). New S,G entries are created with filter mode of MCAST_INCLUDE. The same attributes are used for IPv4 and IPv6,

[Bridge] [PATCH net-next 10/16] net: bridge: mcast: add rt_protocol field to the port group struct

2020-09-21 Thread Nikolay Aleksandrov
From: Nikolay Aleksandrov We need to be able to differentiate between pg entries created by user-space and the kernel when we start generating S,G entries for IGMPv3/MLDv2's fast path. User-space entries are created by default as RTPROT_STATIC and the kernel entries are RTPROT_KERNEL. Later we

[Bridge] [PATCH net-next 12/16] net: bridge: mcast: install S, G entries automatically based on reports

2020-09-21 Thread Nikolay Aleksandrov
From: Nikolay Aleksandrov This patch adds support for automatic install of S,G mdb entries based on the port group's source list and the source entry's timer. Once installed the S,G will be used when forwarding packets if the approprate multicast/mld versions are set. A new source flag called

[Bridge] [PATCH net-next 04/16] net: bridge: add src field to br_ip

2020-09-21 Thread Nikolay Aleksandrov
From: Nikolay Aleksandrov Add a new src field to struct br_ip which will be used to lookup S, G entries. When SSM option is added we will enable full br_ip lookups. Signed-off-by: Nikolay Aleksandrov --- include/linux/if_bridge.h | 6 ++ 1 file changed, 6 insertions(+) diff --git

[Bridge] [PATCH net-next 15/16] net: bridge: mcast: handle host state

2020-09-21 Thread Nikolay Aleksandrov
From: Nikolay Aleksandrov Since host joins are considered as EXCLUDE {} joins we need to reflect that in all of *,G ports' S,G entries. Since the S,Gs can have host_joined == true only set automatically we can safely set it to false when removing all automatically added entries upon S,G delete.

[Bridge] [PATCH net-next 02/16] net: bridge: mdb: move all port and bridge checks to br_mdb_add

2020-09-21 Thread Nikolay Aleksandrov
From: Nikolay Aleksandrov To avoid doing duplicate device checks and searches (the same were done in br_mdb_add and __br_mdb_add) pass the already found port to __br_mdb_add and pull the bridge's netif_running and enabled multicast checks to br_mdb_add. This would also simplify the future extack

[Bridge] [PATCH net-next 14/16] net: bridge: mcast: add support for blocked port groups

2020-09-21 Thread Nikolay Aleksandrov
From: Nikolay Aleksandrov When excluding S,G entries we need a way to block a particular S,G,port. The new port group flag is managed based on the source's timer as per RFCs 3376 and 3810. When a source expires and its port group is in EXCLUDE mode, it will be blocked. Signed-off-by: Nikolay

[Bridge] [PATCH net-next 07/16] net: bridge: mdb: add support to extend add/del commands

2020-09-21 Thread Nikolay Aleksandrov
From: Nikolay Aleksandrov Since the MDB add/del code expects an exact struct br_mdb_entry we can't really add any extensions, thus add a new nested attribute at the level of MDBA_SET_ENTRY called MDBA_SET_ENTRY_ATTRS which will be used to pass all new options via netlink attributes. This patch

[Bridge] [PATCH net-next 11/16] net: bridge: mcast: add sg_port rhashtable

2020-09-21 Thread Nikolay Aleksandrov
From: Nikolay Aleksandrov To speedup S,G forward handling we need to be able to quickly find out if a port is a member of an S,G group. To do that add a global S,G port rhashtable with key: source addr, group addr, protocol, vid (all br_ip fields) and port pointer. Signed-off-by: Nikolay

[Bridge] [PATCH net-next 06/16] net: bridge: mcast: rename br_ip's u member to dst

2020-09-21 Thread Nikolay Aleksandrov
From: Nikolay Aleksandrov Since now we have src in br_ip, u no longer makes sense so rename it to dst. No functional changes. CC: Marek Lindner CC: Simon Wunderlich CC: Antonio Quartulli CC: b.a.t.m@lists.open-mesh.org Signed-off-by: Nikolay Aleksandrov --- include/linux/if_bridge.h |