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 D95667D00 for ; Thu, 26 Apr 2018 18:05:55 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0FFE08D77B; Thu, 26 Apr 2018 16:05:55 +0000 (UTC) Received: from ktraynor.remote.csb (unknown [10.36.118.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id 07D29215CDC8; Thu, 26 Apr 2018 16:05:52 +0000 (UTC) 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> From: Kevin Traynor Organization: Red Hat Message-ID: <07170182-8293-8347-b0ff-9a77885b637f@redhat.com> Date: Thu, 26 Apr 2018 17:05:52 +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: <1524608213-2080-2-git-send-email-arnon@qwilt.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.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Thu, 26 Apr 2018 16:05:55 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Thu, 26 Apr 2018 16:05:55 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.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:05:56 -0000 On 04/24/2018 11:16 PM, Arnon Warshavsky wrote: > replace panic calls with log and return value. > > 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; >