[dpdk-dev,v6,01/11] crypto/dpaa: replace rte_panic instances in crypto/dpaa driver
Checks
Commit Message
replace panic calls with log and return value.
Signed-off-by: Arnon Warshavsky <arnon@qwilt.com>
---
drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 8 +++++---
drivers/crypto/dpaa_sec/dpaa_sec.c | 8 +++++---
2 files changed, 10 insertions(+), 6 deletions(-)
Comments
On Tue, 24 Apr 2018 09:41:53 +0300
Arnon Warshavsky <arnon@qwilt.com> wrote:
> + if (cryptodev->data->dev_private == NULL) {
> + RTE_LOG(ERR, PMD, "%s() Cannot allocate memzone for private device data",
> + __func__);
dpaa2_sec is already doing private log type, via DPAA2_SEC_LOG macro.
You should go through your patch and make sure there are as few direct calls
to RTE_LOG as possible.
>
>
> > + if (cryptodev->data->dev_private == NULL) {
> > + RTE_LOG(ERR, PMD, "%s() Cannot allocate memzone
> for private device data",
> > + __func__);
>
> dpaa2_sec is already doing private log type, via DPAA2_SEC_LOG macro.
>
> You should go through your patch and make sure there are as few direct
> calls
> to RTE_LOG as possible.
>
Thanks Stephen,
missed that one which seems to be declared but not yet used.Will replace
I may be missing something here.
While seeing the point in a short common form such as PMD_DRV_LOG,
why won't dpaa use the same syntax rather than adding another syntax
variant which does pretty much the same?
@@ -2883,9 +2883,11 @@ struct rte_security_ops dpaa2_sec_security_ops = {
RTE_CACHE_LINE_SIZE,
rte_socket_id());
- if (cryptodev->data->dev_private == NULL)
- rte_panic("Cannot allocate memzone for private "
- "device data");
+ if (cryptodev->data->dev_private == NULL) {
+ RTE_LOG(ERR, PMD, "%s() Cannot allocate memzone for private device data",
+ __func__);
+ return -ENOMEM;
+ }
}
dpaa2_dev->cryptodev = cryptodev;
@@ -2384,9 +2384,11 @@ struct rte_security_ops dpaa_sec_security_ops = {
RTE_CACHE_LINE_SIZE,
rte_socket_id());
- if (cryptodev->data->dev_private == NULL)
- rte_panic("Cannot allocate memzone for private "
- "device data");
+ if (cryptodev->data->dev_private == NULL) {
+ RTE_LOG(ERR, PMD, "%s() Cannot allocate memzone for private device data",
+ __func__);
+ return -ENOMEM;
+ }
}
dpaa_dev->crypto_dev = cryptodev;