diff options
author | Ido Schimmel <idosch@mellanox.com> | 2017-05-26 08:37:36 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-05-26 15:18:48 -0400 |
commit | 1b8f09a05f33dbced2e48cd1c6d3ee524739ff63 (patch) | |
tree | 82cfb5023ce63fdfd75bdcb5435ead9e64cc9b27 /drivers | |
parent | ab01ae916911d11af9f4375b8276378b9474400c (diff) |
mlxsw: spectrum_router: Destroy RIF only based on its struct
Now that all the information to create a RIF is contained within the RIF
struct itself, we can also simplify the destruction logic.
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c index 73cc5195068f..41c85dcfa99f 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c @@ -3091,11 +3091,9 @@ err_vr_get: } static void -mlxsw_sp_port_vlan_rif_sp_destroy(struct mlxsw_sp_port_vlan *mlxsw_sp_port_vlan, +mlxsw_sp_port_vlan_rif_sp_destroy(struct mlxsw_sp *mlxsw_sp, struct mlxsw_sp_rif *rif) { - struct mlxsw_sp_port *mlxsw_sp_port = mlxsw_sp_port_vlan->mlxsw_sp_port; - struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; struct mlxsw_sp_vr *vr = &mlxsw_sp->router->vrs[rif->vr_id]; struct net_device *l3_dev = rif->dev; struct mlxsw_sp_fid *f = rif->f; @@ -3124,11 +3122,12 @@ mlxsw_sp_port_vlan_rif_sp_join(struct mlxsw_sp_port_vlan *mlxsw_sp_port_vlan, struct net_device *l3_dev) { struct mlxsw_sp_port *mlxsw_sp_port = mlxsw_sp_port_vlan->mlxsw_sp_port; + struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; u16 vid = mlxsw_sp_port_vlan->vid; struct mlxsw_sp_rif *rif; int err; - rif = mlxsw_sp_rif_find_by_dev(mlxsw_sp_port->mlxsw_sp, l3_dev); + rif = mlxsw_sp_rif_find_by_dev(mlxsw_sp, l3_dev); if (!rif) { rif = mlxsw_sp_port_vlan_rif_sp_create(mlxsw_sp_port_vlan, l3_dev); @@ -3163,7 +3162,7 @@ err_port_vid_stp_set: mlxsw_sp_port_vid_learning_set(mlxsw_sp_port, vid, true); err_port_vid_learning_set: if (rif->f->ref_count == 0) - mlxsw_sp_port_vlan_rif_sp_destroy(mlxsw_sp_port_vlan, rif); + mlxsw_sp_port_vlan_rif_sp_destroy(mlxsw_sp, rif); return err; } @@ -3171,6 +3170,7 @@ static void mlxsw_sp_port_vlan_rif_sp_leave(struct mlxsw_sp_port_vlan *mlxsw_sp_port_vlan) { struct mlxsw_sp_port *mlxsw_sp_port = mlxsw_sp_port_vlan->mlxsw_sp_port; + struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; struct mlxsw_sp_fid *fid = mlxsw_sp_port_vlan->fid; u16 vid = mlxsw_sp_port_vlan->vid; @@ -3184,7 +3184,7 @@ mlxsw_sp_port_vlan_rif_sp_leave(struct mlxsw_sp_port_vlan *mlxsw_sp_port_vlan) mlxsw_sp_port_vid_learning_set(mlxsw_sp_port, vid, true); if (fid->ref_count == 0) - mlxsw_sp_port_vlan_rif_sp_destroy(mlxsw_sp_port_vlan, fid->rif); + mlxsw_sp_port_vlan_rif_sp_destroy(mlxsw_sp, fid->rif); } static int mlxsw_sp_inetaddr_port_vlan_event(struct net_device *l3_dev, |