DPDK patches and discussions
 help / color / mirror / Atom feed
From: Remy Horton <remy.horton@intel.com>
To: thomas.monjalon@6wind.com
Cc: dev@dpdk.org
Subject: [dpdk-dev] [PATCH v1] ether: fix overwriting driver-specific stats
Date: Tue, 19 Jul 2016 12:05:17 +0100	[thread overview]
Message-ID: <1468926317-2988-1-git-send-email-remy.horton@intel.com> (raw)

After doing a driver callout to fill in the driver specific
parts of struct rte_eth_stats, rte_eth_stats_get() overwrites
the rx_nombuf member regardless of whether the driver itself
has assigned a value. Any driver-assigned value should take
priority.

Fixes: af75078fece3 ("first public release")

Signed-off-by: Remy Horton <remy.horton@intel.com>
---
 lib/librte_ether/rte_ethdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
index 0a6e3f1..f62a9ec 100644
--- a/lib/librte_ether/rte_ethdev.c
+++ b/lib/librte_ether/rte_ethdev.c
@@ -1490,8 +1490,8 @@ rte_eth_stats_get(uint8_t port_id, struct rte_eth_stats *stats)
 	memset(stats, 0, sizeof(*stats));
 
 	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->stats_get, -ENOTSUP);
-	(*dev->dev_ops->stats_get)(dev, stats);
 	stats->rx_nombuf = dev->data->rx_mbuf_alloc_failed;
+	(*dev->dev_ops->stats_get)(dev, stats);
 	return 0;
 }
 
-- 
2.5.5

             reply	other threads:[~2016-07-19 11:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-19 11:05 Remy Horton [this message]
2016-07-21 22:15 ` Thomas Monjalon

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=1468926317-2988-1-git-send-email-remy.horton@intel.com \
    --to=remy.horton@intel.com \
    --cc=dev@dpdk.org \
    --cc=thomas.monjalon@6wind.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).