Thread (17 messages) flat view 17 messages, 4 authors, 2018-01-24

Re: [PATCH net-next 02/12] net: sched: prepare for reimplementation of tc_cls_common_offload_init()

From: Jiri Pirko <jiri@resnulli.us>
Date: 2018-01-24 08:52:18

Wed, Jan 24, 2018 at 03:45:58AM CET, jakub.kicinski@netronome.com wrote:
quoted hunk ↗ jump to hunk
Rename tc_cls_common_offload_init() to tc_cls_common_offload_init__()
and add a new implementation which also takes flags argument.  We will
only set extack if flags indicate that offload is forced (skip_sw)
otherwise driver errors should be ignored, as they don't influence
the overall filter installation.

Note that we need the tc_skip_hw() helper for new version, therefore
it is added later in the file.

Signed-off-by: Jakub Kicinski <redacted>
Reviewed-by: Simon Horman <redacted>
---
include/net/pkt_cls.h    | 18 +++++++++++++++---
net/sched/cls_bpf.c      |  4 ++--
net/sched/cls_flower.c   |  6 +++---
net/sched/cls_matchall.c |  4 ++--
net/sched/cls_u32.c      |  8 ++++----
5 files changed, 26 insertions(+), 14 deletions(-)
diff --git a/include/net/pkt_cls.h b/include/net/pkt_cls.h
index 2f8f16a4d88e..a899fbcfeccd 100644
--- a/include/net/pkt_cls.h
+++ b/include/net/pkt_cls.h
@@ -606,9 +606,9 @@ struct tc_cls_common_offload {
};

static inline void
-tc_cls_common_offload_init(struct tc_cls_common_offload *cls_common,
-			   const struct tcf_proto *tp,
-			   struct netlink_ext_ack *extack)
+tc_cls_common_offload_init__(struct tc_cls_common_offload *cls_common,
+			     const struct tcf_proto *tp,
+			     struct netlink_ext_ack *extack)
This is really confusing. You do duplication and this odd function
naming only to remove it at the end of the patchset.
But the only goal is to add flags arg and tc_skip_sw check.

So just add the arg and check and change all the calls to this finction
to pass the flags arg. You will reduce like 8 patches into one that
is well-readable.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help