All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Machata <petrm@nvidia.com>
To: "David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	<netdev@vger.kernel.org>
Cc: Ido Schimmel <idosch@nvidia.com>, Petr Machata <petrm@nvidia.com>,
	"David Ahern" <dsahern@kernel.org>, Shuah Khan <shuah@kernel.org>,
	<mlxsw@nvidia.com>
Subject: [PATCH net-next 08/11] mlxsw: spectrum_router: Track NH ID's of group members
Date: Fri, 8 Mar 2024 13:59:52 +0100	[thread overview]
Message-ID: <184ceb6b154e08f5bcf116a705b0fcb01c31895c.1709901020.git.petrm@nvidia.com> (raw)
In-Reply-To: <cover.1709901020.git.petrm@nvidia.com>

The core interfaces for collecting per-NH statistics are built around
nexthops even for resilient groups. Because mlxsw models each bucket as a
nexthop, the core next hop that a given bucket contributes to needs to be
looked up. In order to be able to match the two up, we need to track
nexthop ID for members of group nexthop objects. For simplicity, do it for
all nexthop objects, not just group members.

Signed-off-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
---
 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
index 73a16c328252..922dcd9c0b5a 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
@@ -3083,6 +3083,7 @@ struct mlxsw_sp_nexthop {
 		struct mlxsw_sp_ipip_entry *ipip_entry;
 	};
 	struct mlxsw_sp_nexthop_counter *counter;
+	u32 id;		/* NH ID for members of a NH object group. */
 };
 
 static struct net_device *
@@ -5054,6 +5055,7 @@ mlxsw_sp_nexthop_obj_init(struct mlxsw_sp *mlxsw_sp,
 	mlxsw_sp_nexthop_counter_enable(mlxsw_sp, nh);
 	list_add_tail(&nh->router_list_node, &mlxsw_sp->router->nexthop_list);
 	nh->ifindex = dev->ifindex;
+	nh->id = nh_obj->id;
 
 	err = mlxsw_sp_nexthop_type_init(mlxsw_sp, nh, dev);
 	if (err)
-- 
2.43.0


  parent reply	other threads:[~2024-03-08 13:03 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-08 12:59 [PATCH net-next 00/11] mlxsw: Support for nexthop group statistics Petr Machata
2024-03-08 12:59 ` [PATCH net-next 01/11] net: nexthop: Initialize NH group ID in resilient NH group notifiers Petr Machata
2024-03-08 12:59 ` [PATCH net-next 02/11] net: nexthop: Have all NH notifiers carry NH ID Petr Machata
2024-03-08 12:59 ` [PATCH net-next 03/11] mlxsw: spectrum_router: Rename two functions Petr Machata
2024-03-08 12:59 ` [PATCH net-next 04/11] mlxsw: spectrum_router: Have mlxsw_sp_nexthop_counter_enable() return int Petr Machata
2024-03-08 12:59 ` [PATCH net-next 05/11] mlxsw: spectrum: Allow fetch-and-clear of flow counters Petr Machata
2024-03-08 12:59 ` [PATCH net-next 06/11] mlxsw: spectrum_router: Avoid allocating NH counters twice Petr Machata
2024-03-08 12:59 ` [PATCH net-next 07/11] mlxsw: spectrum_router: Add helpers for nexthop counters Petr Machata
2024-03-08 12:59 ` Petr Machata [this message]
2024-03-08 12:59 ` [PATCH net-next 09/11] mlxsw: spectrum_router: Support nexthop group hardware statistics Petr Machata
2024-03-08 12:59 ` [PATCH net-next 10/11] mlxsw: spectrum_router: Share nexthop counters in resilient groups Petr Machata
2024-03-08 12:59 ` [PATCH net-next 11/11] selftests: forwarding: Add a test for NH group stats Petr Machata
2024-03-08 17:03   ` Jakub Kicinski
2024-03-08 22:31     ` Petr Machata
2024-03-09  3:48       ` Jakub Kicinski
2024-03-09  4:47         ` David Ahern
2024-03-11 10:59         ` Petr Machata
2024-03-11 11:00           ` Petr Machata
2024-03-11 15:59             ` Jakub Kicinski
2024-03-11 16:30               ` Petr Machata
2024-03-11 17:52                 ` Jakub Kicinski
2024-03-11 22:00 ` [PATCH net-next 00/11] mlxsw: Support for nexthop group statistics patchwork-bot+netdevbpf

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=184ceb6b154e08f5bcf116a705b0fcb01c31895c.1709901020.git.petrm@nvidia.com \
    --to=petrm@nvidia.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=idosch@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=mlxsw@nvidia.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=shuah@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.