Skip to content

Commit f4bbfe0

Browse files
committed
net: nexthop: Add hardware statistics notifications
JIRA: https://issues.redhat.com/browse/RHEL-59118 commit 5877786 Author: Ido Schimmel <idosch@nvidia.com> Date: Wed Mar 6 13:49:19 2024 +0100 net: nexthop: Add hardware statistics notifications Add hw_stats field to several notifier structures to communicate to the drivers that HW statistics should be configured for nexthops within a given group. Signed-off-by: Ido Schimmel <idosch@nvidia.com> Reviewed-by: David Ahern <dsahern@kernel.org> Signed-off-by: Petr Machata <petrm@nvidia.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Ivan Vecera <ivecera@redhat.com>
1 parent 0b05315 commit f4bbfe0

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

include/net/nexthop.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ struct nh_group {
132132
bool resilient;
133133
bool fdb_nh;
134134
bool has_v4;
135+
bool hw_stats;
135136

136137
RH_KABI_RESERVE(1)
137138
RH_KABI_RESERVE(2)
@@ -198,6 +199,7 @@ struct nh_notifier_grp_entry_info {
198199
struct nh_notifier_grp_info {
199200
u16 num_nh;
200201
bool is_fdb;
202+
bool hw_stats;
201203
struct nh_notifier_grp_entry_info nh_entries[] __counted_by(num_nh);
202204
};
203205

@@ -211,6 +213,7 @@ struct nh_notifier_res_bucket_info {
211213

212214
struct nh_notifier_res_table_info {
213215
u16 num_nh_buckets;
216+
bool hw_stats;
214217
struct nh_notifier_single_info nhs[] __counted_by(num_nh_buckets);
215218
};
216219

net/ipv4/nexthop.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ static int nh_notifier_mpath_info_init(struct nh_notifier_info *info,
141141

142142
info->nh_grp->num_nh = num_nh;
143143
info->nh_grp->is_fdb = nhg->fdb_nh;
144+
info->nh_grp->hw_stats = nhg->hw_stats;
144145

145146
for (i = 0; i < num_nh; i++) {
146147
struct nh_grp_entry *nhge = &nhg->nh_entries[i];
@@ -172,6 +173,7 @@ static int nh_notifier_res_table_info_init(struct nh_notifier_info *info,
172173
return -ENOMEM;
173174

174175
info->nh_res_table->num_nh_buckets = num_nh_buckets;
176+
info->nh_res_table->hw_stats = nhg->hw_stats;
175177

176178
for (i = 0; i < num_nh_buckets; i++) {
177179
struct nh_res_bucket *bucket = &res_table->nh_buckets[i];

0 commit comments

Comments
 (0)