DPDK patches and discussions
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas.monjalon@6wind.com>
To: jean.tourrilhes@hpe.com,
	Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH 1/1 v2] eal: Fix misleading error messages, errno can't be trusted.
Date: Mon, 03 Oct 2016 22:46:57 +0200	[thread overview]
Message-ID: <6928094.Vgjcapsp68@xps13> (raw)
In-Reply-To: <20161003155556.GA23662@labs.hpe.com>

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?

  parent reply	other threads:[~2016-10-03 20:46 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-21 21:10 Jean Tourrilhes
2016-10-03 13:25 ` Sergio Gonzalez Monroy
2016-10-03 15:55   ` Jean Tourrilhes
2016-10-03 16:15     ` Mcnamara, John
2016-10-03 16:34       ` Jean Tourrilhes
2016-10-03 20:46     ` Thomas Monjalon [this message]
2016-10-04  8:03       ` Sergio Gonzalez Monroy
2016-10-04  9:31         ` Thomas Monjalon
2016-10-04 17:17           ` [dpdk-dev] [PATCH v2 1/3] mem: fix hugepage mapping error messages Jean Tourrilhes
2016-10-04 19:07             ` Sergio Gonzalez Monroy
2016-10-05  9:51               ` Thomas Monjalon
2016-10-05 16:41                 ` Jean Tourrilhes
2016-10-03 16:07   ` [dpdk-dev] [PATCH 1/1 v2] eal: Fix misleading error messages, errno can't be trusted Jean Tourrilhes

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6928094.Vgjcapsp68@xps13 \
    --to=thomas.monjalon@6wind.com \
    --cc=dev@dpdk.org \
    --cc=jean.tourrilhes@hpe.com \
    --cc=sergio.gonzalez.monroy@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).