[v1,1/2] crypto/qat: improve security instance setup
Checks
Commit Message
This patch makes some minor improvements to the security instance setup
for the QAT SYM PMD. All of this setup code is now in one '#ifdef
RTE_LIBRTE_SECURITY' block. Enabling the RTE_CRYPTODEV_FF_SECURITY
feature for the device is also moved to this block.
Fixes: 6f0ef237404b ("crypto/qat: support DOCSIS protocol")
Signed-off-by: David Coyle <david.coyle@intel.com>
---
drivers/crypto/qat/qat_sym_pmd.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
Comments
> -----Original Message-----
> From: Coyle, David <david.coyle@intel.com>
> Sent: Thursday, July 16, 2020 4:36 PM
> To: akhil.goyal@nxp.com; Doherty, Declan <declan.doherty@intel.com>; De Lara Guarch, Pablo
> <pablo.de.lara.guarch@intel.com>; Trahe, Fiona <fiona.trahe@intel.com>
> Cc: dev@dpdk.org; Ryan, Brendan <brendan.ryan@intel.com>; O'loingsigh, Mairtin
> <mairtin.oloingsigh@intel.com>; Coyle, David <david.coyle@intel.com>
> Subject: [PATCH v1 1/2] crypto/qat: improve security instance setup
>
> This patch makes some minor improvements to the security instance setup
> for the QAT SYM PMD. All of this setup code is now in one '#ifdef
> RTE_LIBRTE_SECURITY' block. Enabling the RTE_CRYPTODEV_FF_SECURITY
> feature for the device is also moved to this block.
>
> Fixes: 6f0ef237404b ("crypto/qat: support DOCSIS protocol")
>
> Signed-off-by: David Coyle <david.coyle@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
> > This patch makes some minor improvements to the security instance setup
> > for the QAT SYM PMD. All of this setup code is now in one '#ifdef
> > RTE_LIBRTE_SECURITY' block. Enabling the RTE_CRYPTODEV_FF_SECURITY
> > feature for the device is also moved to this block.
> >
> > Fixes: 6f0ef237404b ("crypto/qat: support DOCSIS protocol")
> >
> > Signed-off-by: David Coyle <david.coyle@intel.com>
> Acked-by: Fiona Trahe <fiona.trahe@intel.com>
This patch is applied to dpdk-next-crypto
Please send next version for 2/2 of this series.
>
> > > This patch makes some minor improvements to the security instance setup
> > > for the QAT SYM PMD. All of this setup code is now in one '#ifdef
> > > RTE_LIBRTE_SECURITY' block. Enabling the RTE_CRYPTODEV_FF_SECURITY
> > > feature for the device is also moved to this block.
> > >
> > > Fixes: 6f0ef237404b ("crypto/qat: support DOCSIS protocol")
> > >
> > > Signed-off-by: David Coyle <david.coyle@intel.com>
> > Acked-by: Fiona Trahe <fiona.trahe@intel.com>
>
> This patch is applied to dpdk-next-crypto
>
> Please send next version for 2/2 of this series.
No this patch is pulled back. I suppose the memory leak is there in this patch also.
Hi Akhil,
> -----Original Message-----
> From: Akhil Goyal <akhil.goyal@nxp.com>
> Sent: Saturday, July 18, 2020 10:41 PM
> > > > This patch makes some minor improvements to the security instance
> > > > setup for the QAT SYM PMD. All of this setup code is now in one
> > > > '#ifdef RTE_LIBRTE_SECURITY' block. Enabling the
> > > > RTE_CRYPTODEV_FF_SECURITY feature for the device is also moved to
> this block.
> > > >
> > > > Fixes: 6f0ef237404b ("crypto/qat: support DOCSIS protocol")
> > > >
> > > > Signed-off-by: David Coyle <david.coyle@intel.com>
> > > Acked-by: Fiona Trahe <fiona.trahe@intel.com>
> >
> > This patch is applied to dpdk-next-crypto
> >
> > Please send next version for 2/2 of this series.
>
> No this patch is pulled back. I suppose the memory leak is there in this patch
> also.
[DC] Yes, memory leak is here too and is fixed in v2
@@ -346,10 +346,6 @@ qat_sym_dev_create(struct qat_pci_device *qat_pci_dev,
}
}
-#ifdef RTE_LIBRTE_SECURITY
- struct rte_security_ctx *security_instance;
-#endif
-
snprintf(name, RTE_CRYPTODEV_NAME_MAX_LEN, "%s_%s",
qat_pci_dev->name, "sym");
QAT_LOG(DEBUG, "Creating QAT SYM device %s", name);
@@ -381,8 +377,7 @@ qat_sym_dev_create(struct qat_pci_device *qat_pci_dev,
RTE_CRYPTODEV_FF_OOP_SGL_IN_LB_OUT |
RTE_CRYPTODEV_FF_OOP_LB_IN_SGL_OUT |
RTE_CRYPTODEV_FF_OOP_LB_IN_LB_OUT |
- RTE_CRYPTODEV_FF_DIGEST_ENCRYPTED |
- RTE_CRYPTODEV_FF_SECURITY;
+ RTE_CRYPTODEV_FF_DIGEST_ENCRYPTED;
if (rte_eal_process_type() != RTE_PROC_PRIMARY)
return 0;
@@ -392,6 +387,7 @@ qat_sym_dev_create(struct qat_pci_device *qat_pci_dev,
qat_pci_dev->qat_dev_gen);
#ifdef RTE_LIBRTE_SECURITY
+ struct rte_security_ctx *security_instance;
security_instance = rte_malloc("qat_sec",
sizeof(struct rte_security_ctx),
RTE_CACHE_LINE_SIZE);
@@ -405,6 +401,7 @@ qat_sym_dev_create(struct qat_pci_device *qat_pci_dev,
security_instance->ops = &security_qat_ops;
security_instance->sess_cnt = 0;
cryptodev->security_ctx = security_instance;
+ cryptodev->feature_flags |= RTE_CRYPTODEV_FF_SECURITY;
#endif
internals = cryptodev->data->dev_private;