Commit 7654c109 authored by Jakub Kicinski's avatar Jakub Kicinski

Merge branch 'mlxsw-set-port-stp-state-on-bridge-enslavement'

Petr Machata says:

====================
mlxsw: Set port STP state on bridge enslavement

When the first port joins a LAG that already has a bridge upper, an
instance of struct mlxsw_sp_bridge_port is created for the LAG to keep
track of it as a bridge port. The bridge_port's STP state is initialized to
BR_STATE_DISABLED. This made sense previously, because mlxsw would only
ever allow a port to join a LAG if the LAG had no uppers. Thus if a
bridge_port was instantiated, it must have been because the LAG as such is
joining a bridge, and the STP state is correspondingly disabled.

However as of commit 2c5ffe8d ("mlxsw: spectrum: Permit enslavement to
netdevices with uppers"), mlxsw allows a port to join a LAG that is already
a member of a bridge. The STP state may be different than disabled in that
case. Initialize it properly by querying the actual state.

This bug may cause an issue as traffic on ports attached to a bridged LAG
gets dropped on ingress with discard_ingress_general counter bumped.

The above fix in patch #1. Patch #2 contains a selftest that would
sporadically reproduce the issue.
====================

Link: https://lore.kernel.org/r/cover.1691498735.git.petrm@nvidia.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents b77049f0 aae5bb8d
......@@ -490,7 +490,7 @@ mlxsw_sp_bridge_port_create(struct mlxsw_sp_bridge_device *bridge_device,
bridge_port->system_port = mlxsw_sp_port->local_port;
bridge_port->dev = brport_dev;
bridge_port->bridge_device = bridge_device;
bridge_port->stp_state = BR_STATE_DISABLED;
bridge_port->stp_state = br_port_get_stp_state(brport_dev);
bridge_port->flags = BR_LEARNING | BR_FLOOD | BR_LEARNING_SYNC |
BR_MCAST_FLOOD;
INIT_LIST_HEAD(&bridge_port->vlans_list);
......
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0
# Test enslavement to LAG with a clean slate.
# See $lib_dir/router_bridge_lag.sh for further details.
ALL_TESTS="
config_devlink_reload
config_enslave_h1
config_enslave_h2
config_enslave_h3
config_enslave_h4
config_enslave_swp1
config_enslave_swp2
config_enslave_swp3
config_enslave_swp4
config_wait
ping_ipv4
ping_ipv6
"
config_devlink_reload()
{
log_info "Devlink reload"
devlink_reload
}
config_enslave_h1()
{
config_enslave $h1 lag1
}
config_enslave_h2()
{
config_enslave $h2 lag4
}
config_enslave_h3()
{
config_enslave $h3 lag4
}
config_enslave_h4()
{
config_enslave $h4 lag1
}
lib_dir=$(dirname $0)/../../../net/forwarding
EXTRA_SOURCE="source $lib_dir/devlink_lib.sh"
source $lib_dir/router_bridge_lag.sh
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment