diff options
author | Or Gerlitz <ogerlitz@mellanox.com> | 2016-09-22 13:01:41 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-09-23 07:22:11 -0400 |
commit | 53e89941ba2a969c483aa29b907de9a823179297 (patch) | |
tree | a0e7bf8cd338e5e1acc3f7a0f3f52b38f168bd45 | |
parent | fefa569a9d4bc4b7758c0fddd75bb0382c95da77 (diff) |
net_sched: act_vlan: add helper inlines to access tcf_vlan info
Needed e.g for offloading drivers to pick the relevant attributes.
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | include/net/tc_act/tc_vlan.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/include/net/tc_act/tc_vlan.h b/include/net/tc_act/tc_vlan.h index 6b835889ea30..48cca321ee6c 100644 --- a/include/net/tc_act/tc_vlan.h +++ b/include/net/tc_act/tc_vlan.h | |||
@@ -11,6 +11,7 @@ | |||
11 | #define __NET_TC_VLAN_H | 11 | #define __NET_TC_VLAN_H |
12 | 12 | ||
13 | #include <net/act_api.h> | 13 | #include <net/act_api.h> |
14 | #include <linux/tc_act/tc_vlan.h> | ||
14 | 15 | ||
15 | #define VLAN_F_POP 0x1 | 16 | #define VLAN_F_POP 0x1 |
16 | #define VLAN_F_PUSH 0x2 | 17 | #define VLAN_F_PUSH 0x2 |
@@ -24,4 +25,28 @@ struct tcf_vlan { | |||
24 | }; | 25 | }; |
25 | #define to_vlan(a) ((struct tcf_vlan *)a) | 26 | #define to_vlan(a) ((struct tcf_vlan *)a) |
26 | 27 | ||
28 | static inline bool is_tcf_vlan(const struct tc_action *a) | ||
29 | { | ||
30 | #ifdef CONFIG_NET_CLS_ACT | ||
31 | if (a->ops && a->ops->type == TCA_ACT_VLAN) | ||
32 | return true; | ||
33 | #endif | ||
34 | return false; | ||
35 | } | ||
36 | |||
37 | static inline u32 tcf_vlan_action(const struct tc_action *a) | ||
38 | { | ||
39 | return to_vlan(a)->tcfv_action; | ||
40 | } | ||
41 | |||
42 | static inline u16 tcf_vlan_push_vid(const struct tc_action *a) | ||
43 | { | ||
44 | return to_vlan(a)->tcfv_push_vid; | ||
45 | } | ||
46 | |||
47 | static inline __be16 tcf_vlan_push_proto(const struct tc_action *a) | ||
48 | { | ||
49 | return to_vlan(a)->tcfv_push_proto; | ||
50 | } | ||
51 | |||
27 | #endif /* __NET_TC_VLAN_H */ | 52 | #endif /* __NET_TC_VLAN_H */ |