From: Jiri Pirko Subject: [patch net-next 05/16] mlxsw: spectrum_router: Extract mlxsw_sp_ipip_entry_ol_down_event() Date: Fri, 3 Nov 2017 10:03:33 +0100 Message-ID: <20171103090344.19444-6-jiri@resnulli.us> References: <20171103090344.19444-1-jiri@resnulli.us> Cc: davem@davemloft.net, petrm@mellanox.com, idosch@mellanox.com, mlxsw@mellanox.com To: netdev@vger.kernel.org Return-path: Received: from mail-wr0-f193.google.com ([209.85.128.193]:57290 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932190AbdKCJDu (ORCPT ); Fri, 3 Nov 2017 05:03:50 -0400 Received: by mail-wr0-f193.google.com with SMTP id r79so1849027wrb.13 for ; Fri, 03 Nov 2017 02:03:49 -0700 (PDT) In-Reply-To: <20171103090344.19444-1-jiri@resnulli.us> Sender: netdev-owner@vger.kernel.org List-ID: From: Petr Machata Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel Signed-off-by: Jiri Pirko --- drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c index ec90c6b..da8fe7e 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c @@ -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, -- 2.9.5