Message ID | 20220223172407.175865-1-troglobit@gmail.com (mailing list archive) |
---|---|
State | Changes Requested |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [1/1,net-next] net: bridge: add support for host l2 mdb entries | expand |
Context | Check | Description |
---|---|---|
netdev/tree_selection | success | Clearly marked for net-next |
netdev/fixes_present | success | Fixes tag not required for -next series |
netdev/subject_prefix | success | Link |
netdev/cover_letter | success | Single patches do not need cover letters |
netdev/patch_count | success | Link |
netdev/header_inline | success | No static functions without inline keyword in header files |
netdev/build_32bit | success | Errors and warnings before: 0 this patch: 0 |
netdev/cc_maintainers | success | CCed 6 of 6 maintainers |
netdev/build_clang | success | Errors and warnings before: 0 this patch: 0 |
netdev/module_param | success | Was 0 now: 0 |
netdev/verify_signedoff | success | Signed-off-by tag matches author and committer |
netdev/verify_fixes | success | No Fixes tag |
netdev/build_allmodconfig_warn | success | Errors and warnings before: 0 this patch: 0 |
netdev/checkpatch | warning | CHECK: Unbalanced braces around else statement |
netdev/kdoc | success | Errors and warnings before: 0 this patch: 0 |
netdev/source_inline | success | Was 0 now: 0 |
On 23/02/2022 19:24, Joachim Wiberg wrote: > This patch expands on the earlier work on layer-2 mdb entries by adding > support for host entries. Due to the fact that host joined entries do > not have any flag field, we infer the permanent flag when reporting the > entries to userspace, which otherwise would be listed as 'temp'. > > Before patch: > > ~# bridge mdb add dev br0 port br0 grp 01:00:00:c0:ff:ee permanent > Error: bridge: Flags are not allowed for host groups. > ~# bridge mdb add dev br0 port br0 grp 01:00:00:c0:ff:ee > Error: bridge: Only permanent L2 entries allowed. > > After patch: > > ~# bridge mdb add dev br0 port br0 grp 01:00:00:c0:ff:ee permanent > ~# bridge mdb show > dev br0 port br0 grp 01:00:00:c0:ff:ee permanent vid 1 > > Signed-off-by: Joachim Wiberg <troglobit@gmail.com> > --- > net/bridge/br_mdb.c | 8 +++++--- > 1 file changed, 5 insertions(+), 3 deletions(-) > It would be nice to add a selftest for L2 entries. You can send it as a follow-up. The patch looks good to me. Acked-by: Nikolay Aleksandrov <razor@blackwall.org>
On Thu, Feb 24, 2022 at 13:26, Nikolay Aleksandrov <razor@blackwall.org> wrote: > On 23/02/2022 19:24, Joachim Wiberg wrote: >> This patch expands on the earlier work on layer-2 mdb entries by adding >> support for host entries. > It would be nice to add a selftest for L2 entries. You can send it as a follow-up. OK, will do! It's on my immediate backlog. Thanks /Joachim
On Thu, 24 Feb 2022 13:26:22 +0200 Nikolay Aleksandrov wrote: > On 23/02/2022 19:24, Joachim Wiberg wrote: > > This patch expands on the earlier work on layer-2 mdb entries by adding > > support for host entries. Due to the fact that host joined entries do > > not have any flag field, we infer the permanent flag when reporting the > > entries to userspace, which otherwise would be listed as 'temp'. > > > > Before patch: > > > > ~# bridge mdb add dev br0 port br0 grp 01:00:00:c0:ff:ee permanent > > Error: bridge: Flags are not allowed for host groups. > > ~# bridge mdb add dev br0 port br0 grp 01:00:00:c0:ff:ee > > Error: bridge: Only permanent L2 entries allowed. > > > > After patch: > > > > ~# bridge mdb add dev br0 port br0 grp 01:00:00:c0:ff:ee permanent > > ~# bridge mdb show > > dev br0 port br0 grp 01:00:00:c0:ff:ee permanent vid 1 > > > > Signed-off-by: Joachim Wiberg <troglobit@gmail.com> > > It would be nice to add a selftest for L2 entries. You can send it as a follow-up. Let's wait for that, also checkpatch says you need to balance brackets to hold kernel coding style. > Acked-by: Nikolay Aleksandrov <razor@blackwall.org>
On Thu, Feb 24, 2022 at 08:06, Jakub Kicinski <kuba@kernel.org> wrote: > On Thu, 24 Feb 2022 13:26:22 +0200 Nikolay Aleksandrov wrote: >> On 23/02/2022 19:24, Joachim Wiberg wrote: >> > This patch expands on the earlier work on layer-2 mdb entries by adding >> > support for host entries. >> It would be nice to add a selftest for L2 entries. You can send it as a follow-up. > Let's wait for that, also checkpatch says you need to balance brackets > to hold kernel coding style. Jakub, by "wait for that" do you mean you'd prefer I add the selftests to this? Otherwise I'll send a v2 with the style fixes. Best regards /Joachim
On Thu, 24 Feb 2022 17:29:35 +0100 Joachim Wiberg wrote: > On Thu, Feb 24, 2022 at 08:06, Jakub Kicinski <kuba@kernel.org> wrote: > > On Thu, 24 Feb 2022 13:26:22 +0200 Nikolay Aleksandrov wrote: > >> On 23/02/2022 19:24, Joachim Wiberg wrote: > [...] > >> It would be nice to add a selftest for L2 entries. You can send it as a follow-up. > > Let's wait for that, also checkpatch says you need to balance brackets > > to hold kernel coding style. > > Jakub, by "wait for that" do you mean you'd prefer I add the selftests > to this? Yes, add a selftest as a separate patch but in the same series.
On Thu, Feb 24, 2022 at 08:48, Jakub Kicinski <kuba@kernel.org> wrote: > On Thu, 24 Feb 2022 17:29:35 +0100 Joachim Wiberg wrote: >> On Thu, Feb 24, 2022 at 08:06, Jakub Kicinski <kuba@kernel.org> wrote: >> > On Thu, 24 Feb 2022 13:26:22 +0200 Nikolay Aleksandrov wrote: >> >> On 23/02/2022 19:24, Joachim Wiberg wrote: >> [...] >> >> It would be nice to add a selftest for L2 entries. You can send it as a follow-up. >> > Let's wait for that, also checkpatch says you need to balance brackets >> > to hold kernel coding style. >> Jakub, by "wait for that" do you mean you'd prefer I add the selftests >> to this? > Yes, add a selftest as a separate patch but in the same series. OK, will do, thanks! :) Regards /Joachim
diff --git a/net/bridge/br_mdb.c b/net/bridge/br_mdb.c index 4556d913955b..9ba5c5cc2f3d 100644 --- a/net/bridge/br_mdb.c +++ b/net/bridge/br_mdb.c @@ -257,8 +257,10 @@ static int __mdb_fill_info(struct sk_buff *skb, else if (mp->addr.proto == htons(ETH_P_IPV6)) e.addr.u.ip6 = mp->addr.dst.ip6; #endif - else + else { ether_addr_copy(e.addr.u.mac_addr, mp->addr.dst.mac_addr); + e.state = MDB_PG_FLAGS_PERMANENT; + } e.addr.proto = mp->addr.proto; nest_ent = nla_nest_start_noflag(skb, MDBA_MDB_ENTRY_INFO); @@ -873,8 +875,8 @@ static int br_mdb_add_group(struct net_bridge *br, struct net_bridge_port *port, return -EINVAL; /* host join errors which can happen before creating the group */ - if (!port) { - /* don't allow any flags for host-joined groups */ + if (!port && !br_group_is_l2(&group)) { + /* don't allow any flags for host-joined IP groups */ if (entry->state) { NL_SET_ERR_MSG_MOD(extack, "Flags are not allowed for host groups"); return -EINVAL;
This patch expands on the earlier work on layer-2 mdb entries by adding support for host entries. Due to the fact that host joined entries do not have any flag field, we infer the permanent flag when reporting the entries to userspace, which otherwise would be listed as 'temp'. Before patch: ~# bridge mdb add dev br0 port br0 grp 01:00:00:c0:ff:ee permanent Error: bridge: Flags are not allowed for host groups. ~# bridge mdb add dev br0 port br0 grp 01:00:00:c0:ff:ee Error: bridge: Only permanent L2 entries allowed. After patch: ~# bridge mdb add dev br0 port br0 grp 01:00:00:c0:ff:ee permanent ~# bridge mdb show dev br0 port br0 grp 01:00:00:c0:ff:ee permanent vid 1 Signed-off-by: Joachim Wiberg <troglobit@gmail.com> --- net/bridge/br_mdb.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)