Skip to content

Commit fe8ebf9

Browse files
committed
net: nexthop: Have all NH notifiers carry NH ID
JIRA: https://issues.redhat.com/browse/RHEL-59118 commit e99eb57 Author: Petr Machata <petrm@nvidia.com> Date: Fri Mar 8 13:59:46 2024 +0100 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> Signed-off-by: Ivan Vecera <ivecera@redhat.com>
1 parent c67b251 commit fe8ebf9

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

include/net/nexthop.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,14 +190,14 @@ struct nh_notifier_single_info {
190190
__be32 ipv4;
191191
struct in6_addr ipv6;
192192
};
193+
u32 id;
193194
u8 is_reject:1,
194195
is_fdb:1,
195196
has_encap:1;
196197
};
197198

198199
struct nh_notifier_grp_entry_info {
199200
u8 weight;
200-
u32 id;
201201
struct nh_notifier_single_info nh;
202202
};
203203

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)