[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Zmgzz98P24EU/p9y@gcabiddu-mobl.ger.corp.intel.com>
Date: Tue, 11 Jun 2024 12:23:59 +0100
From: "Cabiddu, Giovanni" <giovanni.cabiddu@...el.com>
To: Chen Ni <nichen@...as.ac.cn>
CC: <herbert@...dor.apana.org.au>, <davem@...emloft.net>,
<markas.rapoportas@...el.com>, <ahsan.atta@...el.com>,
<mun.chun.yep@...el.com>, <xin.zeng@...el.com>, <qat-linux@...el.com>,
<linux-crypto@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] crypto: qat - add check for adf_cfg_add_key_value_param
On Wed, Jun 05, 2024 at 11:18:35AM +0800, Chen Ni wrote:
> Add check for the return value of adf_cfg_add_key_value_param() and
> return the error if it fails in order to catch the error.
>
> Fixes: 4469f9b23468 ("crypto: qat - re-enable sriov after pf reset")
> Signed-off-by: Chen Ni <nichen@...as.ac.cn>
> ---
> drivers/crypto/intel/qat/qat_common/adf_sriov.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/crypto/intel/qat/qat_common/adf_sriov.c b/drivers/crypto/intel/qat/qat_common/adf_sriov.c
> index 8d645e7e04aa..30ff9097f527 100644
> --- a/drivers/crypto/intel/qat/qat_common/adf_sriov.c
> +++ b/drivers/crypto/intel/qat/qat_common/adf_sriov.c
> @@ -228,8 +228,10 @@ int adf_sriov_configure(struct pci_dev *pdev, int numvfs)
> return ret;
>
> val = 1;
> - adf_cfg_add_key_value_param(accel_dev, ADF_GENERAL_SEC, ADF_SRIOV_ENABLED,
> + ret = adf_cfg_add_key_value_param(accel_dev, ADF_GENERAL_SEC, ADF_SRIOV_ENABLED,
> &val, ADF_DEC);
> + if (ret)
> + return ret;
This has the side effect of failing the enablement of VFs for QAT GEN2 as
ADF_GENERAL_SEC is not present.
For GEN4, where ADF_GENERAL_SEC is used, if this function fails, the recovery
paths is not going to re-enable SRIOV VFs after reset.
It is ok to omit this check.
Regards,
--
Giovanni
Powered by blists - more mailing lists