aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiri Pirko <jiri@mellanox.com>2017-08-04 14:28:59 +0200
committerDavid S. Miller <davem@davemloft.net>2017-08-04 11:21:23 -0700
commitaf69afc551eb9f9b1f2cc3295e2dfcdaa1dc948d (patch)
tree905acc037acfbe7f21d203711e0a209c9272cd25
parentnet: sched: change names of action number helpers to be aligned with the rest (diff)
downloadlinux-dev-af69afc551eb9f9b1f2cc3295e2dfcdaa1dc948d.tar.xz
linux-dev-af69afc551eb9f9b1f2cc3295e2dfcdaa1dc948d.zip
net: sched: use tcf_exts_has_actions in tcf_exts_exec
Use the tcf_exts_has_actions helper instead or directly testing exts->nr_actions in tcf_exts_exec. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--include/net/pkt_cls.h46
1 files changed, 23 insertions, 23 deletions
diff --git a/include/net/pkt_cls.h b/include/net/pkt_cls.h
index 7f2563636df0..322a2823cc6a 100644
--- a/include/net/pkt_cls.h
+++ b/include/net/pkt_cls.h
@@ -177,29 +177,6 @@ tcf_exts_stats_update(const struct tcf_exts *exts,
}
/**
- * tcf_exts_exec - execute tc filter extensions
- * @skb: socket buffer
- * @exts: tc filter extensions handle
- * @res: desired result
- *
- * Executes all configured extensions. Returns 0 on a normal execution,
- * a negative number if the filter must be considered unmatched or
- * a positive action code (TC_ACT_*) which must be returned to the
- * underlying layer.
- */
-static inline int
-tcf_exts_exec(struct sk_buff *skb, struct tcf_exts *exts,
- struct tcf_result *res)
-{
-#ifdef CONFIG_NET_CLS_ACT
- if (exts->nr_actions)
- return tcf_action_exec(skb, exts->actions, exts->nr_actions,
- res);
-#endif
- return 0;
-}
-
-/**
* tcf_exts_has_actions - check if at least one action is present
* @exts: tc filter extensions handle
*
@@ -229,6 +206,29 @@ static inline bool tcf_exts_has_one_action(struct tcf_exts *exts)
#endif
}
+/**
+ * tcf_exts_exec - execute tc filter extensions
+ * @skb: socket buffer
+ * @exts: tc filter extensions handle
+ * @res: desired result
+ *
+ * Executes all configured extensions. Returns 0 on a normal execution,
+ * a negative number if the filter must be considered unmatched or
+ * a positive action code (TC_ACT_*) which must be returned to the
+ * underlying layer.
+ */
+static inline int
+tcf_exts_exec(struct sk_buff *skb, struct tcf_exts *exts,
+ struct tcf_result *res)
+{
+#ifdef CONFIG_NET_CLS_ACT
+ if (tcf_exts_has_actions(exts))
+ return tcf_action_exec(skb, exts->actions, exts->nr_actions,
+ res);
+#endif
+ return 0;
+}
+
int tcf_exts_validate(struct net *net, struct tcf_proto *tp,
struct nlattr **tb, struct nlattr *rate_tlv,
struct tcf_exts *exts, bool ovr);