]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net/mlx5: Clear bw_share upon VF disable
authorVladyslav Tarasiuk <vladyslavt@nvidia.com>
Mon, 2 Nov 2020 11:45:24 +0000 (13:45 +0200)
committerSaeed Mahameed <saeedm@nvidia.com>
Tue, 17 Nov 2020 19:50:53 +0000 (11:50 -0800)
Currently, if user disables VFs with some min and max rates configured,
they are cleared. But QoS data is not cleared and restored upon next VF
enable placing limits on minimal rate for given VF, when user expects
none.

To match cleared vport->info struct with QoS-related min and max rates
upon VF disable, clear vport->qos struct too.

Fixes: b07e557023da ("net/mlx5: Clear VF's configuration on disabling SRIOV")
Signed-off-by: Vladyslav Tarasiuk <vladyslavt@nvidia.com>
Reviewed-by: Moshe Shemesh <moshe@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/eswitch.c

index e8e6294c7ccae13ac2276df2a2f2527d08ea9e8f..6562f4d484e6ff1953667369206476942b9a0ab2 100644 (file)
@@ -1408,6 +1408,7 @@ static void mlx5_eswitch_clear_vf_vports_info(struct mlx5_eswitch *esw)
        int i;
 
        mlx5_esw_for_each_vf_vport(esw, i, vport, esw->esw_funcs.num_vfs) {
+               memset(&vport->qos, 0, sizeof(vport->qos));
                memset(&vport->info, 0, sizeof(vport->info));
                vport->info.link_state = MLX5_VPORT_ADMIN_STATE_AUTO;
        }