diff options
| author | Jakub Kicinski <kuba@kernel.org> | 2022-03-16 19:59:43 -0700 |
|---|---|---|
| committer | Jakub Kicinski <kuba@kernel.org> | 2022-03-16 19:59:44 -0700 |
| commit | 717f1019c0fc664143a4b62bb42d5707ffb8b810 (patch) | |
| tree | 2001cc8c2c19381aa49b57cb29a2f56af722e6f4 /include | |
| parent | a860352e9dd02552e04a0503d0982cf9a4d3a0f4 (diff) | |
| parent | 725726fd1fb716f81eaffcac95381d0230967fa1 (diff) | |
| download | linux-717f1019c0fc664143a4b62bb42d5707ffb8b810.tar.gz linux-717f1019c0fc664143a4b62bb42d5707ffb8b810.zip | |
Merge branch 'flow_offload-add-tc-vlan-push_eth-and-pop_eth-actions'
Roi Dayan says:
====================
flow_offload: add tc vlan push_eth and pop_eth actions
Offloading vlan push_eth and pop_eth actions is needed in order to
correctly offload MPLSoUDP encap and decap flows, this series extends
the flow offload API to support these actions and updates mlx5 to
parse them.
====================
Link: https://lore.kernel.org/r/20220315110211.1581468-1-roid@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include')
| -rw-r--r-- | include/net/flow_offload.h | 6 | ||||
| -rw-r--r-- | include/net/tc_act/tc_vlan.h | 10 |
2 files changed, 16 insertions, 0 deletions
diff --git a/include/net/flow_offload.h b/include/net/flow_offload.h index 92267d23083e..021778a7e1af 100644 --- a/include/net/flow_offload.h +++ b/include/net/flow_offload.h @@ -150,6 +150,8 @@ enum flow_action_id { FLOW_ACTION_PPPOE_PUSH, FLOW_ACTION_JUMP, FLOW_ACTION_PIPE, + FLOW_ACTION_VLAN_PUSH_ETH, + FLOW_ACTION_VLAN_POP_ETH, NUM_FLOW_ACTIONS, }; @@ -211,6 +213,10 @@ struct flow_action_entry { __be16 proto; u8 prio; } vlan; + struct { /* FLOW_ACTION_VLAN_PUSH_ETH */ + unsigned char dst[ETH_ALEN]; + unsigned char src[ETH_ALEN]; + } vlan_push_eth; struct { /* FLOW_ACTION_MANGLE */ /* FLOW_ACTION_ADD */ enum flow_action_mangle_base htype; 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 */ |
