[dpdk-dev] test/pmd-perf: declare variables as static

Message ID 20180119143713.73000-1-pablo.de.lara.guarch@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers

Checks

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

Commit Message

De Lara Guarch, Pablo Jan. 19, 2018, 2:37 p.m. UTC
  Some variables in the PMD perf test were declared as global,
but they are only used in this test, so they should actually
be declared as static.

Fixes: 002ade70e933 ("app/test: measure cycles per packet in Rx/Tx")
Cc: stable@dpdk.org

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
---
 test/test/test_pmd_perf.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
  

Comments

Thomas Monjalon Feb. 1, 2018, 12:07 a.m. UTC | #1
19/01/2018 15:37, Pablo de Lara:
> Some variables in the PMD perf test were declared as global,
> but they are only used in this test, so they should actually
> be declared as static.
> 
> Fixes: 002ade70e933 ("app/test: measure cycles per packet in Rx/Tx")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>

Applied, thanks
  

Patch

diff --git a/test/test/test_pmd_perf.c b/test/test/test_pmd_perf.c
index 739929401..e2cdef254 100644
--- a/test/test/test_pmd_perf.c
+++ b/test/test/test_pmd_perf.c
@@ -292,10 +292,10 @@  alloc_lcore(uint16_t socketid)
 	return (uint16_t)-1;
 }
 
-volatile uint64_t stop;
-uint64_t count;
-uint64_t drop;
-uint64_t idle;
+static volatile uint64_t stop;
+static uint64_t count;
+static uint64_t drop;
+static uint64_t idle;
 
 static void
 reset_count(void)
@@ -528,7 +528,7 @@  main_loop(__rte_unused void *args)
 	return 0;
 }
 
-rte_atomic64_t start;
+static rte_atomic64_t start;
 
 static inline int
 poll_burst(void *args)