From: Jamal Hadi Salim <j…@mojatatu.com>
Sent: Monday, November 30, 2026 8:20 PM
>On Mon, Nov 30, 2026 at 2:18 PM Jamal Hadi Salim <j…@mojatatu.com> wrote:
>>
>> On Mon, Nov 30, 2026 at 7:53 AM Jedrzej Jagielski
>> <jedr…@intel.com> wrote:
>> >
...
>> > if (err) {
>> > - u32_remove_hw_knode(tp, n, NULL);
>> > + if (new_handle)
>> > + u32_remove_hw_knode(tp, n, NULL);
>> > + else
>> > + NL_SET_ERR_MSG_WEAK_MOD(extack,
>> > + "Replace failed,
>> > + hardware may be partially updated");
>>
>> Nitpick:
>> The extack msg is a bit misleading saying hardware may be partially
>> updated even when the block has no offload device and no callback ran.
>> This can only be true if the block has more than one callback and an
>> earlier one accepted before a later one rejected.
>> On a block with a non-offload device, tc_setup_cb_add() returns
>> -EOPNOTSUPP before invoking anything, and with a single rejecting
>> driver nothing changes either the common cases get a false warning.
>> The caller can't tell those apart; i dont have a good answer but maybe
>> add !block->nooffloaddevcnt and word it as "hardware rollback was
>> skipped"
>
>Along:
>} else if (!block->nooffloaddevcnt) {
> NL_SET_ERR_MSG_WEAK_MOD(extack, "Replace failed, hardware rollback was skipped"); }
>
Agree, this would be clearer
>cheers,
>jamal
>
>>
>> cheers,
>> jamal
>>
>> > return err;
>> > }
>> >
>> > @@ -951,7 +956,7 @@ static int u32_change(struct net *net, struct
>> > sk_buff *in_skb,
>> >
>> > u32_bind_filter(tp, new, base, tb);
>> >
>> > - err = u32_replace_hw_knode(tp, new, flags, extack);
>> > + err = u32_replace_hw_knode(tp, new, flags, false,
>> > + extack);
>> > if (err) {
>> > u32_unbind_filter(tp, new, tb);
>> > __u32_destroy_key(new); @@ -1189,7 +1194,7
>> > @@ static int u32_change(struct net *net, struct sk_buff *in_skb,
>> > struct tc_u_knode __rcu **ins;
>> > struct tc_u_knode *pins;
>> >
>> > - err = u32_replace_hw_knode(tp, n, flags, extack);
>> > + err = u32_replace_hw_knode(tp, n, flags, true,
>> > + extack);
>> > if (err)
>> > goto errunbind;
>> >
>>
>>
>> > --
>> > 2.31.1
>> >