DPDK patches and discussions
 help / color / mirror / Atom feed
From: Akhil Goyal <akhil.goyal@nxp.com>
To: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>,
	"dev@dpdk.org" <dev@dpdk.org>
Cc: Hemant Agrawal <hemant.agrawal@nxp.com>
Subject: Re: [dpdk-dev] [PATCH v2 1/2] crypto/dpaa2_sec: improve error handling
Date: Tue, 5 May 2020 13:47:59 +0000	[thread overview]
Message-ID: <VI1PR04MB31683EA56FA841CC93A5B59BE6A70@VI1PR04MB3168.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <2f74e9a3-e00a-8c64-75d8-858aecbac133@partner.samsung.com>

Hi Lukasz,
> 
> Hi Akhil,
> 
> There are still few places, where returned error code is not set.
> Maybe you can add those places to your patch?

Thanks for the review. I will surely look into it.


> 
> Here's the list:
> 
> --- a/drivers/crypto/dpaa_sec/dpaa_sec.c
> +++ b/drivers/crypto/dpaa_sec/dpaa_sec.c
> @@ -510,6 +510,7 @@ dpaa_sec_prep_cdb(dpaa_sec_session *ses)
>                          break;
>                  default:
>                          DPAA_SEC_ERR("unsupported auth alg %u",
> ses->auth_alg);
> +                       /* this path will return 0 */
>                  }
>                  break;
>          case DPAA_SEC_AEAD:
> @@ -2308,7 +2309,7 @@ dpaa_sec_attach_sess_q(struct dpaa_sec_qp *qp,
> dpaa_sec_session *sess)
>          ret = dpaa_sec_prep_cdb(sess);
>          if (ret) {
>                  DPAA_SEC_ERR("Unable to prepare sec cdb");
> -               return -1;
> +               return -1; /* Why not return ret ? */
>          }
>          if (unlikely(!RTE_PER_LCORE(dpaa_io))) {
>                  ret = rte_dpaa_portal_init((void *)0);
> @@ -2826,7 +2827,7 @@ dpaa_sec_set_ipsec_session(__rte_unused struct
> rte_cryptodev *dev,
>                          }
>                  }
>          } else
> -               goto out;
> +               goto out; /* set ret before goto */
>          rte_spinlock_lock(&internals->lock);
>          for (i = 0; i < MAX_DPAA_CORES; i++) {
>                  session->inq[i] = dpaa_sec_attach_rxq(internals);
> @@ -2843,7 +2844,7 @@ dpaa_sec_set_ipsec_session(__rte_unused struct
> rte_cryptodev *dev,
>          rte_free(session->auth_key.data);
>          rte_free(session->cipher_key.data);
>          memset(session, 0, sizeof(dpaa_sec_session));
> -       return -1;
> +       return -1; /* return ret ? */
>   }
> 
>   static int
> @@ -2992,7 +2993,7 @@ dpaa_sec_set_pdcp_session(struct rte_cryptodev
> *dev,
>          rte_free(session->auth_key.data);
>          rte_free(session->cipher_key.data);
>          memset(session, 0, sizeof(dpaa_sec_session));
> -       return -1;
> +       return -1; /* still returning generic -1 */
>   }
> 
>   static int
> 
> --
> 
> Lukasz Wojciechowski
> Principal Software Engineer
> 
> Samsung R&D Institute Poland
> Samsung Electronics
> Office +48 22 377 88 25
> l.wojciechow@partner.samsung.com


  reply	other threads:[~2020-05-05 13:48 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-04 20:39 [dpdk-dev] [PATCH " Akhil Goyal
2020-05-04 20:39 ` [dpdk-dev] [PATCH 2/2] crypto/dpaa_sec: " Akhil Goyal
2020-05-04 21:39 ` [dpdk-dev] [PATCH v2 1/2] crypto/dpaa2_sec: " Akhil Goyal
2020-05-04 21:39   ` [dpdk-dev] [PATCH v2 2/2] crypto/dpaa_sec: " Akhil Goyal
2020-05-05  1:17   ` [dpdk-dev] [PATCH v2 1/2] crypto/dpaa2_sec: " Lukasz Wojciechowski
2020-05-05 13:47     ` Akhil Goyal [this message]
2020-05-09 22:22   ` [dpdk-dev] [PATCH v3 " Akhil Goyal
2020-05-09 22:22     ` [dpdk-dev] [PATCH v3 2/2] crypto/dpaa_sec: " Akhil Goyal
2020-05-11  6:14       ` Hemant Agrawal (OSS)
2020-05-11  6:13     ` [dpdk-dev] [PATCH v3 1/2] crypto/dpaa2_sec: " Hemant Agrawal (OSS)
2020-05-11  7:59       ` Akhil Goyal

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=VI1PR04MB31683EA56FA841CC93A5B59BE6A70@VI1PR04MB3168.eurprd04.prod.outlook.com \
    --to=akhil.goyal@nxp.com \
    --cc=dev@dpdk.org \
    --cc=hemant.agrawal@nxp.com \
    --cc=l.wojciechow@partner.samsung.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;
as well as URLs for NNTP newsgroup(s).