@@ -1364,10 +1364,6 @@ static int mlxsw_sp_port_create(struct mlxsw_sp *mlxsw_sp, u8 local_port)
1364
1364
mlxsw_sp_port -> dev = dev ;
1365
1365
mlxsw_sp_port -> mlxsw_sp = mlxsw_sp ;
1366
1366
mlxsw_sp_port -> local_port = local_port ;
1367
- mlxsw_sp_port -> learning = 1 ;
1368
- mlxsw_sp_port -> learning_sync = 1 ;
1369
- mlxsw_sp_port -> uc_flood = 1 ;
1370
- mlxsw_sp_port -> pvid = 1 ;
1371
1367
bytes = DIV_ROUND_UP (VLAN_N_VID , BITS_PER_BYTE );
1372
1368
mlxsw_sp_port -> active_vlans = kzalloc (bytes , GFP_KERNEL );
1373
1369
if (!mlxsw_sp_port -> active_vlans ) {
@@ -1991,24 +1987,29 @@ static int mlxsw_sp_port_bridge_join(struct mlxsw_sp_port *mlxsw_sp_port)
1991
1987
*/
1992
1988
err = mlxsw_sp_port_kill_vid (dev , 0 , 1 );
1993
1989
if (err )
1994
- netdev_err ( dev , "Failed to remove VID 1\n" ) ;
1990
+ return err ;
1995
1991
1996
- return err ;
1992
+ mlxsw_sp_port -> learning = 1 ;
1993
+ mlxsw_sp_port -> learning_sync = 1 ;
1994
+ mlxsw_sp_port -> uc_flood = 1 ;
1995
+ mlxsw_sp_port -> bridged = 1 ;
1996
+
1997
+ return 0 ;
1997
1998
}
1998
1999
1999
2000
static int mlxsw_sp_port_bridge_leave (struct mlxsw_sp_port * mlxsw_sp_port )
2000
2001
{
2001
2002
struct net_device * dev = mlxsw_sp_port -> dev ;
2002
- int err ;
2003
+
2004
+ mlxsw_sp_port -> learning = 0 ;
2005
+ mlxsw_sp_port -> learning_sync = 0 ;
2006
+ mlxsw_sp_port -> uc_flood = 0 ;
2007
+ mlxsw_sp_port -> bridged = 0 ;
2003
2008
2004
2009
/* Add implicit VLAN interface in the device, so that untagged
2005
2010
* packets will be classified to the default vFID.
2006
2011
*/
2007
- err = mlxsw_sp_port_add_vid (dev , 0 , 1 );
2008
- if (err )
2009
- netdev_err (dev , "Failed to add VID 1\n" );
2010
-
2011
- return err ;
2012
+ return mlxsw_sp_port_add_vid (dev , 0 , 1 );
2012
2013
}
2013
2014
2014
2015
static bool mlxsw_sp_master_bridge_check (struct mlxsw_sp * mlxsw_sp ,
@@ -2358,16 +2359,18 @@ static int mlxsw_sp_netdevice_port_upper_event(struct net_device *dev,
2358
2359
} else if (netif_is_bridge_master (upper_dev )) {
2359
2360
if (info -> linking ) {
2360
2361
err = mlxsw_sp_port_bridge_join (mlxsw_sp_port );
2361
- if (err )
2362
+ if (err ) {
2362
2363
netdev_err (dev , "Failed to join bridge\n" );
2364
+ return NOTIFY_BAD ;
2365
+ }
2363
2366
mlxsw_sp_master_bridge_inc (mlxsw_sp , upper_dev );
2364
- mlxsw_sp_port -> bridged = 1 ;
2365
2367
} else {
2366
2368
err = mlxsw_sp_port_bridge_leave (mlxsw_sp_port );
2367
- if (err )
2368
- netdev_err (dev , "Failed to leave bridge\n" );
2369
- mlxsw_sp_port -> bridged = 0 ;
2370
2369
mlxsw_sp_master_bridge_dec (mlxsw_sp , upper_dev );
2370
+ if (err ) {
2371
+ netdev_err (dev , "Failed to leave bridge\n" );
2372
+ return NOTIFY_BAD ;
2373
+ }
2371
2374
}
2372
2375
} else if (netif_is_lag_master (upper_dev )) {
2373
2376
if (info -> linking ) {
0 commit comments