Skip to content

Commit e99eb57

Browse files
pmachatakuba-moo
authored andcommitted
net: nexthop: Have all NH notifiers carry NH ID
When sending the notifications to collect NH statistics for resilient groups, the driver will need to know the nexthop IDs in individual buckets to look up the right counter. To that end, move the nexthop ID from struct nh_notifier_grp_entry_info to nh_notifier_single_info. Signed-off-by: Petr Machata <petrm@nvidia.com> Reviewed-by: Ido Schimmel <idosch@nvidia.com> Link: https://lore.kernel.org/r/8f964cd50b1a56d3606ce7ab4c50354ae019c43b.1709901020.git.petrm@nvidia.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 2d32c49 commit e99eb57

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

include/net/nexthop.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,14 +185,14 @@ struct nh_notifier_single_info {
185185
__be32 ipv4;
186186
struct in6_addr ipv6;
187187
};
188+
u32 id;
188189
u8 is_reject:1,
189190
is_fdb:1,
190191
has_encap:1;
191192
};
192193

193194
struct nh_notifier_grp_entry_info {
194195
u8 weight;
195-
u32 id;
196196
struct nh_notifier_single_info nh;
197197
};
198198

net/ipv4/nexthop.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ __nh_notifier_single_info_init(struct nh_notifier_single_info *nh_info,
104104
else if (nh_info->gw_family == AF_INET6)
105105
nh_info->ipv6 = nhi->fib_nhc.nhc_gw.ipv6;
106106

107+
nh_info->id = nhi->nh_parent->id;
107108
nh_info->is_reject = nhi->reject_nh;
108109
nh_info->is_fdb = nhi->fdb_nh;
109110
nh_info->has_encap = !!nhi->fib_nhc.nhc_lwtstate;
@@ -150,7 +151,6 @@ static int nh_notifier_mpath_info_init(struct nh_notifier_info *info,
150151
struct nh_info *nhi;
151152

152153
nhi = rtnl_dereference(nhge->nh->nh_info);
153-
info->nh_grp->nh_entries[i].id = nhge->nh->id;
154154
info->nh_grp->nh_entries[i].weight = nhge->weight;
155155
__nh_notifier_single_info_init(&info->nh_grp->nh_entries[i].nh,
156156
nhi);

0 commit comments

Comments
 (0)