netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net: sched: flower: only return error from hw offload if skip_sw
@ 2019-02-12 21:39 Vlad Buslov
  2019-02-14  5:07 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Vlad Buslov @ 2019-02-12 21:39 UTC (permalink / raw)
  To: netdev; +Cc: jhs, xiyou.wangcong, jiri, davem, pablo, Vlad Buslov

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: 3a7b68617de7 ("cls_api: add translator to flow_action representation")
---
 net/sched/cls_flower.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/net/sched/cls_flower.c b/net/sched/cls_flower.c
index 6a341287a527..f695048455a5 100644
--- a/net/sched/cls_flower.c
+++ b/net/sched/cls_flower.c
@@ -396,7 +396,11 @@ 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);
-		return err;
+		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);
@@ -1499,7 +1503,11 @@ static int fl_reoffload(struct tcf_proto *tp, bool add, tc_setup_cb_t *cb,
 						   &f->exts);
 			if (err) {
 				kfree(cls_flower.rule);
-				return err;
+				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;
-- 
2.13.6


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next] net: sched: flower: only return error from hw offload if skip_sw
  2019-02-12 21:39 [PATCH net-next] net: sched: flower: only return error from hw offload if skip_sw Vlad Buslov
@ 2019-02-14  5:07 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2019-02-14  5:07 UTC (permalink / raw)
  To: vladbu; +Cc: netdev, jhs, xiyou.wangcong, jiri, pablo

From: Vlad Buslov <vladbu@mellanox.com>
Date: Tue, 12 Feb 2019 23:39:06 +0200

> 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: 3a7b68617de7 ("cls_api: add translator to flow_action representation")

Applied, thanks Vlad.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-02-14  5:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-12 21:39 [PATCH net-next] net: sched: flower: only return error from hw offload if skip_sw Vlad Buslov
2019-02-14  5:07 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).