netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Pirko <jiri@resnulli.us>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, arkadis@mellanox.com, idosch@mellanox.com,
	mlxsw@mellanox.com
Subject: [patch net-next repost 8/8] mlxsw: spectrum_dpipe: Add support for controlling IPv6 neighbor counters
Date: Thu, 31 Aug 2017 17:59:19 +0200	[thread overview]
Message-ID: <20170831155919.1366-9-jiri@resnulli.us> (raw)
In-Reply-To: <20170831155919.1366-1-jiri@resnulli.us>

From: Arkadi Sharshevsky <arkadis@mellanox.com>

Add support for controlling IPv6 neighbor counters via dpipe.

Signed-off-by: Arkadi Sharshevsky <arkadis@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c
index 75da2ef..51e6846 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c
@@ -679,8 +679,15 @@ mlxsw_sp_dpipe_table_host_counters_update(struct mlxsw_sp *mlxsw_sp,
 		if (!rif)
 			continue;
 		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;
+
 			mlxsw_sp_neigh_entry_counter_update(mlxsw_sp,
 							    neigh_entry,
 							    enable);
@@ -778,6 +785,14 @@ mlxsw_sp_dpipe_table_host6_entries_dump(void *priv, bool counters_enabled,
 						      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)
 {
 	struct mlxsw_sp *mlxsw_sp = priv;
@@ -789,6 +804,7 @@ static struct devlink_dpipe_table_ops mlxsw_sp_host6_ops = {
 	.matches_dump = mlxsw_sp_dpipe_table_host6_matches_dump,
 	.actions_dump = mlxsw_sp_dpipe_table_host_actions_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,
 };
 
-- 
2.9.3

  parent reply	other threads:[~2017-08-31 15:59 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-31 15:59 [patch net-next repost 0/8] mlxsw: Add IPv6 host dpipe table Jiri Pirko
2017-08-31 15:59 ` [patch net-next repost 1/8] devlink: Add IPv6 header for dpipe Jiri Pirko
2017-08-31 15:59 ` [patch net-next repost 2/8] mlxsw: spectrum_router: Export IPv6 link local address check helper Jiri Pirko
2017-08-31 15:59 ` [patch net-next repost 3/8] mlxsw: spectrum_dpipe: Add IPv6 host table initial support Jiri Pirko
2017-08-31 15:59 ` [patch net-next repost 4/8] mlxsw: spectrum_router: Add IPv6 neighbor access helper Jiri Pirko
2017-08-31 15:59 ` [patch net-next repost 5/8] mlxsw: spectrum_dpipe: Make host entry fill handler more generic Jiri Pirko
2017-08-31 15:59 ` [patch net-next repost 6/8] mlxsw: spectrum_dpipe: Add support for IPv6 host table dump Jiri Pirko
2017-08-31 15:59 ` [patch net-next repost 7/8] mlxsw: spectrum_router: Add support for setting counters on IPv6 neighbors Jiri Pirko
2017-08-31 15:59 ` Jiri Pirko [this message]
2017-08-31 21:43 ` [patch net-next repost 0/8] mlxsw: Add IPv6 host dpipe table David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170831155919.1366-9-jiri@resnulli.us \
    --to=jiri@resnulli.us \
    --cc=arkadis@mellanox.com \
    --cc=davem@davemloft.net \
    --cc=idosch@mellanox.com \
    --cc=mlxsw@mellanox.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).