Skip to content

Commit 0a7fcb7

Browse files
Paul BlakeySaeed Mahameed
authored andcommitted
net/mlx5e: Support inner header rewrite with goto action
The hardware supports header rewrite of outer headers only. To perform header rewrite on inner headers, we must first decapsulate the packet. Currently, the hardware decap action is explicitly set by the tc tunnel_key unset action. However, with goto action the user won't use the tunnel_key unset action. In addition, header rewrites actions will not apply to the inner header as done by the software model. To support this, we will map each tunnel matches seen on a tc rule to a unique tunnel id, implicity add a decap action on tc chain 0 flows, and mark the packets with this unique tunnel id. Tunnel matches on the decapsulated tunnel on later chains will match on this unique id instead of the actual packet. We will also use this mapping to restore the tunnel info metadata on miss. Signed-off-by: Paul Blakey <[email protected]> Reviewed-by: Roi Dayan <[email protected]> Reviewed-by: Oz Shlomo <[email protected]> Reviewed-by: Mark Bloch <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
1 parent 7f2fd0a commit 0a7fcb7

File tree

3 files changed

+445
-45
lines changed

3 files changed

+445
-45
lines changed

drivers/net/ethernet/mellanox/mlx5/core/en_rep.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,11 @@ struct mlx5_rep_uplink_priv {
8181
struct mutex unready_flows_lock;
8282
struct list_head unready_flows;
8383
struct work_struct reoffload_flows_work;
84+
85+
/* maps tun_info to a unique id*/
86+
struct mapping_ctx *tunnel_mapping;
87+
/* maps tun_enc_opts to a unique id*/
88+
struct mapping_ctx *tunnel_enc_opts_mapping;
8489
};
8590

8691
struct mlx5e_rep_priv {

0 commit comments

Comments
 (0)