DPDK patches and discussions
 help / color / mirror / Atom feed
From: Krzysztof Kanas <kkanas@marvell.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: Krzysztof Kanas <kkanas@marvell.com>,
	"27ee549a-d01b-21a5-4a0b-a7e5594b38c0@intel.com"
	<27ee549a-d01b-21a5-4a0b-a7e5594b38c0@intel.com>,
	"dev@dpdk.org" <dev@dpdk.org>,
	Ferruh Yigit <ferruh.yigit@intel.com>,
	"John W. Linville" <linville@tuxdriver.com>
Subject: Re: [dpdk-dev] [EXT] Re: [PATCH v2] net/af_packet: add string error for system errors
Date: Thu, 11 Jul 2019 09:56:32 +0000	[thread overview]
Message-ID: <20190711095629.GA11907@kk-box-0> (raw)
In-Reply-To: <20190710090456.4bfa5833@hermes.lan>

On 19-07-10 09:04, Stephen Hemminger wrote:
> External Email
> 
> ----------------------------------------------------------------------
> On Wed, 10 Jul 2019 16:46:30 +0200
> <kkanas@marvell.com> wrote:
> 
> >  
> > +#define PMD_LOG_ERRNO(level, fmt, args...) \
> > +	rte_log(RTE_LOG_ ## level, af_packet_logtype, \
> > +		"%s(): " fmt ":%s\n", __func__, ##args, rte_strerror(errno))
> > +
> >  static uint16_t
> >  eth_af_packet_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
> >  {
> > @@ -603,9 +609,7 @@ rte_pmd_init_internals(struct rte_vdev_device *dev,
> >  		return -1;
> >  	}
> >  	if (ioctl(sockfd, SIOCGIFINDEX, &ifr) == -1) {
> > -		PMD_LOG(ERR,
> > -			"%s: ioctl failed (SIOCGIFINDEX)",
> > -		        name);
> > +		PMD_LOG_ERRNO(ERR, "%s: ioctl failed (SIOCGIFINDEX)", name);
> >  		return -1;
> 
> This is wrong.
> The ioctl sets errno not rte_errno.
I was following the documentation on rte_strerror, which states:

For non-RTE-specific error codes, this function returns the value from 
the libc strerror function.
>
> 
> Why not?
> 		PMD_LOG(ERR, "%s: ioctl failed (SIOCGIFINDEX): %s",
> 			name, strerror(errno));
Ok, but rte_strerror uses strerror_r, although I am unsure this is 
required here.

-- 
-
Regards,
Krzysztof(Chris) Kanas

  reply	other threads:[~2019-07-11  9:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-10 14:46 [dpdk-dev] " kkanas
2019-07-10 16:04 ` Stephen Hemminger
2019-07-11  9:56   ` Krzysztof Kanas [this message]
2019-07-11 16:10     ` [dpdk-dev] [EXT] " Stephen Hemminger
2019-07-12 10:01       ` [dpdk-dev] [PATCH v3] " kkanas
2019-07-15 14:06         ` Ferruh Yigit

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=20190711095629.GA11907@kk-box-0 \
    --to=kkanas@marvell.com \
    --cc=27ee549a-d01b-21a5-4a0b-a7e5594b38c0@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=linville@tuxdriver.com \
    --cc=stephen@networkplumber.org \
    /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).