From: Roi Dayan <roid@xxxxxxxxxx> commit 5b209d1a22afabfb7d644abb10510c5713a3e569 upstream. Currently the driver adds implicit modify hdr action for decap rules on tunnel devices if the port is an ovs port. This is also done if the action is drop and makes the modify hdr redundant and also the FW doesn't support it and will generate a syndrome. kernel: mlx5_core 0000:08:00.0: mlx5_cmd_check:777:(pid 102063): SET_FLOW_TABLE_ENTRY(0x936) op_mod(0x0) failed, status bad parameter(0x3), syndrome (0x8708c3) Fix it by adding the implicit modify hdr only for fwd actions. Fixes: b16eb3c81fe2 ("net/mlx5: Support internal port as decap route device") Fixes: 077cdda764c7 ("net/mlx5e: TC, Fix memory leak with rules with internal port") Signed-off-by: Roi Dayan <roid@xxxxxxxxxx> Reviewed-by: Ariel Levkovich <lariel@xxxxxxxxxx> Signed-off-by: Saeed Mahameed <saeedm@xxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c @@ -1425,7 +1425,8 @@ mlx5e_tc_add_fdb_flow(struct mlx5e_priv if (err) goto err_out; - if (!attr->chain && esw_attr->int_port) { + if (!attr->chain && esw_attr->int_port && + attr->action & MLX5_FLOW_CONTEXT_ACTION_FWD_DEST) { /* If decap route device is internal port, change the * source vport value in reg_c0 back to uplink just in * case the rule performs goto chain > 0. If we have a miss Patches currently in stable-queue which might be from roid@xxxxxxxxxx are queue-5.16/net-mlx5e-avoid-implicit-modify-hdr-for-decap-drop-rule.patch queue-5.16/net-mlx5-bridge-fix-devlink-deadlock-on-net-namespace-deletion.patch queue-5.16/net-mlx5-e-switch-fix-uninitialized-variable-modact.patch queue-5.16/net-mlx5-bridge-take-rtnl-lock-in-init-error-handler.patch queue-5.16/net-mlx5e-fix-handling-of-wrong-devices-during-bond-netevent.patch queue-5.16/net-mlx5e-tc-reject-rules-with-forward-and-drop-actions.patch queue-5.16/net-mlx5e-tc-reject-rules-with-drop-and-modify-hdr-action.patch queue-5.16/net-mlx5-bridge-ensure-dev_name-is-null-terminated.patch queue-5.16/net-mlx5-fix-offloading-with-eswitch_ipv4_ttl_modify_enable.patch