From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v2] ethdev: report error on name truncation Date: Sun, 13 Jan 2019 21:02:53 +0100 Message-ID: <8373161.2Fht6qqTaI@xps> References: <20190107143951.30076-1-ndabilpuram@marvell.com> <20190113153749.3540-1-ndabilpuram@marvell.com> <0D9DB313-B5F8-4AD0-871F-CEECC49B4359@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: Nithin Kumar Dabilpuram , "Yigit, Ferruh" , Andrew Rybchenko , "dev@dpdk.org" , Jerin Jacob Kollanukkaran To: "Wiles, Keith" Return-path: Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by dpdk.org (Postfix) with ESMTP id E31481B118 for ; Sun, 13 Jan 2019 21:03:00 +0100 (CET) In-Reply-To: <0D9DB313-B5F8-4AD0-871F-CEECC49B4359@intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 13/01/2019 20:28, Wiles, Keith: > > On Jan 13, 2019, at 9:38 AM, Nithin Kumar Dabilpuram wrote: > > --- a/lib/librte_ethdev/rte_ethdev.c > > +++ b/lib/librte_ethdev/rte_ethdev.c > > + if (rc >= RTE_MEMZONE_NAMESIZE) { > > + RTE_ETHDEV_LOG(ERR, "truncated name"); > > + rte_errno = ENAMETOOLONG; > > + return NULL; > > + } > > I we are already returning an error here should the RTE_LOG be DEBUG > and not ERR. > Of course this does mean we would have to check return codes :-) In the general case, we should always log the errors as RTE_LOG_ERR, no matter it is handled and logged again at an upper level. Don't you think so?