提交 0a44be25 编写于 作者: C Chiqijun 提交者: Yang Yingliang

net/hinic: Number of VF queues cleared during initialization

driver inclusion
category: bugfix
bugzilla: 4472

-----------------------------------------------------------------------

According to the number of queues set by the VF driver during hot
migration, determine whether data migration is required, and clear
the number of queues after the driver is reloaded to prevent accidental
migration of useless data.
Signed-off-by: NChiqijun <chiqijun@huawei.com>
Reviewed-by: NLuoshaokai <luoshaokai@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 2258e788
...@@ -229,9 +229,17 @@ MODULE_PARM_DESC(g_num_ceqe_in_tasklet, ...@@ -229,9 +229,17 @@ MODULE_PARM_DESC(g_num_ceqe_in_tasklet,
static irqreturn_t aeq_interrupt(int irq, void *data); static irqreturn_t aeq_interrupt(int irq, void *data);
static irqreturn_t ceq_interrupt(int irq, void *data); static irqreturn_t ceq_interrupt(int irq, void *data);
void hinic_qps_num_set(struct hinic_hwdev *hwdev, u32 num_qps) /**
* hinic_qps_num_set - set the number of queues that are actually opened,
* and instructs the migration driver to migrate specified queues
* during VF live migration.
*
* @hwdev: the pointer to hw device
* @num_qps: number of queue
*/
void hinic_qps_num_set(void *hwdev, u32 num_qps)
{ {
struct hinic_hwif *hwif = hwdev->hwif; struct hinic_hwif *hwif = ((struct hinic_hwdev *)hwdev)->hwif;
u32 addr, val, ctrl; u32 addr, val, ctrl;
addr = HINIC_CSR_AEQ_CTRL_0_ADDR(0); addr = HINIC_CSR_AEQ_CTRL_0_ADDR(0);
......
...@@ -159,8 +159,6 @@ u32 hinic_func_own_bit_get(struct hinic_hwdev *hwdev); ...@@ -159,8 +159,6 @@ u32 hinic_func_own_bit_get(struct hinic_hwdev *hwdev);
void hinic_func_own_bit_set(struct hinic_hwdev *hwdev, u32 cfg); void hinic_func_own_bit_set(struct hinic_hwdev *hwdev, u32 cfg);
void hinic_qps_num_set(struct hinic_hwdev *hwdev, u32 num_qps);
int hinic_aeqs_init(struct hinic_hwdev *hwdev, u16 num_aeqs, int hinic_aeqs_init(struct hinic_hwdev *hwdev, u16 num_aeqs,
struct irq_info *msix_entries); struct irq_info *msix_entries);
......
...@@ -377,6 +377,8 @@ void hinic_shutdown_hwdev(void *hwdev); ...@@ -377,6 +377,8 @@ void hinic_shutdown_hwdev(void *hwdev);
void hinic_ppf_hwdev_unreg(void *hwdev); void hinic_ppf_hwdev_unreg(void *hwdev);
void hinic_ppf_hwdev_reg(void *hwdev, void *ppf_hwdev); void hinic_ppf_hwdev_reg(void *hwdev, void *ppf_hwdev);
void hinic_qps_num_set(void *hwdev, u32 num_qps);
bool hinic_is_hwdev_mod_inited(void *hwdev, enum hinic_hwdev_init_state state); bool hinic_is_hwdev_mod_inited(void *hwdev, enum hinic_hwdev_init_state state);
enum hinic_func_mode hinic_get_func_mode(void *hwdev); enum hinic_func_mode hinic_get_func_mode(void *hwdev);
u64 hinic_get_func_feature_cap(void *hwdev); u64 hinic_get_func_feature_cap(void *hwdev);
......
...@@ -2318,6 +2318,7 @@ static int hinic_func_init(struct pci_dev *pdev, ...@@ -2318,6 +2318,7 @@ static int hinic_func_init(struct pci_dev *pdev,
true : disable_vf_load; true : disable_vf_load;
hinic_set_vf_load_state(pci_adapter, vf_load_state); hinic_set_vf_load_state(pci_adapter, vf_load_state);
hinic_qps_num_set(pci_adapter->hwdev, 0);
pci_adapter->lld_dev.pdev = pdev; pci_adapter->lld_dev.pdev = pdev;
pci_adapter->lld_dev.hwdev = pci_adapter->hwdev; pci_adapter->lld_dev.hwdev = pci_adapter->hwdev;
......
...@@ -763,6 +763,8 @@ void hinic_free_qp_ctxts(void *hwdev) ...@@ -763,6 +763,8 @@ void hinic_free_qp_ctxts(void *hwdev)
if (!hwdev) if (!hwdev)
return; return;
hinic_qps_num_set(hwdev, 0);
err = hinic_clean_root_ctxt(hwdev); err = hinic_clean_root_ctxt(hwdev);
if (err) if (err)
nic_err(((struct hinic_hwdev *)hwdev)->dev_hdl, nic_err(((struct hinic_hwdev *)hwdev)->dev_hdl,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册