From: liulongfang <liulongfang@huawei.com>
To: <herbert@gondor.apana.org.au>, <wangzhou1@hisilicon.com>
Cc: <linux-crypto@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] crypto: hisilicon/sec - Fix a module parameter error
Date: Sat, 27 Mar 2021 18:29:49 +0800 [thread overview]
Message-ID: <354738e6-1c4b-66c4-ff89-ecac70d47c9e@huawei.com> (raw)
In-Reply-To: <1616837358-15112-1-git-send-email-liulongfang@huawei.com>
On 2021/3/27 17:29, Longfang Liu Wrote:
> ctx_q_num is a module parameter set by the user to specify the
> number of qp queues required to create a ctx.
>
> When the number of qp queues allocated by PF or VF is less than
> the ctx_q_num, an error will be reported when ctx is initialized
> in kernel mode, which leads to the problem that the registered
> algorithms cannot be used.
>
> Therefore, when PF or VF is initialized, if the number of qp queues
> is not enough to create a ctx, the kernel mode cannot be used,
> and there is no need to register the kernel mode algorithms.
>
> Signed-off-by: Longfang Liu <liulongfang@huawei.com>
> ---
> drivers/crypto/hisilicon/sec2/sec_main.c | 13 +++++++++----
> 1 file changed, 9 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/crypto/hisilicon/sec2/sec_main.c b/drivers/crypto/hisilicon/sec2/sec_main.c
> index b1818f7..c7b71b6 100644
> --- a/drivers/crypto/hisilicon/sec2/sec_main.c
> +++ b/drivers/crypto/hisilicon/sec2/sec_main.c
> @@ -867,10 +867,15 @@ static int sec_probe(struct pci_dev *pdev, const struct pci_device_id *id)
> if (ret)
> pci_warn(pdev, "Failed to init debugfs!\n");
>
> - ret = hisi_qm_alg_register(qm, &sec_devices);
> - if (ret < 0) {
> - pr_err("Failed to register driver to crypto.\n");
> - goto err_qm_stop;
> + if (qm->qp_num >= ctx_q_num) {
> + ret = hisi_qm_alg_register(qm, &sec_devices);
> + if (ret < 0) {
> + pr_err("Failed to register driver to crypto.\n");
> + goto err_qm_stop;
> + }
> + } else {
> + pci_warn(qm->pdev,
> + "Failed to use kernel mode, qp not enough!\n");
> }
>
> if (qm->uacce) {
>
Sorry, please don't reply to this patch, I will resend it again.
Thanks,
Longfang
next prev parent reply other threads:[~2021-03-27 10:30 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-27 9:29 Longfang Liu
2021-03-27 9:29 ` [PATCH] crypto: hisilicon/sec - Fixes AES algorithm mode parameter problem Longfang Liu
2021-03-27 10:29 ` liulongfang [this message]
2021-03-27 10:28 [PATCH] crypto: hisilicon/sec - Fix a module parameter error Longfang Liu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=354738e6-1c4b-66c4-ff89-ecac70d47c9e@huawei.com \
--to=liulongfang@huawei.com \
--cc=herbert@gondor.apana.org.au \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=wangzhou1@hisilicon.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®