nexthop: Introduce to struct nh_grp_entry a per-type union
The values that a next-hop group needs to keep track of depend on the group type. Introduce a union to separate fields specific to the mpath groups from fields specific to other group types. Signed-off-by: Petr Machata <petrm@nvidia.com> Reviewed-by: Ido Schimmel <idosch@nvidia.com> Reviewed-by: David Ahern <dsahern@kernel.org> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
committed by
Jakub Kicinski
parent
79bc55e3fe
commit
b9bae61be4
@@ -66,7 +66,12 @@ struct nh_info {
|
||||
struct nh_grp_entry {
|
||||
struct nexthop *nh;
|
||||
u8 weight;
|
||||
atomic_t upper_bound;
|
||||
|
||||
union {
|
||||
struct {
|
||||
atomic_t upper_bound;
|
||||
} mpath;
|
||||
};
|
||||
|
||||
struct list_head nh_list;
|
||||
struct nexthop *nh_parent; /* nexthop of group with this entry */
|
||||
|
||||
Reference in New Issue
Block a user