mlxsw: spectrum_router: Extract mlxsw_sp_ipip_entry_ol_down_event()
authorPetr Machata <petrm@mellanox.com>
Fri, 3 Nov 2017 09:03:33 +0000 (10:03 +0100)
committerDavid S. Miller <davem@davemloft.net>
Sat, 4 Nov 2017 00:15:17 +0000 (09:15 +0900)
Signed-off-by: Petr Machata <petrm@mellanox.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c

index ec90c6b6d1264a4ae26ad28d370f6b7096038160..da8fe7ef8f1d545382bcf608ae132c6dd9779be1 100644 (file)
@@ -1332,14 +1332,22 @@ static int mlxsw_sp_netdevice_ipip_ol_up_event(struct mlxsw_sp *mlxsw_sp,
        return 0;
 }
 
+static void
+mlxsw_sp_ipip_entry_ol_down_event(struct mlxsw_sp *mlxsw_sp,
+                                 struct mlxsw_sp_ipip_entry *ipip_entry)
+{
+       if (ipip_entry->decap_fib_entry)
+               mlxsw_sp_ipip_entry_demote_decap(mlxsw_sp, ipip_entry);
+}
+
 static void mlxsw_sp_netdevice_ipip_ol_down_event(struct mlxsw_sp *mlxsw_sp,
                                                  struct net_device *ol_dev)
 {
        struct mlxsw_sp_ipip_entry *ipip_entry;
 
        ipip_entry = mlxsw_sp_ipip_entry_find_by_ol_dev(mlxsw_sp, ol_dev);
-       if (ipip_entry && ipip_entry->decap_fib_entry)
-               mlxsw_sp_ipip_entry_demote_decap(mlxsw_sp, ipip_entry);
+       if (ipip_entry)
+               mlxsw_sp_ipip_entry_ol_down_event(mlxsw_sp, ipip_entry);
 }
 
 static int mlxsw_sp_netdevice_ipip_ol_vrf_event(struct mlxsw_sp *mlxsw_sp,