From: Yotam Gigi Date: Thu, 21 Jul 2016 10:03:16 +0000 (+0200) Subject: net/sched: act_mirred: Add helper inlines to access tcf_mirred info. X-Git-Tag: v5.15~13202^2~43^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=56a20680f70393d199fc5e8ecc7859549ca5a0c0;p=platform%2Fkernel%2Flinux-starfive.git 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 Signed-off-by: Jiri Pirko Signed-off-by: David S. Miller --- diff --git a/include/net/tc_act/tc_mirred.h b/include/net/tc_act/tc_mirred.h index e891835..6a13a7c 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) return false; } +static inline bool is_tcf_mirred_mirror(const struct tc_action *a) +{ +#ifdef CONFIG_NET_CLS_ACT + if (a->ops && a->ops->type == TCA_ACT_MIRRED) + return to_mirred(a)->tcfm_eaction == TCA_EGRESS_MIRROR; +#endif + return false; +} + static inline int tcf_mirred_ifindex(const struct tc_action *a) { return to_mirred(a)->tcfm_ifindex;