From: Jiri Pirko <jiri@resnulli.us>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, idosch@mellanox.com, eladr@mellanox.com,
yotamg@mellanox.com, ogerlitz@mellanox.com
Subject: [patch net 04/11] mlxsw: spectrum: Don't forward packets when STP state is DISABLED
Date: Wed, 27 Jan 2016 15:20:19 +0100 [thread overview]
Message-ID: <1453904426-4960-5-git-send-email-jiri@resnulli.us> (raw)
In-Reply-To: <1453904426-4960-1-git-send-email-jiri@resnulli.us>
From: Ido Schimmel <idosch@mellanox.com>
When STP state is set to DISABLED the port is assumed to be inactive, but
currently we forward packets ingressing through it.
Instead, set the port's STP state in hardware to DISCARDING, which means
it doesn't forward packets or perform any learning, but it does trap
control packets. However, these packets will be dropped by bridge code,
which results in the expected behavior.
Fixes: 56ade8fe3fe1 ("mlxsw: spectrum: Add initial support for Spectrum ASIC")
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
---
drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c
index f627165..913488e 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c
@@ -125,7 +125,6 @@ static int mlxsw_sp_port_stp_state_set(struct mlxsw_sp_port *mlxsw_sp_port,
int err;
switch (state) {
- case BR_STATE_DISABLED: /* fall-through */
case BR_STATE_FORWARDING:
spms_state = MLXSW_REG_SPMS_STATE_FORWARDING;
break;
@@ -133,6 +132,7 @@ static int mlxsw_sp_port_stp_state_set(struct mlxsw_sp_port *mlxsw_sp_port,
case BR_STATE_LEARNING:
spms_state = MLXSW_REG_SPMS_STATE_LEARNING;
break;
+ case BR_STATE_DISABLED: /* fall-through */
case BR_STATE_BLOCKING:
spms_state = MLXSW_REG_SPMS_STATE_DISCARDING;
break;
--
1.9.3
next prev parent reply other threads:[~2016-01-27 14:20 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-27 14:20 [patch net 00/11] mlxsw: driver fixes Jiri Pirko
2016-01-27 14:20 ` [patch net 01/11] mlxsw: spectrum: Handle port leaving LAG while bridged Jiri Pirko
2016-01-27 14:20 ` [patch net 02/11] mlxsw: reg: Add the Switch Filtering DB Flush register Jiri Pirko
2016-01-27 14:20 ` [patch net 03/11] mlxsw: spectrum: Flush FDB when leaving bridge Jiri Pirko
2016-01-27 14:20 ` Jiri Pirko [this message]
2016-01-27 14:20 ` [patch net 05/11] mlxsw: spectrum: Disable learning according to STP state Jiri Pirko
2016-01-27 14:20 ` [patch net 06/11] mlxsw: spectrum: Notify bridge's FDB only based on learning_sync Jiri Pirko
2016-01-27 14:20 ` [patch net 07/11] mlxsw: spectrum: Don't report VLAN for 802.1D FDB entries Jiri Pirko
2016-01-27 14:20 ` [patch net 08/11] mlxsw: spectrum: Use correct netdev when notifying bridge Jiri Pirko
2016-01-27 14:20 ` [patch net 09/11] mlxsw: spectrum: Dump LAG FDB records only once Jiri Pirko
2016-01-27 14:20 ` [patch net 10/11] mlxsw: spectrum: Compare local ports instead of pointers Jiri Pirko
2016-01-27 14:20 ` [patch net 11/11] mlxsw: reg: Use correct offset in field definiton Jiri Pirko
2016-01-28 23:57 ` [patch net 00/11] mlxsw: driver fixes David Miller
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=1453904426-4960-5-git-send-email-jiri@resnulli.us \
--to=jiri@resnulli.us \
--cc=davem@davemloft.net \
--cc=eladr@mellanox.com \
--cc=idosch@mellanox.com \
--cc=netdev@vger.kernel.org \
--cc=ogerlitz@mellanox.com \
--cc=yotamg@mellanox.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).