Re: [PATCH net-next v2 7/7] net: nexthop: Expose nexthop group HW stats to user space
From: Petr Machata <petrm@nvidia.com>
Date: 2024-03-01 17:25:16
From: Petr Machata <petrm@nvidia.com>
Date: 2024-03-01 17:25:16
David Ahern [off-list ref] writes:
On 2/29/24 11:16 AM, Petr Machata wrote:quoted
diff --git a/net/ipv4/nexthop.c b/net/ipv4/nexthop.c index 15f108c440ae..169a003cc855 100644 --- a/net/ipv4/nexthop.c +++ b/net/ipv4/nexthop.c@@ -43,7 +43,8 @@ static const struct nla_policy rtm_nh_policy_new[] = { static const struct nla_policy rtm_nh_policy_get[] = { [NHA_ID] = { .type = NLA_U32 }, [NHA_OP_FLAGS] = NLA_POLICY_MASK(NLA_U32, - NHA_OP_FLAG_DUMP_STATS), + NHA_OP_FLAG_DUMP_STATS | + NHA_OP_FLAG_DUMP_HW_STATS), }; static const struct nla_policy rtm_nh_policy_del[] = {@@ -56,7 +57,8 @@ static const struct nla_policy rtm_nh_policy_dump[] = { [NHA_MASTER] = { .type = NLA_U32 }, [NHA_FDB] = { .type = NLA_FLAG }, [NHA_OP_FLAGS] = NLA_POLICY_MASK(NLA_U32, - NHA_OP_FLAG_DUMP_STATS), + NHA_OP_FLAG_DUMP_STATS | + NHA_OP_FLAG_DUMP_HW_STATS),2 instances of the same mask; worth giving it a name.
OK. I'll stick this somewhere above the policies: #define NHA_OP_FLAGS_DUMP_STATS_ALL (NHA_OP_FLAG_DUMP_STATS | \ NHA_OP_FLAG_DUMP_HW_STATS)