DPDK patches and discussions
 help / color / mirror / Atom feed
From: "David Harton (dharton)" <dharton@cisco.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: "thomas@monjalon.net" <thomas@monjalon.net>,
	"dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH v2 1/2] ethdev: stop overriding rx_nombuf by rte_eth_stats_get
Date: Wed, 23 Aug 2017 22:19:34 +0000	[thread overview]
Message-ID: <c290e6f10af84b8e9b684a1145a76181@XCH-RCD-016.cisco.com> (raw)
In-Reply-To: <20170823145631.5fce68dc@xeon-e3>



> -----Original Message-----
> From: Stephen Hemminger [mailto:stephen@networkplumber.org]
> Sent: Wednesday, August 23, 2017 5:57 PM
> To: David Harton (dharton) <dharton@cisco.com>
> Cc: thomas@monjalon.net; dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v2 1/2] ethdev: stop overriding rx_nombuf
> by rte_eth_stats_get
> 
> On Tue, 22 Aug 2017 22:55:55 -0400
> David Harton <dharton@cisco.com> wrote:
> 
> > rte_eth_stats_get() unconditonally would set rx_nombuf even if the
> > device was setting the value.  A check has been added in
> > rte_eth_stats_get() to leave the device value in-tact when non-zero.
> >
> > Signed-off-by: David Harton <dharton@cisco.com>
> > ---
> >
> > v2: Fixed braces complaint required by other coding standards.
> >
> >  lib/librte_ether/rte_ethdev.c | 5 ++++-
> >  1 file changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/lib/librte_ether/rte_ethdev.c
> > b/lib/librte_ether/rte_ethdev.c index 0597641..0a1d3b8 100644
> > --- a/lib/librte_ether/rte_ethdev.c
> > +++ b/lib/librte_ether/rte_ethdev.c
> > @@ -1336,8 +1336,11 @@ struct rte_eth_dev *
> >  	memset(stats, 0, sizeof(*stats));
> >
> >  	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->stats_get, -ENOTSUP);
> > -	stats->rx_nombuf = dev->data->rx_mbuf_alloc_failed;
> >  	(*dev->dev_ops->stats_get)(dev, stats);
> > +	/* only set rx_nombuf if not set by the device */
> > +	if (!stats->rx_nombuf)
> > +		stats->rx_nombuf = dev->data->rx_mbuf_alloc_failed;
> > +
> >  	return 0;
> >  }
> >
> 
> This seems backwards. It seems like the original way worked fine.
> If device specific code wanted to override rx_nombuf it could do so either
> by adding it's additional value or just setting rx_nombuf.
> 
> Adding special cases seems like it would start a bad precedent and the
> could would end up quite complex as some values had one semantic and
> others were only from driver.

Eternal apologies.  This is another example of me trying to upstream a fix we've held on to for far too long and not realizing it has been addressed.  I see that this was fixed here:
53ecfa24fbcd17d9855937391ce347f37434fbfa

Again, apologies...I'll be careful publishing any further fixes trying to determine if others have fixed in different ways.

Regards,
Dave

      reply	other threads:[~2017-08-23 22:19 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-23  1:19 [dpdk-dev] [PATCH] " David Harton
2017-08-23  2:55 ` [dpdk-dev] [PATCH v2 1/2] " David Harton
2017-08-23  7:51   ` Thomas Monjalon
2017-08-23 12:18     ` David Harton (dharton)
2017-08-23 13:24       ` Thomas Monjalon
2017-08-23 21:27         ` David Harton (dharton)
2017-08-23 21:35           ` Thomas Monjalon
2017-08-23 21:56   ` Stephen Hemminger
2017-08-23 22:19     ` David Harton (dharton) [this message]

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=c290e6f10af84b8e9b684a1145a76181@XCH-RCD-016.cisco.com \
    --to=dharton@cisco.com \
    --cc=dev@dpdk.org \
    --cc=stephen@networkplumber.org \
    --cc=thomas@monjalon.net \
    /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).