[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f99c5f8c-b38c-5f0f-a7dc-64cabd0d117f@gmail.com>
Date: Wed, 30 Aug 2017 11:43:49 -0600
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 7/8] mlxsw: spectrum_router: Add support for
setting counters on IPv6 neighbors
On 8/30/17 6:03 AM, Jiri Pirko wrote:
> diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
> index db57c0c..0cf6810 100644
> --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
> +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
> @@ -1008,21 +1008,33 @@ mlxsw_sp_neigh_entry_remove(struct mlxsw_sp *mlxsw_sp,
> }
>
> static bool
> -mlxsw_sp_neigh4_counter_should_alloc(struct mlxsw_sp *mlxsw_sp)
> +mlxsw_sp_neigh_counter_should_alloc(struct mlxsw_sp *mlxsw_sp,
> + struct mlxsw_sp_neigh_entry *neigh_entry)
> {
> struct devlink *devlink;
> + const char *table_name;
> +
> + switch (mlxsw_sp_neigh_entry_type(neigh_entry)) {
> + case AF_INET:
> + table_name = MLXSW_SP_DPIPE_TABLE_NAME_HOST4;
> + break;
> + case AF_INET6:
> + table_name = MLXSW_SP_DPIPE_TABLE_NAME_HOST6;
> + break;
> + default:
> + WARN_ON(1);
Another unnecessary WARN_ON
> + return false;
> + }
>
> devlink = priv_to_devlink(mlxsw_sp->core);
> - return devlink_dpipe_table_counter_enabled(devlink,
> - MLXSW_SP_DPIPE_TABLE_NAME_HOST4);
> + return devlink_dpipe_table_counter_enabled(devlink, table_name);
> }
>
Powered by blists - more mailing lists