From: Petr Machata <petrm@nvidia.com>
To: "David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
<netdev@vger.kernel.org>
Cc: Ido Schimmel <idosch@nvidia.com>, Petr Machata <petrm@nvidia.com>,
Danielle Ratson <danieller@nvidia.com>, <mlxsw@nvidia.com>
Subject: [PATCH net-next 0/2] mlxsw: Set port STP state on bridge enslavement
Date: Tue, 8 Aug 2023 15:18:14 +0200 [thread overview]
Message-ID: <cover.1691498735.git.petrm@nvidia.com> (raw)
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 2c5ffe8d7226 ("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.
Petr Machata (2):
mlxsw: Set port STP state on bridge enslavement
selftests: mlxsw: router_bridge_lag: Add a new selftest
.../mellanox/mlxsw/spectrum_switchdev.c | 2 +-
.../drivers/net/mlxsw/router_bridge_lag.sh | 50 +++++++++++++++++++
2 files changed, 51 insertions(+), 1 deletion(-)
create mode 100755 tools/testing/selftests/drivers/net/mlxsw/router_bridge_lag.sh
--
2.41.0
next reply other threads:[~2023-08-08 15:42 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-08 13:18 Petr Machata [this message]
2023-08-08 13:18 ` [PATCH net-next 1/2] mlxsw: Set port STP state on bridge enslavement Petr Machata
2023-08-08 13:18 ` [PATCH net-next 2/2] selftests: mlxsw: router_bridge_lag: Add a new selftest Petr Machata
2023-08-09 14:50 ` [PATCH net-next 0/2] mlxsw: Set port STP state on bridge enslavement Simon Horman
2023-08-09 22:40 ` patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cover.1691498735.git.petrm@nvidia.com \
--to=petrm@nvidia.com \
--cc=danieller@nvidia.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=idosch@nvidia.com \
--cc=kuba@kernel.org \
--cc=mlxsw@nvidia.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).