From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f50.google.com (mail-wm0-f50.google.com [74.125.82.50]) by dpdk.org (Postfix) with ESMTP id D10E858C8 for ; Mon, 3 Oct 2016 22:46:59 +0200 (CEST) Received: by mail-wm0-f50.google.com with SMTP id p138so173424556wmb.1 for ; Mon, 03 Oct 2016 13:46:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:user-agent:in-reply-to :references:mime-version:content-transfer-encoding; bh=QtyFqmvtFtwNeHJ+SyfhBIvVLB++zkZAEYoXdeC2lrY=; b=w4thUnCNJN33ydP5g3IF13Xqbmu6PIlJTGZLr8RfYBrVURKxW7tnkyKv5M7zQOO5Py gUY2bM+VLcq5Xajqto1kftmoPMsNSL+LYnbHEZDqdxPeLfkH3hO1IHNbJ55Y9dlKyyI8 W1LgJELtuC1QsRK+VKDSJZpGopKxRAPOhddjoKzQHlhUJs/mufpsb9JF3cQzc7/Q1g5E 2CbK3aWSdluWCcUtwSFpL+qAziEgNvO9EcClrDFYh8EfyvkGvj7q/YE5xYjt3FrZAo6C cc+jbFsXiFLLdn2I8cQsUkYUFlgga+HsA/D7NLlim7sa57Nh/DKIfKdva01TehedWPqO sRhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:user-agent :in-reply-to:references:mime-version:content-transfer-encoding; bh=QtyFqmvtFtwNeHJ+SyfhBIvVLB++zkZAEYoXdeC2lrY=; b=KhRZRCRtKkq4kRXIKJhb3edwZ+TAQ3kF1N9ewzik266yYxgUjCBkZfV1TbqGX9WG5s SmRbN9Ffmd2DYjKBBKCHQQ+Spj0A35dsS1ZU7U2N2ae8cE344rSuJldmRHM/kLXqSYjd /qEyY4mwrM1UfQgOP4z/NDCjcruEdTDCj70kftQ1MoftgYuSIIkR2MzKYKKgorTyb7DQ eTOxKQM7fVGfb0JzCISWCjzO/vzFcuYHi1VRnhTu25n1qI/0ZaGONZB7dFAFaAxqPfIe 77GhqOKHSr+JCEou8JkGq9l69jzZk1RRjPAoesztL06sxik8KwYXQrB4Hg2cc+LNKXgO oaMg== X-Gm-Message-State: AA6/9RlUtc2ljePnCzgZWxwU0DsVYceBSmW9CFaPfeTniEHUG9DR18MYoa+BzPS1aHSIzuC9 X-Received: by 10.28.188.139 with SMTP id m133mr521833wmf.10.1475527619590; Mon, 03 Oct 2016 13:46:59 -0700 (PDT) Received: from xps13.localnet (184.203.134.77.rev.sfr.net. [77.134.203.184]) by smtp.gmail.com with ESMTPSA id u64sm20696275wmd.20.2016.10.03.13.46.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Oct 2016 13:46:58 -0700 (PDT) From: Thomas Monjalon To: jean.tourrilhes@hpe.com, Sergio Gonzalez Monroy Cc: dev@dpdk.org Date: Mon, 03 Oct 2016 22:46:57 +0200 Message-ID: <6928094.Vgjcapsp68@xps13> User-Agent: KMail/4.14.10 (Linux/4.5.4-1-ARCH; KDE/4.14.11; x86_64; ; ) In-Reply-To: <20161003155556.GA23662@labs.hpe.com> References: <20160921211049.GA27472@labs.hpe.com> <4a84de40-04b9-da6d-aeb9-ce661a9ebad5@intel.com> <20161003155556.GA23662@labs.hpe.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" 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: Mon, 03 Oct 2016 20:47:00 -0000 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? Should we wait another version or is it OK? Maybe you'd prefer to rework it yourself?