Skip to content

Commit 4c096ea

Browse files
idoschdavem330
authored andcommitted
net/sched: matchall: Take verbose flag into account when logging error messages
The verbose flag was added in commit 81c7288 ("sched: cls: enable verbose logging") to avoid suppressing logging of error messages that occur "when the rule is not to be exclusively executed by the hardware". However, such error messages are currently suppressed when setup of flow action fails. Take the verbose flag into account to avoid suppressing error messages. This is done by using the extack pointer initialized by tc_cls_common_offload_init(), which performs the necessary checks. Signed-off-by: Ido Schimmel <[email protected]> Reviewed-by: Petr Machata <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 4a778f3 commit 4c096ea

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

net/sched/cls_matchall.c

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,10 @@ static int mall_replace_hw_filter(struct tcf_proto *tp,
101101
if (err) {
102102
kfree(cls_mall.rule);
103103
mall_destroy_hw_filter(tp, head, cookie, NULL);
104-
if (skip_sw)
105-
NL_SET_ERR_MSG_MOD(extack, "Failed to setup flow action");
106-
else
107-
err = 0;
104+
NL_SET_ERR_MSG_MOD(cls_mall.common.extack,
105+
"Failed to setup flow action");
108106

109-
return err;
107+
return skip_sw ? err : 0;
110108
}
111109

112110
err = tc_setup_cb_add(block, tp, TC_SETUP_CLSMATCHALL, &cls_mall,
@@ -305,11 +303,10 @@ static int mall_reoffload(struct tcf_proto *tp, bool add, flow_setup_cb_t *cb,
305303
err = tc_setup_offload_action(&cls_mall.rule->action, &head->exts);
306304
if (err) {
307305
kfree(cls_mall.rule);
308-
if (add && tc_skip_sw(head->flags)) {
309-
NL_SET_ERR_MSG_MOD(extack, "Failed to setup flow action");
310-
return err;
311-
}
312-
return 0;
306+
NL_SET_ERR_MSG_MOD(cls_mall.common.extack,
307+
"Failed to setup flow action");
308+
309+
return add && tc_skip_sw(head->flags) ? err : 0;
313310
}
314311

315312
err = tc_setup_cb_reoffload(block, tp, add, cb, TC_SETUP_CLSMATCHALL,

0 commit comments

Comments
 (0)