mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 23:32:14 +00:00
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>
This commit is contained in:
parent
230190548b
commit
56a20680f7
1 changed files with 9 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue