diff options
author | Petr Machata <petrm@nvidia.com> | 2024-03-08 13:59:52 +0100 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2024-03-11 14:14:09 -0700 |
commit | 41acb5549e607d158395a6b1bbd8c6e05cbb280f (patch) | |
tree | 05a31fd82573893862cea230cd4659c17c49ef6a | |
parent | 10bf92fd775ec2c6af1127c04e54e5b7ad0d35de (diff) |
mlxsw: spectrum_router: Track NH ID's of group members
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>
Link: https://lore.kernel.org/r/184ceb6b154e08f5bcf116a705b0fcb01c31895c.1709901020.git.petrm@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
-rw-r--r-- | drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c | 2 |
1 files changed, 2 insertions, 0 deletions
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) |