[12/12] examples/ip_pipeline: fix port and table stats read

Message ID 1541158623-29742-12-git-send-email-cristian.dumitrescu@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Cristian Dumitrescu
Headers
Series [01/12] examples/ip_pipeline: add rule list per table |

Checks

Context Check Description
ci/Intel-compilation success Compilation OK
ci/checkpatch success coding style OK

Commit Message

Cristian Dumitrescu Nov. 2, 2018, 11:37 a.m. UTC
  Fix the pipeline port and table stats read operation.

Fixes: 50e73d051806 ("examples/ip_pipeline: add stats read commands")

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Signed-off-by: Hongjun Ni <hongjun.ni@intel.com>
---
 examples/ip_pipeline/thread.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
  

Patch

diff --git a/examples/ip_pipeline/thread.c b/examples/ip_pipeline/thread.c
index e1b6fb6..272fbbe 100644
--- a/examples/ip_pipeline/thread.c
+++ b/examples/ip_pipeline/thread.c
@@ -820,7 +820,7 @@  pipeline_port_in_stats_read(const char *pipeline_name,
 
 	/* Read response */
 	status = rsp->status;
-	if (status)
+	if (status == 0)
 		memcpy(stats, &rsp->port_in_stats_read.stats, sizeof(*stats));
 
 	/* Free response */
@@ -968,7 +968,7 @@  pipeline_port_out_stats_read(const char *pipeline_name,
 
 	/* Read response */
 	status = rsp->status;
-	if (status)
+	if (status == 0)
 		memcpy(stats, &rsp->port_out_stats_read.stats, sizeof(*stats));
 
 	/* Free response */
@@ -1024,7 +1024,7 @@  pipeline_table_stats_read(const char *pipeline_name,
 
 	/* Read response */
 	status = rsp->status;
-	if (status)
+	if (status == 0)
 		memcpy(stats, &rsp->table_stats_read.stats, sizeof(*stats));
 
 	/* Free response */