aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYotam Gigi <yotamg@mellanox.com>2016-07-21 06:03:16 -0400
committerDavid S. Miller <davem@davemloft.net>2016-07-25 02:12:00 -0400
commit56a20680f70393d199fc5e8ecc7859549ca5a0c0 (patch)
treecd44e79caaa447e725e81440c82227c2b811be15
parent230190548b7529d02d38f450748baf0721332f26 (diff)
net/sched: act_mirred: Add helper inlines to access tcf_mirred info.
The helper function is_tcf_mirred_mirror helps finding whether an action struct is of type mirred and is configured to be of type mirror. Signed-off-by: Yotam Gigi <yotamg@mellanox.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--include/net/tc_act/tc_mirred.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/net/tc_act/tc_mirred.h b/include/net/tc_act/tc_mirred.h
index e891835eb74e..6a13a7c74e0c 100644
--- a/include/net/tc_act/tc_mirred.h
+++ b/include/net/tc_act/tc_mirred.h
@@ -24,6 +24,15 @@ static inline bool is_tcf_mirred_redirect(const struct tc_action *a)
24 return false; 24 return false;
25} 25}
26 26
27static inline bool is_tcf_mirred_mirror(const struct tc_action *a)
28{
29#ifdef CONFIG_NET_CLS_ACT
30 if (a->ops && a->ops->type == TCA_ACT_MIRRED)
31 return to_mirred(a)->tcfm_eaction == TCA_EGRESS_MIRROR;
32#endif
33 return false;
34}
35
27static inline int tcf_mirred_ifindex(const struct tc_action *a) 36static inline int tcf_mirred_ifindex(const struct tc_action *a)
28{ 37{
29 return to_mirred(a)->tcfm_ifindex; 38 return to_mirred(a)->tcfm_ifindex;