[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <611f74bf-946d-1429-f002-bfcaa0261990@gmail.com>
Date: Thu, 24 Aug 2017 12:28:09 -0700
From: David Ahern <dsahern@...il.com>
To: Jiri Pirko <jiri@...nulli.us>, netdev@...r.kernel.org
Cc: davem@...emloft.net, arkadis@...lanox.com, idosch@...lanox.com,
mlxsw@...lanox.com
Subject: Re: [patch net-next 12/12] mlxsw: spectrum_dpipe: Add support for
controlling neighbor counters
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();
Powered by blists - more mailing lists