DPDK patches and discussions
 help / color / mirror / Atom feed
From: Krzysztof Kanas <kkanas@marvell.com>
To: Ferruh Yigit <ferruh.yigit@intel.com>
Cc: Krzysztof Kanas <kkanas@marvell.com>,
	"dev@dpdk.org" <dev@dpdk.org>,
	"John W. Linville" <linville@tuxdriver.com>
Subject: Re: [dpdk-dev] [EXT] Re: [PATCH] net/af_packet: append system error to error msgs
Date: Fri, 5 Jul 2019 09:35:06 +0000	[thread overview]
Message-ID: <20190705093504.GA6680@kk-box-0> (raw)
In-Reply-To: <1c24f2ec-fe4e-0cef-2d83-0f1d139c0bf7@intel.com>

On 19-07-04 19:59, Ferruh Yigit wrote:
> External Email
> 
> ----------------------------------------------------------------------
> On 7/4/2019 3:39 PM, kkanas@marvell.com wrote:
> > From: Krzysztof Kanas <kkanas@marvell.com>
> > 
> > Print system error to make easier diagnosis of errors with af_packet.
> > 
> > Signed-off-by: Krzysztof Kanas <kkanas@marvell.com>
> > ---
> >  drivers/net/af_packet/rte_eth_af_packet.c | 47 ++++++++++++-----------
> >  1 file changed, 24 insertions(+), 23 deletions(-)
> > 
> > diff --git a/drivers/net/af_packet/rte_eth_af_packet.c b/drivers/net/af_packet/rte_eth_af_packet.c
> > index f396f8b22a55..94ae4b13398d 100644
> > --- a/drivers/net/af_packet/rte_eth_af_packet.c
> > +++ b/drivers/net/af_packet/rte_eth_af_packet.c
> > @@ -13,7 +13,9 @@
> >  #include <rte_malloc.h>
> >  #include <rte_kvargs.h>
> >  #include <rte_bus_vdev.h>
> > +#include <rte_errno.h>
> >  
> > +#include <errno.h>
> >  #include <linux/if_ether.h>
> >  #include <linux/if_packet.h>
> >  #include <arpa/inet.h>
> > @@ -605,8 +607,8 @@ rte_pmd_init_internals(struct rte_vdev_device *dev,
> >  	}
> >  	if (ioctl(sockfd, SIOCGIFINDEX, &ifr) == -1) {
> >  		PMD_LOG(ERR,
> > -			"%s: ioctl failed (SIOCGIFINDEX)",
> > -		        name);
> > +			"%s: ioctl failed (SIOCGIFINDEX):%s",
> > +			name, rte_strerror(errno));
> 
> What do you think adding an new macro that adds ":%s, rte_strerror(errno)" part
> automatically and just change the macro on selected logs?
> 
I would rather not, as adding macro adds another indirection, and the 
purpose of rte_strerror(errno) was just to help debugging wrong 
arguments etc..

Also if in macro somebody uses function that changes errno, the 
rte_strerror would give bad result.

But no strong opinion on above.

-- 
-
Regards,
Krzysztof(Chris) Kanas

  reply	other threads:[~2019-07-05  9:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-04 14:39 [dpdk-dev] " kkanas
2019-07-04 18:59 ` Ferruh Yigit
2019-07-05  9:35   ` Krzysztof Kanas [this message]
2019-07-08 18:04     ` [dpdk-dev] [EXT] " 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=20190705093504.GA6680@kk-box-0 \
    --to=kkanas@marvell.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=linville@tuxdriver.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).