Skip to content

Commit 56a2068

Browse files
yotamgidavem330
authored andcommitted
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>
1 parent 2301905 commit 56a2068

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

include/net/tc_act/tc_mirred.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,15 @@ static inline bool is_tcf_mirred_redirect(const struct tc_action *a)
2424
return false;
2525
}
2626

27+
static 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+
2736
static inline int tcf_mirred_ifindex(const struct tc_action *a)
2837
{
2938
return to_mirred(a)->tcfm_ifindex;

0 commit comments

Comments
 (0)