Re: [PATCH net] net: sched: act_api: size RTM_GETACTION reply by fill size
From: Jamal Hadi Salim
Date: Fri Jan 30 2026 - 12:54:42 EST
On Fri, Jan 30, 2026 at 12:22 PM Paul Moses <p@xxxxxxx> wrote:
>
> Yes, In net/sched/act_api.c the GETACTION notify path always does alloc_skb(NLMSG_GOODSIZE), if tca_get_fill()
> runs out of tailroom it returns -1 and tcf_get_notify() maps that to -EINVAL. So failures are size-dependent
> and can look intermittent across different action dumps. act_gate might be the outlier?
>
Very bizarre that dump would fail because it is transactional. It
shouldnt matter that you are only allocing NLMSG_GOODSIZE.
Is there a possibility that a single act_gate entry can be larger
than NLMSG_GOODSIZE?
> The size is already computed in tca_action_gd() (sum tcf_action_fill_size() then tcf_action_full_attrs_size())
> and add/del already allocate max(attr_size, NLMSG_GOODSIZE). This patch just makes GETACTION consistent with
> that.
>
I looked at act_gate dump and it is sane. Which leads to perhaps your
test program being bugy.
Install the 100 actions then use tc to count.
Something like:
tc actions ls action gate | grep index | wc -l
cheers,
jamal
> On the reproducer: the gatebench test with 100 entries is reasonable.
> https://raw.githubusercontent.com/jopamo/gatebench/refs/heads/main/src/selftests/test_large_dump.c
>
> I plan to follow this up with another patch for act_gate and believe they both are integral to fully stabilize
> act_gate.
>
> Thanks
> Paul