diff mbox series

[8/8] dpaa2-switch: cleanup the egress flood of an unused FDB

Message ID 20231204163528.1797565-9-ioana.ciornei@nxp.com (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series dpaa2-switch: small improvements | expand

Checks

Context Check Description
netdev/series_format warning Target tree name not specified in the subject
netdev/tree_selection success Guessed tree name to be net-next
netdev/ynl success Generated files up to date; no warnings/errors;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 1115 this patch: 1115
netdev/cc_maintainers success CCed 5 of 5 maintainers
netdev/build_clang success Errors and warnings before: 1142 this patch: 1142
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 1142 this patch: 1142
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 18 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Ioana Ciornei Dec. 4, 2023, 4:35 p.m. UTC
In case a switch interface is joining a bridge, its FDB might change. In
case this happens, we have to recreate the egress flood setup of the FDB
that we just left. For this to happen, keep track of the old FDB and
just call dpaa2_switch_fdb_set_egress_flood() on it.

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
---
 drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Jakub Kicinski Dec. 6, 2023, 4:04 a.m. UTC | #1
On Mon,  4 Dec 2023 18:35:28 +0200 Ioana Ciornei wrote:
> In case a switch interface is joining a bridge, its FDB might change. In
> case this happens, we have to recreate the egress flood setup of the FDB
> that we just left. For this to happen, keep track of the old FDB and
> just call dpaa2_switch_fdb_set_egress_flood() on it.

Is this not a fix? FWIW the commit message is a bit hard to parse,
rephrasing would help..
Ioana Ciornei Dec. 12, 2023, 12:09 p.m. UTC | #2
On Tue, Dec 05, 2023 at 08:04:55PM -0800, Jakub Kicinski wrote:
> On Mon,  4 Dec 2023 18:35:28 +0200 Ioana Ciornei wrote:
> > In case a switch interface is joining a bridge, its FDB might change. In
> > case this happens, we have to recreate the egress flood setup of the FDB
> > that we just left. For this to happen, keep track of the old FDB and
> > just call dpaa2_switch_fdb_set_egress_flood() on it.
> 
> Is this not a fix? FWIW the commit message is a bit hard to parse,
> rephrasing would help..

This is not actually fixing up an issue which can be seen but maybe it's
better to just have it through the net tree. I will split the patch set
and send some of them through net.

I'll rephrase the commit message and add a bit more information.
Jakub Kicinski Dec. 12, 2023, 4:25 p.m. UTC | #3
On Tue, 12 Dec 2023 14:09:43 +0200 Ioana Ciornei wrote:
> > Is this not a fix? FWIW the commit message is a bit hard to parse,
> > rephrasing would help..  
> 
> This is not actually fixing up an issue which can be seen but maybe it's
> better to just have it through the net tree. I will split the patch set
> and send some of them through net.
> 
> I'll rephrase the commit message and add a bit more information.

Same goes for all the other changes. You don't have to send the patches
to net if there's not user visible impact, just please add the
explanations to the commit messages.
diff mbox series

Patch

diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c
index dd878e87eef1..35f71c3668ba 100644
--- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c
+++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c
@@ -2008,6 +2008,7 @@  static int dpaa2_switch_port_bridge_join(struct net_device *netdev,
 {
 	struct ethsw_port_priv *port_priv = netdev_priv(netdev);
 	struct ethsw_core *ethsw = port_priv->ethsw_data;
+	struct dpaa2_switch_fdb *old_fdb = port_priv->fdb;
 	bool learn_ena;
 	int err;
 
@@ -2028,6 +2029,11 @@  static int dpaa2_switch_port_bridge_join(struct net_device *netdev,
 	if (err)
 		goto err_egress_flood;
 
+	/* Recreate the egress flood domain of the FDB that we just left. */
+	err = dpaa2_switch_fdb_set_egress_flood(ethsw, old_fdb->fdb_id);
+	if (err)
+		goto err_egress_flood;
+
 	err = switchdev_bridge_port_offload(netdev, netdev, NULL,
 					    &dpaa2_switch_port_switchdev_nb,
 					    &dpaa2_switch_port_switchdev_blocking_nb,