Commit 1dc44035 authored by Yang Shen's avatar Yang Shen Committed by Herbert Xu

crypto: hisilicon/zip - add a work_queue for zip irq

The patch 'irqchip/gic-v3-its: Balance initial LPI affinity across CPUs'
set the IRQ to an uncentain CPU. If an IRQ is bound to the CPU used by the
thread which is sending request, the throughput will be just half.

So allocate a 'work_queue' and set as 'WQ_UNBOUND' to do the back half work
on some different CPUS.
Signed-off-by: default avatarYang Shen <shenyang39@huawei.com>
Reviewed-by: default avatarZaibo Xu <xuzaibo@huawei.com>
Reviewed-by: default avatarZhou Wang <wangzhou1@hisilicon.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 1201581c
...@@ -747,6 +747,8 @@ static int hisi_zip_pf_probe_init(struct hisi_zip *hisi_zip) ...@@ -747,6 +747,8 @@ static int hisi_zip_pf_probe_init(struct hisi_zip *hisi_zip)
static int hisi_zip_qm_init(struct hisi_qm *qm, struct pci_dev *pdev) static int hisi_zip_qm_init(struct hisi_qm *qm, struct pci_dev *pdev)
{ {
int ret;
qm->pdev = pdev; qm->pdev = pdev;
qm->ver = pdev->revision; qm->ver = pdev->revision;
qm->algs = "zlib\ngzip"; qm->algs = "zlib\ngzip";
...@@ -772,7 +774,25 @@ static int hisi_zip_qm_init(struct hisi_qm *qm, struct pci_dev *pdev) ...@@ -772,7 +774,25 @@ static int hisi_zip_qm_init(struct hisi_qm *qm, struct pci_dev *pdev)
qm->qp_num = HZIP_QUEUE_NUM_V1 - HZIP_PF_DEF_Q_NUM; qm->qp_num = HZIP_QUEUE_NUM_V1 - HZIP_PF_DEF_Q_NUM;
} }
return hisi_qm_init(qm); qm->wq = alloc_workqueue("%s", WQ_HIGHPRI | WQ_MEM_RECLAIM |
WQ_UNBOUND, num_online_cpus(),
pci_name(qm->pdev));
if (!qm->wq) {
pci_err(qm->pdev, "fail to alloc workqueue\n");
return -ENOMEM;
}
ret = hisi_qm_init(qm);
if (ret)
destroy_workqueue(qm->wq);
return ret;
}
static void hisi_zip_qm_uninit(struct hisi_qm *qm)
{
hisi_qm_uninit(qm);
destroy_workqueue(qm->wq);
} }
static int hisi_zip_probe_init(struct hisi_zip *hisi_zip) static int hisi_zip_probe_init(struct hisi_zip *hisi_zip)
...@@ -854,7 +874,7 @@ static int hisi_zip_probe(struct pci_dev *pdev, const struct pci_device_id *id) ...@@ -854,7 +874,7 @@ static int hisi_zip_probe(struct pci_dev *pdev, const struct pci_device_id *id)
hisi_qm_dev_err_uninit(qm); hisi_qm_dev_err_uninit(qm);
err_qm_uninit: err_qm_uninit:
hisi_qm_uninit(qm); hisi_zip_qm_uninit(qm);
return ret; return ret;
} }
...@@ -872,7 +892,7 @@ static void hisi_zip_remove(struct pci_dev *pdev) ...@@ -872,7 +892,7 @@ static void hisi_zip_remove(struct pci_dev *pdev)
hisi_zip_debugfs_exit(qm); hisi_zip_debugfs_exit(qm);
hisi_qm_stop(qm, QM_NORMAL); hisi_qm_stop(qm, QM_NORMAL);
hisi_qm_dev_err_uninit(qm); hisi_qm_dev_err_uninit(qm);
hisi_qm_uninit(qm); hisi_zip_qm_uninit(qm);
} }
static const struct pci_error_handlers hisi_zip_err_handler = { static const struct pci_error_handlers hisi_zip_err_handler = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment