net/mlx5: E-switch, Add checking for flow rule destinations
authorJianbo Liu <jianbol@nvidia.com>
Wed, 19 Apr 2023 03:17:57 +0000 (03:17 +0000)
committerSaeed Mahameed <saeedm@nvidia.com>
Mon, 14 Aug 2023 21:40:21 +0000 (14:40 -0700)
commite0e22d59b47a3306d448284a499169a361555099
treea9667cdf8837f3fd8b7865987e4c9bca7c7ecf97
parenta9f168e4c6e1f623dcf2640b9d76a4f61b9731e5
net/mlx5: E-switch, Add checking for flow rule destinations

Firmware doesn't allow flow rules in FDB to do header rewrite and send
packets to both internal and uplink vports. The following syndrome
will be generated when trying to offload such kind of rules:

mlx5_core 0000:08:00.0: mlx5_cmd_out_err:803:(pid 23569): SET_FLOW_TABLE_ENTRY(0x936) op_mod(0x0) failed, status bad parameter(0x3), syndrome (0x8c8f08), err(-22)

To avoid this syndrome, add a checking before creating FTE. If a rule
with header rewrite action forwards packets to both VF and PF, an
error is returned directly.

Signed-off-by: Jianbo Liu <jianbol@nvidia.com>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c