提交 2258e788 编写于 作者: C Chiqijun 提交者: Yang Yingliang

net/hinic: Reduce VF EQ queue depth in SDI mode

driver inclusion
category: bugfix
bugzilla: 4472

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

When the virtual machine is no-load hot migration, the last memory to be
migrated is too large and needs to be optimized. You can achieve the effect
of memory optimization by reducing the depth of CEQ / AEQ on the VF.
Signed-off-by: NChiqijun <chiqijun@huawei.com>
Reviewed-by: NLuoshaokai <luoshaokai@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 e0b0e4c7
......@@ -1223,6 +1223,7 @@ int hinic_aeqs_init(struct hinic_hwdev *hwdev, u16 num_aeqs,
struct hinic_aeqs *aeqs;
int err;
u16 i, q_id;
u32 aeq_len;
aeqs = kzalloc(sizeof(*aeqs), GFP_KERNEL);
if (!aeqs)
......@@ -1245,8 +1246,14 @@ int hinic_aeqs_init(struct hinic_hwdev *hwdev, u16 num_aeqs,
g_aeq_len = HINIC_DEFAULT_AEQ_LEN;
}
if (HINIC_FUNC_TYPE(hwdev) == TYPE_VF &&
hwdev->hwif->chip_mode != CHIP_MODE_NORMAL)
aeq_len = HINIC_VMGW_DEFAULT_AEQ_LEN;
else
aeq_len = g_aeq_len;
for (q_id = 0; q_id < num_aeqs; q_id++) {
err = init_eq(&aeqs->aeq[q_id], hwdev, q_id, g_aeq_len,
err = init_eq(&aeqs->aeq[q_id], hwdev, q_id, aeq_len,
HINIC_AEQ, &msix_entries[q_id]);
if (err) {
sdk_err(hwdev->dev_hdl, "Failed to init aeq %d\n",
......@@ -1307,6 +1314,7 @@ int hinic_ceqs_init(struct hinic_hwdev *hwdev, u16 num_ceqs,
struct hinic_ceqs *ceqs;
int err;
u16 i, q_id;
u32 ceq_len;
ceqs = kzalloc(sizeof(*ceqs), GFP_KERNEL);
if (!ceqs)
......@@ -1322,6 +1330,12 @@ int hinic_ceqs_init(struct hinic_hwdev *hwdev, u16 num_ceqs,
g_ceq_len = HINIC_DEFAULT_CEQ_LEN;
}
if (HINIC_FUNC_TYPE(hwdev) == TYPE_VF &&
hwdev->hwif->chip_mode != CHIP_MODE_NORMAL)
ceq_len = HINIC_VMGW_DEFAULT_CEQ_LEN;
else
ceq_len = g_ceq_len;
if (!g_num_ceqe_in_tasklet) {
sdk_warn(hwdev->dev_hdl, "Module Parameter g_num_ceqe_in_tasklet can not be zero, resetting to %d\n",
HINIC_TASK_PROCESS_EQE_LIMIT);
......@@ -1329,7 +1343,7 @@ int hinic_ceqs_init(struct hinic_hwdev *hwdev, u16 num_ceqs,
}
for (q_id = 0; q_id < num_ceqs; q_id++) {
err = init_eq(&ceqs->ceq[q_id], hwdev, q_id, g_ceq_len,
err = init_eq(&ceqs->ceq[q_id], hwdev, q_id, ceq_len,
HINIC_CEQ, &msix_entries[q_id]);
if (err) {
sdk_err(hwdev->dev_hdl, "Failed to init ceq %d\n",
......
......@@ -35,6 +35,9 @@
#define HINIC_DEFAULT_AEQ_LEN 0x10000
#define HINIC_DEFAULT_CEQ_LEN 0x10000
#define HINIC_VMGW_DEFAULT_AEQ_LEN 128
#define HINIC_VMGW_DEFAULT_CEQ_LEN 1024
#define HINIC_MIN_AEQ_LEN 64
#define HINIC_MAX_AEQ_LEN (512 * 1024)
#define HINIC_MIN_CEQ_LEN 64
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册