From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.tuxdriver.com (charlotte.tuxdriver.com [70.61.120.58]) by dpdk.org (Postfix) with ESMTP id 59440199AC for ; Mon, 16 Apr 2018 13:49:58 +0200 (CEST) Received: from cpe-2606-a000-111b-40b7-640c-26a-4e16-9225.dyn6.twc.com ([2606:a000:111b:40b7:640c:26a:4e16:9225] helo=localhost) by smtp.tuxdriver.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1f82dl-0007zc-4Y; Mon, 16 Apr 2018 07:49:47 -0400 Date: Mon, 16 Apr 2018 07:49:12 -0400 From: Neil Horman To: Arnon Warshavsky Cc: 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, dev@dpdk.org Message-ID: <20180416114912.GB25243@hmswarspite.think-freely.org> References: <1523644244-17511-1-git-send-email-arnon@qwilt.com> <1523644244-17511-2-git-send-email-arnon@qwilt.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1523644244-17511-2-git-send-email-arnon@qwilt.com> User-Agent: Mutt/1.9.2 (2017-12-15) X-Spam-Score: -2.9 (--) X-Spam-Status: No Subject: Re: [dpdk-dev] [PATCH v3 01/13] crypto: replace rte_panic instances in crypto 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: Mon, 16 Apr 2018 11:49:58 -0000 On Fri, Apr 13, 2018 at 09:30:32PM +0300, Arnon Warshavsky wrote: > replace panic calls with log and return value. > > -- > v2: > - reformat error message to include literal string in a single line > > Signed-off-by: Arnon Warshavsky > --- > drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 8 +++++--- > drivers/crypto/dpaa_sec/dpaa_sec.c | 8 +++++--- > 2 files changed, 10 insertions(+), 6 deletions(-) > > diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c > index 784b96d..9e0ca7f 100644 > --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c > +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c > @@ -2861,9 +2861,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 -1; > + } > } > > dpaa2_dev->cryptodev = cryptodev; > diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c > index c5191ce..793891a 100644 > --- a/drivers/crypto/dpaa_sec/dpaa_sec.c > +++ b/drivers/crypto/dpaa_sec/dpaa_sec.c > @@ -2374,9 +2374,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 -1; > + } > } > This function is only called from locations that return a -errno code, not just -1. Neil > dpaa_dev->crypto_dev = cryptodev; > -- > 1.8.3.1 > >