Re: [Bridge] [PATCH iproute2-next v5] iplink: bridge: Add support for bridge FDB learning limits

2023-10-19 Thread Petr Machata via Bridge
Johannes Nixdorf writes: > Support setting the FDB limit through ip link. The arguments is: > - fdb_max_learned: A 32-bit unsigned integer specifying the maximum > number of learned FDB entries, with 0 disabling > the limit. > > Also support reading

Re: [Bridge] [PATCH iproute2-next v3] iplink: bridge: Add support for bridge FDB learning limits

2023-09-06 Thread Petr Machata via Bridge
(I pruned the CC list, hopefully I didn't leave out anybody who cares.) Johannes Nixdorf via Bridge writes: > Support setting the FDB limit through ip link. The arguments is: > - fdb_max_learned_entries: A 32-bit unsigned integer specifying the > maximum number of

[Bridge] [PATCH net-next 02/17] net: switchdev: Add a helper to replay objects on a bridge port

2023-07-19 Thread Petr Machata via Bridge
When a front panel joins a bridge via another netdevice (typically a LAG), the driver needs to learn about the objects configured on the bridge port. When the bridge port is offloaded by the driver for the first time, this can be achieved by passing a notifier to switchdev_bridge_port_offload().

[Bridge] [PATCH net-next 01/17] net: bridge: br_switchdev: Tolerate -EOPNOTSUPP when replaying MDB

2023-07-19 Thread Petr Machata via Bridge
There are two kinds of MDB entries to be replayed: port MDB entries, and host MDB entries. They are both replayed by br_switchdev_mdb_replay(). If the driver supports one kind, but lacks the other, the first -EOPNOTSUPP returned terminates the whole replay, including any further still-supported

Re: [Bridge] llc needs namespace awareness asap, was Re: Patch fixing STP if bridge in non-default namespace.

2023-07-12 Thread Petr Machata via Bridge
(CC'ing bridge maintainers.) Kuniyuki Iwashima writes: > From: Harry Coin > Date: Tue, 11 Jul 2023 16:40:03 -0500 >> On 7/11/23 15:44, Andrew Lunn wrote: >> >> The current llc_rcv.c around line 166 in net/llc/llc_input.c has >> >> >> >>if (!net_eq(dev_net(dev), _net))

[Bridge] [PATCH net-next v3 15/16] selftests: forwarding: lib: Add helpers to build IGMP/MLD leave packets

2023-02-02 Thread Petr Machata via Bridge
The testsuite that checks for mcast_max_groups functionality will need to wipe the added groups as well. Add helpers to build an IGMP or MLD packets announcing that host is leaving a given group. Signed-off-by: Petr Machata Acked-by: Nikolay Aleksandrov ---

[Bridge] [PATCH net-next v3 16/16] selftests: forwarding: bridge_mdb_max: Add a new selftest

2023-02-02 Thread Petr Machata via Bridge
Add a suite covering mcast_n_groups and mcast_max_groups bridge features. Signed-off-by: Petr Machata --- Notes: v2: - Adjust the tests that check setting max below n and reset of max on VLAN snooping enablement - Make test naming uniform - Enable testing of control path

[Bridge] [PATCH net-next v3 10/16] selftests: forwarding: bridge_mdb: Fix a typo

2023-02-02 Thread Petr Machata via Bridge
Add the letter missing from the word "INCLUDE". Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel Acked-by: Nikolay Aleksandrov --- tools/testing/selftests/net/forwarding/bridge_mdb.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[Bridge] [PATCH net-next v3 14/16] selftests: forwarding: lib: Allow list of IPs for IGMPv3/MLDv2

2023-02-02 Thread Petr Machata via Bridge
The testsuite that checks for mcast_max_groups functionality will need to generate IGMP and MLD packets with configurable number of (S,G) addresses. To that end, further extend igmpv3_is_in_get() and mldv2_is_in_get() to allow a list of IP addresses instead of one address. Signed-off-by: Petr

[Bridge] [PATCH net-next v3 08/16] net: bridge: Add netlink knobs for number / maximum MDB entries

2023-02-02 Thread Petr Machata via Bridge
The previous patch added accounting for number of MDB entries per port and per port-VLAN, and the logic to verify that these values stay within configured bounds. However it didn't provide means to actually configure those bounds or read the occupancy. This patch does that. Two new netlink

[Bridge] [PATCH net-next v3 06/16] net: bridge: Add a tracepoint for MDB overflows

2023-02-02 Thread Petr Machata via Bridge
The following patch will add two more maximum MDB allowances to the global one, mcast_hash_max, that exists today. In all these cases, attempts to add MDB entries above the configured maximums through netlink, fail noisily and obviously. Such visibility is missing when adding entries through the

[Bridge] [PATCH net-next v3 04/16] net: bridge: Add br_multicast_del_port_group()

2023-02-02 Thread Petr Machata via Bridge
Since cleaning up the effects of br_multicast_new_port_group() just consists of delisting and freeing the memory, the function br_mdb_add_group_star_g() inlines the corresponding code. In the following patches, number of per-port and per-port-VLAN MDB entries is going to be maintained, and that

[Bridge] [PATCH net-next v3 02/16] net: bridge: Add extack to br_multicast_new_port_group()

2023-02-02 Thread Petr Machata via Bridge
Make it possible to set an extack in br_multicast_new_port_group(). Eventually, this function will check for per-port and per-port-vlan MDB maximums, and will use the extack to communicate the reason for the bounce. Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel Acked-by: Nikolay

[Bridge] [PATCH net-next v3 03/16] net: bridge: Move extack-setting to br_multicast_new_port_group()

2023-02-02 Thread Petr Machata via Bridge
Now that br_multicast_new_port_group() takes an extack argument, move setting the extack there. The downside is that the error messages end up being less specific (the function cannot distinguish between (S,G) and (*,G) groups). However, the alternative is to check in the caller whether the callee

[Bridge] [PATCH net-next v3 01/16] net: bridge: Set strict_start_type at two policies

2023-02-02 Thread Petr Machata via Bridge
Make any attributes newly-added to br_port_policy or vlan_tunnel_policy parsed strictly, to prevent userspace from passing garbage. Note that this patchset only touches the former policy. The latter was adjusted for completeness' sake. There do not appear to be other _deprecated calls with

[Bridge] [PATCH net-next v3 00/16] bridge: Limit number of MDB entries per port, port-vlan

2023-02-02 Thread Petr Machata via Bridge
The MDB maintained by the bridge is limited. When the bridge is configured for IGMP / MLD snooping, a buggy or malicious client can easily exhaust its capacity. In SW datapath, the capacity is configurable through the IFLA_BR_MCAST_HASH_MAX parameter, but ultimately is finite. Obviously a similar

Re: [Bridge] [PATCH net-next mlxsw v2 08/16] net: bridge: Add netlink knobs for number / maximum MDB entries

2023-02-02 Thread Petr Machata via Bridge
Nikolay Aleksandrov writes: > On 02/02/2023 10:52, Nikolay Aleksandrov wrote: >> On 01/02/2023 19:28, Petr Machata wrote: >>> +int br_multicast_vlan_ngroups_set_max(struct net_bridge *br, >>> + struct net_bridge_vlan *v, u32 max, >>> +

Re: [Bridge] [PATCH net-next mlxsw v2 07/16] net: bridge: Maintain number of MDB entries in net_bridge_mcast_port

2023-02-02 Thread Petr Machata via Bridge
Nikolay Aleksandrov writes: > On 01/02/2023 19:28, Petr Machata wrote: >> @@ -668,6 +692,82 @@ void br_multicast_del_group_src(struct >> net_bridge_group_src *src, >> __br_multicast_del_group_src(src); >> } >> >> +static int >> +br_multicast_port_ngroups_inc_one(struct

Re: [Bridge] [PATCH net-next mlxsw v2 00/16] bridge: Limit number of MDB entries per port, port-vlan

2023-02-02 Thread Petr Machata via Bridge
Jakub Kicinski writes: > On Wed, 1 Feb 2023 18:28:33 +0100 Petr Machata wrote: >> Subject: [PATCH net-next mlxsw v2 00/16] bridge: Limit number of MDB entries >> per port, port-vlan > > What do you mean by "net-next mlxsw"? > Is there a tree called "net-next mlxsw" somewhere? Sorry about

[Bridge] [PATCH net-next mlxsw v2 16/16] selftests: forwarding: bridge_mdb_max: Add a new selftest

2023-02-01 Thread Petr Machata via Bridge
Add a suite covering mcast_n_groups and mcast_max_groups bridge features. Signed-off-by: Petr Machata --- Notes: v2: - Adjust the tests that check setting max below n and reset of max on VLAN snooping enablement - Make test naming uniform - Enable testing of control path

[Bridge] [PATCH net-next mlxsw v2 15/16] selftests: forwarding: lib: Add helpers to build IGMP/MLD leave packets

2023-02-01 Thread Petr Machata via Bridge
The testsuite that checks for mcast_max_groups functionality will need to wipe the added groups as well. Add helpers to build an IGMP or MLD packets announcing that host is leaving a given group. Signed-off-by: Petr Machata Acked-by: Nikolay Aleksandrov ---

[Bridge] [PATCH net-next mlxsw v2 13/16] selftests: forwarding: lib: Parameterize IGMPv3/MLDv2 generation

2023-02-01 Thread Petr Machata via Bridge
In order to generate IGMPv3 and MLDv2 packets on the fly, the functions that generate these packets need to be able to generate packets for different groups and different sources. Generating MLDv2 packets further needs the source address of the packet for purposes of checksum calculation. Add the

[Bridge] [PATCH net-next mlxsw v2 14/16] selftests: forwarding: lib: Allow list of IPs for IGMPv3/MLDv2

2023-02-01 Thread Petr Machata via Bridge
The testsuite that checks for mcast_max_groups functionality will need to generate IGMP and MLD packets with configurable number of (S,G) addresses. To that end, further extend igmpv3_is_in_get() and mldv2_is_in_get() to allow a list of IP addresses instead of one address. Signed-off-by: Petr

[Bridge] [PATCH net-next mlxsw v2 12/16] selftests: forwarding: lib: Add helpers for checksum handling

2023-02-01 Thread Petr Machata via Bridge
In order to generate IGMPv3 and MLDv2 packets on the fly, we will need helpers to calculate the packet checksum. The approach presented in this patch revolves around payload templates for mausezahn. These are mausezahn-like payload strings (01:23:45:...) with possibly one 2-byte sequence replaced

[Bridge] [PATCH net-next mlxsw v2 09/16] selftests: forwarding: Move IGMP- and MLD-related functions to lib

2023-02-01 Thread Petr Machata via Bridge
These functions will be helpful for other testsuites as well. Extract them to a common place. Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel Acked-by: Nikolay Aleksandrov --- .../selftests/net/forwarding/bridge_mdb.sh| 49 ---

[Bridge] [PATCH net-next mlxsw v2 08/16] net: bridge: Add netlink knobs for number / maximum MDB entries

2023-02-01 Thread Petr Machata via Bridge
The previous patch added accounting for number of MDB entries per port and per port-VLAN, and the logic to verify that these values stay within configured bounds. However it didn't provide means to actually configure those bounds or read the occupancy. This patch does that. Two new netlink

[Bridge] [PATCH net-next mlxsw v2 10/16] selftests: forwarding: bridge_mdb: Fix a typo

2023-02-01 Thread Petr Machata via Bridge
Add the letter missing from the word "INCLUDE". Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel Acked-by: Nikolay Aleksandrov --- tools/testing/selftests/net/forwarding/bridge_mdb.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[Bridge] [PATCH net-next mlxsw v2 11/16] selftests: forwarding: lib: Add helpers for IP address handling

2023-02-01 Thread Petr Machata via Bridge
In order to generate IGMPv3 and MLDv2 packets on the fly, we will need helpers to expand IPv4 and IPv6 addresses given as parameters in mausezahn payload notation. Add helpers that do it. Signed-off-by: Petr Machata Acked-by: Nikolay Aleksandrov ---

[Bridge] [PATCH net-next mlxsw v2 07/16] net: bridge: Maintain number of MDB entries in net_bridge_mcast_port

2023-02-01 Thread Petr Machata via Bridge
The MDB maintained by the bridge is limited. When the bridge is configured for IGMP / MLD snooping, a buggy or malicious client can easily exhaust its capacity. In SW datapath, the capacity is configurable through the IFLA_BR_MCAST_HASH_MAX parameter, but ultimately is finite. Obviously a similar

[Bridge] [PATCH net-next mlxsw v2 05/16] net: bridge: Change a cleanup in br_multicast_new_port_group() to goto

2023-02-01 Thread Petr Machata via Bridge
This function is getting more to clean up in the following patches. Structuring the cleanups in one labeled block will allow reusing the same cleanup from several places. Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel Acked-by: Nikolay Aleksandrov --- net/bridge/br_multicast.c | 7

[Bridge] [PATCH net-next mlxsw v2 06/16] net: bridge: Add a tracepoint for MDB overflows

2023-02-01 Thread Petr Machata via Bridge
The following patch will add two more maximum MDB allowances to the global one, mcast_hash_max, that exists today. In all these cases, attempts to add MDB entries above the configured maximums through netlink, fail noisily and obviously. Such visibility is missing when adding entries through the

[Bridge] [PATCH net-next mlxsw v2 03/16] net: bridge: Move extack-setting to br_multicast_new_port_group()

2023-02-01 Thread Petr Machata via Bridge
Now that br_multicast_new_port_group() takes an extack argument, move setting the extack there. The downside is that the error messages end up being less specific (the function cannot distinguish between (S,G) and (*,G) groups). However, the alternative is to check in the caller whether the callee

[Bridge] [PATCH net-next mlxsw v2 04/16] net: bridge: Add br_multicast_del_port_group()

2023-02-01 Thread Petr Machata via Bridge
Since cleaning up the effects of br_multicast_new_port_group() just consists of delisting and freeing the memory, the function br_mdb_add_group_star_g() inlines the corresponding code. In the following patches, number of per-port and per-port-VLAN MDB entries is going to be maintained, and that

[Bridge] [PATCH net-next mlxsw v2 01/16] net: bridge: Set strict_start_type at two policies

2023-02-01 Thread Petr Machata via Bridge
Make any attributes newly-added to br_port_policy or vlan_tunnel_policy parsed strictly, to prevent userspace from passing garbage. Note that this patchset only touches the former policy. The latter was adjusted for completeness' sake. There do not appear to be other _deprecated calls with

[Bridge] [PATCH net-next mlxsw v2 02/16] net: bridge: Add extack to br_multicast_new_port_group()

2023-02-01 Thread Petr Machata via Bridge
Make it possible to set an extack in br_multicast_new_port_group(). Eventually, this function will check for per-port and per-port-vlan MDB maximums, and will use the extack to communicate the reason for the bounce. Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel Acked-by: Nikolay

[Bridge] [PATCH net-next mlxsw v2 00/16] bridge: Limit number of MDB entries per port, port-vlan

2023-02-01 Thread Petr Machata via Bridge
The MDB maintained by the bridge is limited. When the bridge is configured for IGMP / MLD snooping, a buggy or malicious client can easily exhaust its capacity. In SW datapath, the capacity is configurable through the IFLA_BR_MCAST_HASH_MAX parameter, but ultimately is finite. Obviously a similar

Re: [Bridge] [PATCH net-next 06/16] net: bridge: Add a tracepoint for MDB overflows

2023-01-30 Thread Petr Machata via Bridge
Steven Rostedt writes: > On Thu, 26 Jan 2023 18:01:14 +0100 > Petr Machata wrote: > >> +TP_printk("dev %s af %u src %pI4/%pI6c grp %pI4/%pI6c/%pM vid %u", >> + __get_str(dev), __entry->af, __entry->src4, __entry->src6, >> + __entry->grp4, __entry->grp6,

Re: [Bridge] [PATCH net-next 08/16] net: bridge: Add netlink knobs for number / maximum MDB entries

2023-01-30 Thread Petr Machata via Bridge
Nikolay Aleksandrov writes: > On 26/01/2023 19:01, Petr Machata wrote: >> diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c >> index de531109b947..04261dd2380b 100644 >> --- a/net/bridge/br_multicast.c >> +++ b/net/bridge/br_multicast.c >> @@ -766,6 +766,102 @@ static void

Re: [Bridge] [PATCH net-next 07/16] net: bridge: Maintain number of MDB entries in net_bridge_mcast_port

2023-01-30 Thread Petr Machata via Bridge
Nikolay Aleksandrov writes: > On 26/01/2023 19:01, Petr Machata wrote: >> Note that the per-port-VLAN mcast_max_groups value gets reset when VLAN >> snooping is enabled. The reason for this is that while VLAN snooping is >> disabled, permanent entries can be added above the limit imposed by

Re: [Bridge] [PATCH net-next 06/16] net: bridge: Add a tracepoint for MDB overflows

2023-01-27 Thread Petr Machata via Bridge
Steven Rostedt writes: >> diff --git a/include/trace/events/bridge.h b/include/trace/events/bridge.h >> index 6b200059c2c5..00d5e2dcb3ad 100644 >> --- a/include/trace/events/bridge.h >> +++ b/include/trace/events/bridge.h >> @@ -122,6 +122,73 @@ TRACE_EVENT(br_fdb_update, >>

[Bridge] [PATCH net-next 15/16] selftests: forwarding: lib: Add helpers to build IGMP/MLD leave packets

2023-01-26 Thread Petr Machata via Bridge
The testsuite that checks for mcast_max_groups functionality will need to wipe the added groups as well. Add helpers to build an IGMP or MLD packets announcing that host is leaving a given group. Signed-off-by: Petr Machata --- tools/testing/selftests/net/forwarding/lib.sh | 50

[Bridge] [PATCH net-next 16/16] selftests: forwarding: bridge_mdb_max: Add a new selftest

2023-01-26 Thread Petr Machata via Bridge
Add a suite covering mcast_n_groups and mcast_max_groups bridge features. Signed-off-by: Petr Machata --- .../testing/selftests/net/forwarding/Makefile | 1 + .../net/forwarding/bridge_mdb_max.sh | 970 ++ 2 files changed, 971 insertions(+) create mode 100755

[Bridge] [PATCH net-next 13/16] selftests: forwarding: lib: Parameterize IGMPv3/MLDv2 generation

2023-01-26 Thread Petr Machata via Bridge
In order to generate IGMPv3 and MLDv2 packets on the fly, the functions that generate these packets need to be able to generate packets for different groups and different sources. Generating MLDv2 packets further needs the source address of the packet for purposes of checksum calculation. Add the

[Bridge] [PATCH net-next 14/16] selftests: forwarding: lib: Allow list of IPs for IGMPv3/MLDv2

2023-01-26 Thread Petr Machata via Bridge
The testsuite that checks for mcast_max_groups functionality will need to generate IGMP and MLD packets with configurable number of (S,G) addresses. To that end, further extend igmpv3_is_in_get() and mldv2_is_in_get() to allow a list of IP addresses instead of one address. Signed-off-by: Petr

[Bridge] [PATCH net-next 12/16] selftests: forwarding: lib: Add helpers for checksum handling

2023-01-26 Thread Petr Machata via Bridge
In order to generate IGMPv3 and MLDv2 packets on the fly, we will need helpers to calculate the packet checksum. The approach presented in this patch revolves around payload templates for mausezahn. These are mausezahn-like payload strings (01:23:45:...) with possibly one 2-byte sequence replaced

[Bridge] [PATCH net-next 10/16] selftests: forwarding: bridge_mdb: Fix a typo

2023-01-26 Thread Petr Machata via Bridge
Add the letter missing from the word "INCLUDE". Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel --- tools/testing/selftests/net/forwarding/bridge_mdb.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/net/forwarding/bridge_mdb.sh

[Bridge] [PATCH net-next 11/16] selftests: forwarding: lib: Add helpers for IP address handling

2023-01-26 Thread Petr Machata via Bridge
In order to generate IGMPv3 and MLDv2 packets on the fly, we will need helpers to expand IPv4 and IPv6 addresses given as parameters in mausezahn payload notation. Add helpers that do it. Signed-off-by: Petr Machata --- tools/testing/selftests/net/forwarding/lib.sh | 37 +++ 1

[Bridge] [PATCH net-next 07/16] net: bridge: Maintain number of MDB entries in net_bridge_mcast_port

2023-01-26 Thread Petr Machata via Bridge
The MDB maintained by the bridge is limited. When the bridge is configured for IGMP / MLD snooping, a buggy or malicious client can easily exhaust its capacity. In SW datapath, the capacity is configurable through the IFLA_BR_MCAST_HASH_MAX parameter, but ultimately is finite. Obviously a similar

[Bridge] [PATCH net-next 08/16] net: bridge: Add netlink knobs for number / maximum MDB entries

2023-01-26 Thread Petr Machata via Bridge
The previous patch added accounting for number of MDB entries per port and per port-VLAN, and the logic to verify that these values stay within configured bounds. However it didn't provide means to actually configure those bounds or read the occupancy. This patch does that. Two new netlink

[Bridge] [PATCH net-next 05/16] net: bridge: Change a cleanup in br_multicast_new_port_group() to goto

2023-01-26 Thread Petr Machata via Bridge
This function is getting more to clean up in the following patches. Structuring the cleanups in one labeled block will allow reusing the same cleanup from several places. Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel --- net/bridge/br_multicast.c | 7 +-- 1 file changed, 5

[Bridge] [PATCH net-next 09/16] selftests: forwarding: Move IGMP- and MLD-related functions to lib

2023-01-26 Thread Petr Machata via Bridge
These functions will be helpful for other testsuites as well. Extract them to a common place. Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel --- .../selftests/net/forwarding/bridge_mdb.sh| 49 --- tools/testing/selftests/net/forwarding/lib.sh | 49 +++

[Bridge] [PATCH net-next 06/16] net: bridge: Add a tracepoint for MDB overflows

2023-01-26 Thread Petr Machata via Bridge
The following patch will add two more maximum MDB allowances to the global one, mcast_hash_max, that exists today. In all these cases, attempts to add MDB entries above the configured maximums through netlink, fail noisily and obviously. Such visibility is missing when adding entries through the

[Bridge] [PATCH net-next 04/16] net: bridge: Add br_multicast_del_port_group()

2023-01-26 Thread Petr Machata via Bridge
Since cleaning up the effects of br_multicast_new_port_group() just consists of delisting and freeing the memory, the function br_mdb_add_group_star_g() inlines the corresponding code. In the following patches, number of per-port and per-port-VLAN MDB entries is going to be maintained, and that

[Bridge] [PATCH net-next 02/16] net: bridge: Add extack to br_multicast_new_port_group()

2023-01-26 Thread Petr Machata via Bridge
Make it possible to set an extack in br_multicast_new_port_group(). Eventually, this function will check for per-port and per-port-vlan MDB maximums, and will use the extack to communicate the reason for the bounce. Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel --- net/bridge/br_mdb.c

[Bridge] [PATCH net-next 03/16] net: bridge: Move extack-setting to br_multicast_new_port_group()

2023-01-26 Thread Petr Machata via Bridge
Now that br_multicast_new_port_group() takes an extack argument, move setting the extack there. The downside is that the error messages end up being less specific (the function cannot distinguish between (S,G) and (*,G) groups). However, the alternative is to check in the caller whether the callee

[Bridge] [PATCH net-next 00/16] bridge: Limit number of MDB entries per port, port-vlan

2023-01-26 Thread Petr Machata via Bridge
The MDB maintained by the bridge is limited. When the bridge is configured for IGMP / MLD snooping, a buggy or malicious client can easily exhaust its capacity. In SW datapath, the capacity is configurable through the IFLA_BR_MCAST_HASH_MAX parameter, but ultimately is finite. Obviously a similar

[Bridge] [PATCH net-next 01/16] net: bridge: Set strict_start_type at two policies

2023-01-26 Thread Petr Machata via Bridge
Make any attributes newly-added to br_port_policy or vlan_tunnel_policy parsed strictly, to prevent userspace from passing garbage. Note that this patchset only touches the former policy. The latter was adjusted for completeness' sake. There do not appear to be other _deprecated calls with

[Bridge] [PATCH net-next 14/15] selftests: mlxsw: Add a test for locked port trap

2022-11-08 Thread Petr Machata via Bridge
From: Ido Schimmel Test that packets received via a locked bridge port whose {SMAC, VID} does not appear in the bridge's FDB or appears with a different port, trigger the "locked_port" packet trap. Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Signed-off-by: Petr Machata ---

[Bridge] [PATCH net-next 11/15] mlxsw: spectrum_switchdev: Add locked bridge port support

2022-11-08 Thread Petr Machata via Bridge
From: Ido Schimmel Add locked bridge port support by reacting to changes in the 'BR_PORT_LOCKED' flag. When set, enable security checks on the local port via the previously added SPFSR register. When security checks are enabled, an incoming packet will trigger an FDB lookup with the packet's

[Bridge] [PATCH net-next 15/15] selftests: mlxsw: Add a test for invalid locked bridge port configurations

2022-11-08 Thread Petr Machata via Bridge
From: Ido Schimmel Test that locked bridge port configurations that are not supported by mlxsw are rejected. Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Signed-off-by: Petr Machata --- .../selftests/drivers/net/mlxsw/rtnetlink.sh | 31 +++ 1 file changed, 31

[Bridge] [PATCH net-next 12/15] selftests: devlink_lib: Split out helper

2022-11-08 Thread Petr Machata via Bridge
From: Ido Schimmel Merely checking whether a trap counter incremented or not without logging a test result is useful on its own. Split this functionality to a helper which will be used by subsequent patches. Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Signed-off-by: Petr Machata

[Bridge] [PATCH net-next 09/15] mlxsw: spectrum_switchdev: Add support for locked FDB notifications

2022-11-08 Thread Petr Machata via Bridge
From: Ido Schimmel In Spectrum, learning happens in parallel to the security checks. Therefore, regardless of the result of the security checks, a learning notification will be generated by the device and polled later on by the driver. Currently, the driver reacts to learning notifications by

[Bridge] [PATCH net-next 05/15] mlxsw: spectrum_trap: Register 802.1X packet traps with devlink

2022-11-08 Thread Petr Machata via Bridge
From: Ido Schimmel Register the previously added packet traps with devlink. This allows user space to tune their policers and in the case of the locked port trap, user space can set its action to "trap" in order to gain visibility into packets that were discarded by the device due to the locked

[Bridge] [PATCH net-next 07/15] mlxsw: spectrum: Add an API to configure security checks

2022-11-08 Thread Petr Machata via Bridge
From: Ido Schimmel Add an API to enable or disable security checks on a local port. It will be used by subsequent patches when the 'BR_PORT_LOCKED' flag is toggled. Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Signed-off-by: Petr Machata ---

[Bridge] [PATCH net-next 04/15] devlink: Add packet traps for 802.1X operation

2022-11-08 Thread Petr Machata via Bridge
From: Ido Schimmel Add packet traps for 802.1X operation. The "eapol" control trap is used to trap EAPOL packets and is required for the correct operation of the control plane. The "locked_port" drop trap can be enabled to gain visibility into packets that were dropped by the device due to the

[Bridge] [PATCH net-next 02/15] bridge: switchdev: Allow device drivers to install locked FDB entries

2022-11-08 Thread Petr Machata via Bridge
From: Hans J. Schultz When the bridge is offloaded to hardware, FDB entries are learned and aged-out by the hardware. Some device drivers synchronize the hardware and software FDBs by generating switchdev events towards the bridge. When a port is locked, the hardware must not learn

[Bridge] [PATCH net-next 01/15] bridge: switchdev: Let device drivers determine FDB offload indication

2022-11-08 Thread Petr Machata via Bridge
From: Ido Schimmel Currently, FDB entries that are notified to the bridge via 'SWITCHDEV_FDB_ADD_TO_BRIDGE' are always marked as offloaded. With MAB enabled, this will no longer be universally true. Device drivers will report locked FDB entries to the bridge to let it know that the corresponding

[Bridge] [PATCH net-next 00/15] mlxsw: Add 802.1X and MAB offload support

2022-11-08 Thread Petr Machata via Bridge
Ido Schimmel writes: This patchset adds 802.1X [1] and MAB [2] offload support in mlxsw. Patches #1-#3 add the required switchdev interfaces. Patches #4-#5 add the required packet traps for 802.1X. Patches #6-#10 are small preparations in mlxsw. Patch #11 adds locked bridge port support in

Re: [Bridge] [PATCH v5 net-next 6/6] selftests: forwarding: add test of MAC-Auth Bypass to locked port tests

2022-10-03 Thread Petr Machata via Bridge
net...@kapio-technology.com writes: > Thx, looks good. > I have tried to run the test as far as I can manually, but I don't seem to > have 'busywait' in the > system, which tc_check_packets() depends on, and I couldn't find any > 'busywait' in Buildroot. It's a helper defined in