From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 27C7368CF for ; Tue, 4 Oct 2016 10:03:11 +0200 (CEST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP; 04 Oct 2016 01:03:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,442,1473145200"; d="scan'208";a="1040039836" Received: from unknown (HELO [10.237.220.71]) ([10.237.220.71]) by orsmga001.jf.intel.com with ESMTP; 04 Oct 2016 01:03:09 -0700 To: Thomas Monjalon , jean.tourrilhes@hpe.com References: <20160921211049.GA27472@labs.hpe.com> <4a84de40-04b9-da6d-aeb9-ce661a9ebad5@intel.com> <20161003155556.GA23662@labs.hpe.com> <6928094.Vgjcapsp68@xps13> Cc: dev@dpdk.org From: Sergio Gonzalez Monroy Message-ID: <417ffa55-a8bf-a769-d751-b023d72993d8@intel.com> Date: Tue, 4 Oct 2016 09:03:08 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: <6928094.Vgjcapsp68@xps13> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit 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 List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Oct 2016 08:03:11 -0000 On 03/10/2016 21:46, Thomas Monjalon wrote: > 2016-10-03 08:55, Jean Tourrilhes: >> 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. > No problem. This guide is more oriented towards regular contributors. > You come with a bug and its fix, we can make some effort to format > the patch :) > > The title could be "mem: fix hugepage mapping error messages" > >>> 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. > Sergio, do you have more comments? Nop. > Should we wait another version or is it OK? > Maybe you'd prefer to rework it yourself? AFAICS it really is just the commit message formatting, so maybe you can fix that when applying it? Sergio