From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by dpdk.org (Postfix) with ESMTP id F3CAC989F for ; Thu, 26 Apr 2018 18:16:16 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8D6144023112; Thu, 26 Apr 2018 16:16:16 +0000 (UTC) Received: from ktraynor.remote.csb (unknown [10.36.118.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id A028B202323B; Thu, 26 Apr 2018 16:16:14 +0000 (UTC) From: Kevin Traynor To: Arnon Warshavsky , thomas@monjalon.net, anatoly.burakov@intel.com, wenzhuo.lu@intel.com, declan.doherty@intel.com, jerin.jacob@caviumnetworks.com, bruce.richardson@intel.com, ferruh.yigit@intel.com Cc: dev@dpdk.org References: <1524608213-2080-1-git-send-email-arnon@qwilt.com> <1524608213-2080-2-git-send-email-arnon@qwilt.com> <07170182-8293-8347-b0ff-9a77885b637f@redhat.com> Organization: Red Hat Message-ID: <768e4f78-5dd5-34dd-adc2-1a581dc04888@redhat.com> Date: Thu, 26 Apr 2018 17:16:13 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: <07170182-8293-8347-b0ff-9a77885b637f@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Thu, 26 Apr 2018 16:16:16 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Thu, 26 Apr 2018 16:16:16 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'ktraynor@redhat.com' RCPT:'' Subject: Re: [dpdk-dev] [PATCH v7 01/11] crypto/dpaa: replace rte_panic instances in crypto/dpaa driver X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Apr 2018 16:16:17 -0000 On 04/26/2018 05:05 PM, Kevin Traynor wrote: > On 04/24/2018 11:16 PM, Arnon Warshavsky wrote: >> replace panic calls with log and return value. >> Replied to wrong version. Comments are still relevant for v9, Kevin. >> Signed-off-by: Arnon Warshavsky >> --- >> drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 8 +++++--- >> drivers/crypto/dpaa_sec/dpaa_sec.c | 10 ++++++---- >> 2 files changed, 11 insertions(+), 7 deletions(-) >> >> diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c >> index 58cbce8..a78f3a2 100644 >> --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c >> +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c >> @@ -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) { >> + DPAA_SEC_ERR("%s() Cannot allocate memzone for private device data", >> + __func__); >> + return -ENOMEM; > > I'm not familiar with the code but there was a successful allocate > already, so it seems you should jump to the cleanup section at the end > of the function before returning. > >> + } >> } >> >> dpaa2_dev->cryptodev = cryptodev; >> diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c >> index e456fd5..a4670bf 100644 >> --- a/drivers/crypto/dpaa_sec/dpaa_sec.c >> +++ b/drivers/crypto/dpaa_sec/dpaa_sec.c >> @@ -2352,7 +2352,7 @@ struct rte_security_ops dpaa_sec_security_ops = { >> } >> } >> >> - RTE_LOG(INFO, PMD, "%s cryptodev init\n", cryptodev->data->name); >> + DPAA_SEC_INFO("%s cryptodev init\n", cryptodev->data->name); > > This fix is an unrelated to the patchset. Perhaps as it's trivial the > maintainer will allow it > >> return 0; >> >> init_error: >> @@ -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) { >> + DPAA_SEC_ERR("%s() Cannot allocate memzone for private device data", >> + __func__); >> + return -ENOMEM; > > Same comment as above > >> + } >> } >> >> dpaa_dev->crypto_dev = cryptodev; >> >