Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.
Low priority / nit picks for your consideration:
- [Low] The commit message describes the removed refcount_inc() as "a
forward fix for currently dead code, which will be uncovered by the…
--
net/sched: cls_u32: remove erroneous refcount_inc()
This patch removes the refcount_inc() on the old linked tc_u_hnode in the
u32_replace_hw_knode() error path of u32_change(). The decrement done by
u32_set_parms() is already balanced by the increment in u32_init_knode(),
so the extra refcount_inc() leaks the hash table.
Closes: https://sashiko.dev/#/patchset/2026…%40intel.com
> This is a forward fix for currently dead code, which will be uncovered
> by the upcoming patch "net/sched: cls_u32: feed u32_replace_hw_knode()
> with correct set of flags".
[Severity: Low]
This patch has Cc: stable and Fixes: e8d3d78c19be. Is "currently dead
code" true for every stable tree it is meant for?
The branch only became unreachable with 695176bfe5de ("net_sched: refactor
TC action init API") in v5.14. That commit renamed the TCA_U32_FLAGS local
in u32_change() from flags to userflags. It then reused flags for the
kernel TCA_ACT_FLAGS_* word but left the knode call unchanged:
err = u32_replace_hw_knode(tp, new, flags, extack);
Since then, skip_sw has been ignored on this call.
Before v5.14, flags still holds the user's TCA_U32_FLAGS value. Take a
pre-5.14 stable tree that picked up e8d3d78c19be. There, a skip_sw replace
with TCA_U32_LINK that fails to offload would reach this error branch.
Each such failure would raise the old linked tc_u_hnode refcnt by one and
never drop it. A later u32_delete() of that table would then return -EBUSY,
and the table would never be freed.
I can't tell from here whether e8d3d78c19be was actually backported to
pre-5.14 trees, so this part depends on that.
The follow-up flags patch carries Fixes: 695176bfe5de and would not apply
to those older trees.
Could the commit message say that the path is live in pre-v5.14 trees that
contain e8d3d78c19be? Otherwise this patch might be skipped there as only
mattering together with the flags patch.
The refcount change itself looks correct:
- u32_init_knode() takes a reference on the old ht_down.
- u32_set_parms() takes one on the new table and drops one on the old.
- __u32_destroy_key(new) drops the one on the new table.
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/2026…%40intel.com