On 8/23/17 11:40 PM, Jiri Pirko wrote:
> diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c 
> b/drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c
> index 94d954b..3c8599f 100644
> --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c
> +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c
> @@ -599,6 +599,38 @@ mlxsw_sp_dpipe_table_host4_entries_dump(void *priv, bool 
> counters_enabled,
>                                                     dump_ctx, AF_INET);
>  }
>  
> +static void
> +mlxsw_sp_dpipe_table_host_counters_update(struct mlxsw_sp *mlxsw_sp,
> +                                       bool enable, int type)
> +{
> +     int i;
> +
> +     rtnl_lock();

same question here. Why is rtnl lock needed?

> +     for (i = 0; i < MLXSW_CORE_RES_GET(mlxsw_sp->core, MAX_RIFS); i++) {
> +             struct mlxsw_sp_rif *rif = mlxsw_sp_rif_by_index(mlxsw_sp, i);
> +             struct mlxsw_sp_neigh_entry *neigh_entry;
> +
> +             if (!rif)
> +                     continue;
> +             mlxsw_sp_rif_neigh_for_each(neigh_entry, rif) {
> +                     if (mlxsw_sp_neigh_entry_type(neigh_entry) != type)
> +                             continue;
> +                     mlxsw_sp_neigh_entry_counter_update(mlxsw_sp,
> +                                                         neigh_entry,
> +                                                         enable);
> +             }
> +     }
> +     rtnl_unlock();


Reply via email to