Subject: Re: [PATCH net-next] net: do not inline rtnl_calcit()

From: Jakub Kicinski <[email-masked]>
Date: Tue, 9 Jul 2024 18:23:06 -0700

On Tue,  9 Jul 2024 23:08:15 +0000 Eric Dumazet wrote:
> -static u32 rtnl_calcit(struct sk_buff *skb, struct nlmsghdr *nlh)
> +static noinline_for_stack u32 rtnl_calcit(struct sk_buff *skb,
> +					  struct nlmsghdr *nlh)

We only look at a single attribute - IFLA_EXT_MASK. We can change the
tb size to IFLA_EXT_MASK + 1 and pass IFLA_EXT_MASK as max_attr to
parse. Parsing the other attrs is pointless, anyway.

Or possibly just walk the attrs with nla_for_each_attr_type() without
parsing at all.