summaryrefslogtreecommitdiffstats
path: root/include/net/tc_act
diff options
context:
space:
mode:
authorMaor Dickman <maord@nvidia.com>2022-03-15 13:02:09 +0200
committerJakub Kicinski <kuba@kernel.org>2022-03-16 19:59:36 -0700
commitab95465cde2337108252cdf01f064abdc1a67f6c (patch)
tree42c9d2bf1e456b85fa41a7d0106244b2b83289b6 /include/net/tc_act
parenta860352e9dd02552e04a0503d0982cf9a4d3a0f4 (diff)
downloadlinux-ab95465cde2337108252cdf01f064abdc1a67f6c.tar.gz
linux-ab95465cde2337108252cdf01f064abdc1a67f6c.tar.bz2
linux-ab95465cde2337108252cdf01f064abdc1a67f6c.zip
net/sched: add vlan push_eth and pop_eth action to the hardware IR
Add vlan push_eth and pop_eth action to the hardware intermediate representation model which would subsequently allow it to be used by drivers for offload. Signed-off-by: Maor Dickman <maord@nvidia.com> Reviewed-by: Roi Dayan <roid@nvidia.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include/net/tc_act')
-rw-r--r--include/net/tc_act/tc_vlan.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/net/tc_act/tc_vlan.h b/include/net/tc_act/tc_vlan.h
index f94b8bc26f9e..a97600f742de 100644
--- a/include/net/tc_act/tc_vlan.h
+++ b/include/net/tc_act/tc_vlan.h
@@ -78,4 +78,14 @@ static inline u8 tcf_vlan_push_prio(const struct tc_action *a)
return tcfv_push_prio;
}
+
+static inline void tcf_vlan_push_eth(unsigned char *src, unsigned char *dest,
+ const struct tc_action *a)
+{
+ rcu_read_lock();
+ memcpy(dest, rcu_dereference(to_vlan(a)->vlan_p)->tcfv_push_dst, ETH_ALEN);
+ memcpy(dest, rcu_dereference(to_vlan(a)->vlan_p)->tcfv_push_src, ETH_ALEN);
+ rcu_read_unlock();
+}
+
#endif /* __NET_TC_VLAN_H */