From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from g2t2352.austin.hpe.com (g2t2352.austin.hpe.com [15.233.44.25]) by dpdk.org (Postfix) with ESMTP id 7B00F6CA4 for ; Mon, 3 Oct 2016 17:55:59 +0200 (CEST) Received: from g2t2360.austin.hpecorp.net (g2t2360.austin.hpecorp.net [16.196.225.135]) by g2t2352.austin.hpe.com (Postfix) with ESMTP id B9D8F4D; Mon, 3 Oct 2016 15:55:58 +0000 (UTC) Received: from postal.labs.hpecorp.net (mailhub.labs.hpe.com [16.111.35.25]) by g2t2360.austin.hpecorp.net (Postfix) with ESMTP id 9C7343F; Mon, 3 Oct 2016 15:55:58 +0000 (UTC) Received: from bougret.labs.hpecorp.net (bougret.labs.hpecorp.net [16.111.8.16]) by postal.labs.hpecorp.net (8.14.4/8.14.4/HPL-PA Hub) with ESMTP id u93FtuSC023862 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Mon, 3 Oct 2016 08:55:57 -0700 Received: from jt by bougret.labs.hpecorp.net with local (Exim 4.84_2) (envelope-from ) id 1br5au-0006IJ-Iq; Mon, 03 Oct 2016 08:55:56 -0700 Date: Mon, 3 Oct 2016 08:55:56 -0700 From: Jean Tourrilhes To: Sergio Gonzalez Monroy Cc: dev@dpdk.org Message-ID: <20161003155556.GA23662@labs.hpe.com> References: <20160921211049.GA27472@labs.hpe.com> <4a84de40-04b9-da6d-aeb9-ce661a9ebad5@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4a84de40-04b9-da6d-aeb9-ce661a9ebad5@intel.com> Organisation: HP Labs Palo Alto Address: HP Labs, MS1184, 1501 Page Mill road, Palo Alto, CA 94304, USA. E-mail: jean.tourrilhes@hpe.com User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [dpdk-dev] [PATCH 1/1 v2] eal: Fix misleading error messages, errno can't be trusted. X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: jean.tourrilhes@hpe.com List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Oct 2016 15:55:59 -0000 On Mon, Oct 03, 2016 at 02:25:40PM +0100, Sergio Gonzalez Monroy wrote: > Hi Jean, > > There are some format issues with the patch: > > You can run scripts/check-git-log.sh to check them: > Wrong headline format: > eal: Fix misleading error messages, errno can't be trusted. > Wrong headline uppercase: > eal: Fix misleading error messages, errno can't be trusted. > Missing 'Fixes' tag: > eal: Fix misleading error messages, errno can't be trusted. > > The script's output highlights the different issues. SOrry about that, I casually read the page on http://dpdk.org/dev, but obviously I need to look at it again. > On 21/09/2016 22:10, Jean Tourrilhes wrote: > >@@ -263,9 +264,16 @@ rte_eal_config_reattach(void) > > mem_config = (struct rte_mem_config *) mmap(rte_mem_cfg_addr, > > sizeof(*mem_config), PROT_READ | PROT_WRITE, MAP_SHARED, > > mem_cfg_fd, 0); > >+ if (mem_config == MAP_FAILED || mem_config != rte_mem_cfg_addr) { > >+ if (mem_config != MAP_FAILED) > >+ /* errno is stale, don't use */ > >+ rte_panic("Cannot mmap memory for rte_config at [%p], got [%p] - please use '--base-virtaddr' option\n", > >+ rte_mem_cfg_addr, mem_config); > >+ else > >+ rte_panic("Cannot mmap memory for rte_config! error %i (%s)\n", > >+ errno, strerror(errno)); > >+ } > > close(mem_cfg_fd); > >- if (mem_config == MAP_FAILED || mem_config != rte_mem_cfg_addr) > >- rte_panic("Cannot mmap memory for rte_config\n"); > > NIT but any reason you moved the check before closing the file descriptor? > (not that it matters with current code as we panic anyway) "close()" may change "errno" according to its man page. > Thanks, > Sergio Thanks for the review ! Jean