1 /* SPDX-License-Identifier: GPL-2.0-or-later */
6 #ifndef __NET_TC_VLAN_H
7 #define __NET_TC_VLAN_H
9 #include <net/act_api.h>
10 #include <linux/tc_act/tc_vlan.h>
12 struct tcf_vlan_params {
14 unsigned char tcfv_push_dst[ETH_ALEN];
15 unsigned char tcfv_push_src[ETH_ALEN];
17 __be16 tcfv_push_proto;
23 struct tc_action common;
24 struct tcf_vlan_params __rcu *vlan_p;
26 #define to_vlan(a) ((struct tcf_vlan *)a)
28 static inline bool is_tcf_vlan(const struct tc_action *a)
30 #ifdef CONFIG_NET_CLS_ACT
31 if (a->ops && a->ops->id == TCA_ID_VLAN)
37 static inline u32 tcf_vlan_action(const struct tc_action *a)
42 tcfv_action = rcu_dereference(to_vlan(a)->vlan_p)->tcfv_action;
48 static inline u16 tcf_vlan_push_vid(const struct tc_action *a)
53 tcfv_push_vid = rcu_dereference(to_vlan(a)->vlan_p)->tcfv_push_vid;
59 static inline __be16 tcf_vlan_push_proto(const struct tc_action *a)
61 __be16 tcfv_push_proto;
64 tcfv_push_proto = rcu_dereference(to_vlan(a)->vlan_p)->tcfv_push_proto;
67 return tcfv_push_proto;
70 static inline u8 tcf_vlan_push_prio(const struct tc_action *a)
75 tcfv_push_prio = rcu_dereference(to_vlan(a)->vlan_p)->tcfv_push_prio;
78 return tcfv_push_prio;
80 #endif /* __NET_TC_VLAN_H */