net/mlx5: Properly handle a vport destination when setting FTE
authorShahar Klein <shahark@mellanox.com>
Thu, 22 Mar 2018 09:56:51 +0000 (11:56 +0200)
committerSaeed Mahameed <saeedm@mellanox.com>
Thu, 17 May 2018 21:17:34 +0000 (14:17 -0700)
When creating FTE, properly distinguish between destination being vport
or tir. The previous code just worked accidentally b/c of both dest being
in the same offset within a union.

Signed-off-by: Shahar Klein <shahark@mellanox.com>
Reviewed-by: Or Gerlitz <ogerlitz@mellanox.com>
Reviewed-by: Roi Dayan <roid@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/fs_cmd.c

index ef5afd7c93259f5beaaec8f7255d5f7a4c14a3ea..0bfce6a82c917801a91d976fcb4c63d503b67e98 100644 (file)
@@ -372,6 +372,9 @@ static int mlx5_cmd_set_fte(struct mlx5_core_dev *dev,
                        if (dst->dest_attr.type ==
                            MLX5_FLOW_DESTINATION_TYPE_FLOW_TABLE) {
                                id = dst->dest_attr.ft->id;
+                       } else if (dst->dest_attr.type ==
+                                  MLX5_FLOW_DESTINATION_TYPE_VPORT) {
+                               id = dst->dest_attr.vport_num;
                        } else {
                                id = dst->dest_attr.tir_num;
                        }