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

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: Yang Shen <shenyang39@huawei.com>
Reviewed-by: Zaibo Xu <xuzaibo@huawei.com>
Reviewed-by: Zhou Wang <wangzhou1@hisilicon.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Yang Shen and committed by
Herbert Xu
1dc44035 1201581c

+23 -3
+23 -3
drivers/crypto/hisilicon/zip/zip_main.c
··· 747 747 748 748 static int hisi_zip_qm_init(struct hisi_qm *qm, struct pci_dev *pdev) 749 749 { 750 + int ret; 751 + 750 752 qm->pdev = pdev; 751 753 qm->ver = pdev->revision; 752 754 qm->algs = "zlib\ngzip"; ··· 774 772 qm->qp_num = HZIP_QUEUE_NUM_V1 - HZIP_PF_DEF_Q_NUM; 775 773 } 776 774 777 - return hisi_qm_init(qm); 775 + qm->wq = alloc_workqueue("%s", WQ_HIGHPRI | WQ_MEM_RECLAIM | 776 + WQ_UNBOUND, num_online_cpus(), 777 + pci_name(qm->pdev)); 778 + if (!qm->wq) { 779 + pci_err(qm->pdev, "fail to alloc workqueue\n"); 780 + return -ENOMEM; 781 + } 782 + 783 + ret = hisi_qm_init(qm); 784 + if (ret) 785 + destroy_workqueue(qm->wq); 786 + 787 + return ret; 788 + } 789 + 790 + static void hisi_zip_qm_uninit(struct hisi_qm *qm) 791 + { 792 + hisi_qm_uninit(qm); 793 + destroy_workqueue(qm->wq); 778 794 } 779 795 780 796 static int hisi_zip_probe_init(struct hisi_zip *hisi_zip) ··· 874 854 hisi_qm_dev_err_uninit(qm); 875 855 876 856 err_qm_uninit: 877 - hisi_qm_uninit(qm); 857 + hisi_zip_qm_uninit(qm); 878 858 879 859 return ret; 880 860 } ··· 892 872 hisi_zip_debugfs_exit(qm); 893 873 hisi_qm_stop(qm, QM_NORMAL); 894 874 hisi_qm_dev_err_uninit(qm); 895 - hisi_qm_uninit(qm); 875 + hisi_zip_qm_uninit(qm); 896 876 } 897 877 898 878 static const struct pci_error_handlers hisi_zip_err_handler = {