Skip to content

Commit c97c9fe

Browse files
roidayanSaeed Mahameed
authored andcommitted
net/mlx5e: E-Switch, Update when to set other vport context
Other vport context should be set if vport number is not 0. In case of ECPF, vport 0 represents the host PF representor so also need to set other vport context. Signed-off-by: Roi Dayan <roid@nvidia.com> Reviewed-by: Maor Dickman <maord@nvidia.com> Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
1 parent 806815b commit c97c9fe

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

drivers/net/ethernet/mellanox/mlx5/core/esw/acl/helper.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ esw_acl_table_create(struct mlx5_eswitch *esw, struct mlx5_vport *vport, int ns,
3535
}
3636

3737
ft_attr.max_fte = size;
38-
ft_attr.flags = MLX5_FLOW_TABLE_OTHER_VPORT;
38+
if (vport_num || mlx5_core_is_ecpf(esw->dev))
39+
ft_attr.flags = MLX5_FLOW_TABLE_OTHER_VPORT;
3940
acl = mlx5_create_vport_flow_table(root_ns, &ft_attr, vport_num);
4041
if (IS_ERR(acl)) {
4142
err = PTR_ERR(acl);

drivers/net/ethernet/mellanox/mlx5/core/eswitch.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,8 @@ static int arm_vport_context_events_cmd(struct mlx5_core_dev *dev, u16 vport,
113113
opcode, MLX5_CMD_OP_MODIFY_NIC_VPORT_CONTEXT);
114114
MLX5_SET(modify_nic_vport_context_in, in, field_select.change_event, 1);
115115
MLX5_SET(modify_nic_vport_context_in, in, vport_number, vport);
116-
MLX5_SET(modify_nic_vport_context_in, in, other_vport, 1);
116+
if (vport || mlx5_core_is_ecpf(dev))
117+
MLX5_SET(modify_nic_vport_context_in, in, other_vport, 1);
117118
nic_vport_ctx = MLX5_ADDR_OF(modify_nic_vport_context_in,
118119
in, nic_vport_context);
119120

drivers/net/ethernet/mellanox/mlx5/core/vport.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,8 @@ int mlx5_query_nic_vport_mac_list(struct mlx5_core_dev *dev,
288288
MLX5_CMD_OP_QUERY_NIC_VPORT_CONTEXT);
289289
MLX5_SET(query_nic_vport_context_in, in, allowed_list_type, list_type);
290290
MLX5_SET(query_nic_vport_context_in, in, vport_number, vport);
291-
MLX5_SET(query_nic_vport_context_in, in, other_vport, 1);
291+
if (vport || mlx5_core_is_ecpf(dev))
292+
MLX5_SET(query_nic_vport_context_in, in, other_vport, 1);
292293

293294
err = mlx5_cmd_exec(dev, in, sizeof(in), out, out_sz);
294295
if (err)

0 commit comments

Comments
 (0)