提交 0fb5fe3c 编写于 作者: A Arkadi Sharshevsky 提交者: David S. Miller

mlxsw: spectrum_dpipe: Add support for controlling IPv6 neighbor counters

Add support for controlling IPv6 neighbor counters via dpipe.
Signed-off-by: NArkadi Sharshevsky <arkadis@mellanox.com>
Signed-off-by: NJiri Pirko <jiri@mellanox.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 1ed5574c
...@@ -679,8 +679,15 @@ mlxsw_sp_dpipe_table_host_counters_update(struct mlxsw_sp *mlxsw_sp, ...@@ -679,8 +679,15 @@ mlxsw_sp_dpipe_table_host_counters_update(struct mlxsw_sp *mlxsw_sp,
if (!rif) if (!rif)
continue; continue;
mlxsw_sp_rif_neigh_for_each(neigh_entry, rif) { mlxsw_sp_rif_neigh_for_each(neigh_entry, rif) {
if (mlxsw_sp_neigh_entry_type(neigh_entry) != type) int neigh_type = mlxsw_sp_neigh_entry_type(neigh_entry);
if (neigh_type != type)
continue;
if (neigh_type == AF_INET6 &&
mlxsw_sp_neigh_ipv6_ignore(neigh_entry))
continue; continue;
mlxsw_sp_neigh_entry_counter_update(mlxsw_sp, mlxsw_sp_neigh_entry_counter_update(mlxsw_sp,
neigh_entry, neigh_entry,
enable); enable);
...@@ -778,6 +785,14 @@ mlxsw_sp_dpipe_table_host6_entries_dump(void *priv, bool counters_enabled, ...@@ -778,6 +785,14 @@ mlxsw_sp_dpipe_table_host6_entries_dump(void *priv, bool counters_enabled,
dump_ctx, AF_INET6); dump_ctx, AF_INET6);
} }
static int mlxsw_sp_dpipe_table_host6_counters_update(void *priv, bool enable)
{
struct mlxsw_sp *mlxsw_sp = priv;
mlxsw_sp_dpipe_table_host_counters_update(mlxsw_sp, enable, AF_INET6);
return 0;
}
static u64 mlxsw_sp_dpipe_table_host6_size_get(void *priv) static u64 mlxsw_sp_dpipe_table_host6_size_get(void *priv)
{ {
struct mlxsw_sp *mlxsw_sp = priv; struct mlxsw_sp *mlxsw_sp = priv;
...@@ -789,6 +804,7 @@ static struct devlink_dpipe_table_ops mlxsw_sp_host6_ops = { ...@@ -789,6 +804,7 @@ static struct devlink_dpipe_table_ops mlxsw_sp_host6_ops = {
.matches_dump = mlxsw_sp_dpipe_table_host6_matches_dump, .matches_dump = mlxsw_sp_dpipe_table_host6_matches_dump,
.actions_dump = mlxsw_sp_dpipe_table_host_actions_dump, .actions_dump = mlxsw_sp_dpipe_table_host_actions_dump,
.entries_dump = mlxsw_sp_dpipe_table_host6_entries_dump, .entries_dump = mlxsw_sp_dpipe_table_host6_entries_dump,
.counters_set_update = mlxsw_sp_dpipe_table_host6_counters_update,
.size_get = mlxsw_sp_dpipe_table_host6_size_get, .size_get = mlxsw_sp_dpipe_table_host6_size_get,
}; };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册