Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

crypto: hisilicon/qm - clear all VF configurations in the hardware

When disabling SR-IOV, clear the configuration of each VF
in the hardware. Do not exit the configuration clearing process
due to the failure of a single VF. Additionally, Clear the VF
configurations before decrementing the PM counter.

Signed-off-by: Weili Qian <qianweili@huawei.com>
Signed-off-by: Chenghai Huang <huangchenghai2@huawei.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Weili Qian and committed by
Herbert Xu
64b9642f 80736a97

+12 -13
+12 -13
drivers/crypto/hisilicon/qm.c
··· 3660 3660 return 0; 3661 3661 } 3662 3662 3663 - static int qm_clear_vft_config(struct hisi_qm *qm) 3663 + static void qm_clear_vft_config(struct hisi_qm *qm) 3664 3664 { 3665 - int ret; 3666 3665 u32 i; 3667 3666 3668 - for (i = 1; i <= qm->vfs_num; i++) { 3669 - ret = hisi_qm_set_vft(qm, i, 0, 0); 3670 - if (ret) 3671 - return ret; 3672 - } 3673 - qm->vfs_num = 0; 3667 + /* 3668 + * When disabling SR-IOV, clear the configuration of each VF in the hardware 3669 + * sequentially. Failure to clear a single VF should not affect the clearing 3670 + * operation of other VFs. 3671 + */ 3672 + for (i = 1; i <= qm->vfs_num; i++) 3673 + (void)hisi_qm_set_vft(qm, i, 0, 0); 3674 3674 3675 - return 0; 3675 + qm->vfs_num = 0; 3676 3676 } 3677 3677 3678 3678 static int qm_func_shaper_enable(struct hisi_qm *qm, u32 fun_index, u32 qos) ··· 4007 4007 goto err_put_sync; 4008 4008 } 4009 4009 4010 + qm->vfs_num = num_vfs; 4010 4011 ret = pci_enable_sriov(pdev, num_vfs); 4011 4012 if (ret) { 4012 4013 pci_err(pdev, "Can't enable VF!\n"); 4013 4014 qm_clear_vft_config(qm); 4014 4015 goto err_put_sync; 4015 4016 } 4016 - qm->vfs_num = num_vfs; 4017 4017 4018 4018 pci_info(pdev, "VF enabled, vfs_num(=%d)!\n", num_vfs); 4019 4019 ··· 4048 4048 } 4049 4049 4050 4050 pci_disable_sriov(pdev); 4051 - 4052 - qm->vfs_num = 0; 4051 + qm_clear_vft_config(qm); 4053 4052 qm_pm_put_sync(qm); 4054 4053 4055 - return qm_clear_vft_config(qm); 4054 + return 0; 4056 4055 } 4057 4056 EXPORT_SYMBOL_GPL(hisi_qm_sriov_disable); 4058 4057