mlxsw: spectrum_router: Add nexthop group type field
authorIdo Schimmel <idosch@nvidia.com>
Fri, 13 Nov 2020 16:05:46 +0000 (18:05 +0200)
committerJakub Kicinski <kuba@kernel.org>
Sun, 15 Nov 2020 00:55:03 +0000 (16:55 -0800)
commita06191aabbb7f74de2feec346b2fb5cd39c3a51b
treee015acc046af47b1c59d9208e92cbfc47884e8ae
parent10502d055b4e64f043e6c52e59297b6870bdd16d
mlxsw: spectrum_router: Add nexthop group type field

Currently, the type (i.e., IPv4/IPv6) of the nexthop group is derived
from the neighbour table associated with the group.

This is problematic when nexthop objects are taken into account, as a
nexthop group object can contain both IPv4 and IPv6 nexthops.

Instead, add a new field that indicates the type of the group and
initialize it during the group's creation. Currently, the types are IPv4
('struct fib_info') and IPv6 ('struct fib6_info'). In the future another
type will be added for nexthop objects ('struct nexthop').

Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c