net: sched: flower: only return error from hw offload if skip_sw
Recently introduced tc_setup_flow_action() can fail when parsing tcf_exts
on some unsupported action commands. However, this should not affect the
case when user did not explicitly request hw offload by setting skip_sw
flag. Modify tc_setup_flow_action() callers to only propagate the error if
skip_sw flag is set for filter that is being offloaded, and set extack
error message in that case.
Signed-off-by: Vlad Buslov <vladbu@mellanox.com>
Fixes: 3a7b68617d
("cls_api: add translator to flow_action representation")
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
cba2bf7a22
commit
1f15bb4f39
|
@ -396,8 +396,12 @@ static int fl_hw_replace_filter(struct tcf_proto *tp,
|
|||
err = tc_setup_flow_action(&cls_flower.rule->action, &f->exts);
|
||||
if (err) {
|
||||
kfree(cls_flower.rule);
|
||||
if (skip_sw) {
|
||||
NL_SET_ERR_MSG_MOD(extack, "Failed to setup flow action");
|
||||
return err;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
err = tc_setup_cb_call(block, TC_SETUP_CLSFLOWER, &cls_flower, skip_sw);
|
||||
kfree(cls_flower.rule);
|
||||
|
@ -1503,8 +1507,12 @@ static int fl_reoffload(struct tcf_proto *tp, bool add, tc_setup_cb_t *cb,
|
|||
&f->exts);
|
||||
if (err) {
|
||||
kfree(cls_flower.rule);
|
||||
if (tc_skip_sw(f->flags)) {
|
||||
NL_SET_ERR_MSG_MOD(extack, "Failed to setup flow action");
|
||||
return err;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
cls_flower.classid = f->res.classid;
|
||||
|
||||
|
|
Loading…
Reference in New Issue