DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] ethdev: stop overriding rx_nombuf by rte_eth_stats_get
@ 2017-08-23  1:19 David Harton
  2017-08-23  2:55 ` [dpdk-dev] [PATCH v2 1/2] " David Harton
  0 siblings, 1 reply; 9+ messages in thread
From: David Harton @ 2017-08-23  1:19 UTC (permalink / raw)
  To: thomas; +Cc: dev, David Harton

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>
---
 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..0319e39 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;
 }
 
-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2017-08-23 22:19 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-23  1:19 [dpdk-dev] [PATCH] ethdev: stop overriding rx_nombuf by rte_eth_stats_get 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 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).