DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/failsafe: improve stats accuracy
@ 2017-10-16  7:41 Matan Azrad
  2017-10-16  8:27 ` Gaëtan Rivet
  2017-10-19 14:31 ` [dpdk-dev] [PATCH v2] " Matan Azrad
  0 siblings, 2 replies; 10+ messages in thread
From: Matan Azrad @ 2017-10-16  7:41 UTC (permalink / raw)
  To: Gaetan Rivet; +Cc: dev

The stats_get API was changed to return error in case of failure at
stats getting process time.
By this way, failsafe can get stats snapshot in removal process for
each PMD which can give stats after removal event.

This patch implements ultimate stats snapshot on removal time by
trying to get the removed device stats before calling to dev_close.

Signed-off-by: Matan Azrad <matan@mellanox.com>
---
 drivers/net/failsafe/failsafe_ether.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/net/failsafe/failsafe_ether.c b/drivers/net/failsafe/failsafe_ether.c
index f4db423..2758d4c 100644
--- a/drivers/net/failsafe/failsafe_ether.c
+++ b/drivers/net/failsafe/failsafe_ether.c
@@ -312,8 +312,12 @@
 static void
 fs_dev_stats_save(struct sub_device *sdev)
 {
+	struct rte_eth_stats stats;
+
+	/* Get stats now or take it from last snapshot. */
 	failsafe_stats_increment(&PRIV(sdev->fs_dev)->stats_accumulator,
-			&sdev->stats_snapshot);
+		rte_eth_stats_get(PORT_ID(sdev), &stats) ?
+		&sdev->stats_snapshot : &stats);
 	memset(&sdev->stats_snapshot, 0, sizeof(struct rte_eth_stats));
 }
 
-- 
1.8.3.1

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

end of thread, other threads:[~2017-10-23 21:02 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-16  7:41 [dpdk-dev] [PATCH] net/failsafe: improve stats accuracy Matan Azrad
2017-10-16  8:27 ` Gaëtan Rivet
2017-10-16  8:51   ` Matan Azrad
2017-10-19 14:31 ` [dpdk-dev] [PATCH v2] " Matan Azrad
2017-10-19 15:08   ` Gaëtan Rivet
2017-10-21 20:54   ` [dpdk-dev] [PATCH v3 1/2] " Matan Azrad
2017-10-21 20:54     ` [dpdk-dev] [PATCH v3 2/2] net/failsafe: add timestamp to stats snapshot Matan Azrad
2017-10-23  8:46       ` Gaëtan Rivet
2017-10-23  8:46     ` [dpdk-dev] [PATCH v3 1/2] net/failsafe: improve stats accuracy Gaëtan Rivet
2017-10-23 21:01       ` Ferruh Yigit

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).