From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id B9C89A04F3 for ; Thu, 19 Dec 2019 15:38:08 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B0DD31BFB9; Thu, 19 Dec 2019 15:38:08 +0100 (CET) Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) by dpdk.org (Postfix) with ESMTP id EEB081BFB6 for ; Thu, 19 Dec 2019 15:38:05 +0100 (CET) Received: by mail-wr1-f51.google.com with SMTP id y11so6216657wrt.6 for ; Thu, 19 Dec 2019 06:38:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=qC4b6oWovP7dRcyj9iCCJ6MruIhoxreTnKxOCwsw26s=; b=Emby6jhSdEBW5OpxPnwvhUv6Ip53w0NYJOsbLcx/qvxKXxDR5P/mJAAROO3fXK9Gne o/lXJYhgq+wnzXZWLw3aH+iS77Gz1Ybvv/wSA1/XjwKb8aNPwdTh5qrOERjFqLTXceDJ Nyx6zMxSod+uDD0C6kD4m2zSJMVqJ0MJZEJRfP1GIWywad11/XRox1NC2fi2Y5Nat0Rp 2iB+vWZJOzo9uJmkcMjebCIREc067ZeqKDjr1M9Eo26AuuA7kV4xotuZQvOdK6sbtAKX xJUsjkFluoEXP5KC+HTStPWOgC1A4BEBKfn71gGE3QbXJc+lnkHjcJpi8P9beERJf9zl yxcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=qC4b6oWovP7dRcyj9iCCJ6MruIhoxreTnKxOCwsw26s=; b=lnYE99GlV4xgoJhPCLcdNy/UciVrMvNuCPOJDXPDmatpJPgDRqAPf3cU1BOyoKs0P2 AgAqg6eS5BgEPdM5SvQtZfMVJGqUCYaU5f/flHx5TQaamDZAFO7tluqBT3qwTdR7JHQM sNHgzwDsclMx/MF+zT2KYH7/4IvjgFk2HGRXA58NZmsimuNd+pTvm03ZTM8N2hN09Wcx dzEwscTSCTfZg3fPFH/PNYGGxY0BLjLBayN4/kRTXbkMojnkX+fdVhwr283YZhtrYQxk n4NJgBz6bhFPGDTSaR8xMt45FvoINdoeR5ck1I7Tl9IuTl9isvUjuTRK25INc0QeSaV9 T+Ww== X-Gm-Message-State: APjAAAWRCoV6GdjEGJdGczIs6jMQhBI3HzY++0cOZDpTIsAKLTeGwi+z V93iMXuXA417vfY6OWHx8KO54idheno= X-Google-Smtp-Source: APXvYqzKmPUzD1twNi94yM4XrxGQ2kSauLdj7Vq0CVHN3+j4mte8wTr6b2025nYVXXA3XP2sggmYPg== X-Received: by 2002:adf:fd07:: with SMTP id e7mr9592761wrr.21.1576766285511; Thu, 19 Dec 2019 06:38:05 -0800 (PST) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id y139sm6826456wmd.24.2019.12.19.06.38.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2019 06:38:04 -0800 (PST) From: luca.boccassi@gmail.com To: Ferruh Yigit Cc: dpdk stable Date: Thu, 19 Dec 2019 14:33:46 +0000 Message-Id: <20191219143447.21506-79-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191219143447.21506-1-luca.boccassi@gmail.com> References: <20191219143447.21506-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'test: fix global variable multiple definitions' has been queued to LTS release 17.11.10 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to LTS release 17.11.10 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 12/21/19. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Thanks. Luca Boccassi --- >From fb474b5fb2117e96be06f9a78fc0e10a27c75de3 Mon Sep 17 00:00:00 2001 From: Ferruh Yigit Date: Thu, 5 Sep 2019 15:53:15 +0100 Subject: [PATCH] test: fix global variable multiple definitions [ upstream commit d170527643bcee1ef35390d8ac57ddccf6621b82 ] Multiple global variable are defined in multiple unit test files with same name, but all unit test files are linked into single executable, which means those variables share same storage which is not the intention, fixed by making global variables 'static'. Issue has been detected by '-fno-common' gcc flag. Fixes: fdeb30fa7102 ("test/bitrate: add unit tests for bitrate library") Fixes: c3eabff124e6 ("distributor: add unit tests") Fixes: 0e925aef2779 ("app/test: add EFD functional and perf tests") Fixes: 359e17bf081f ("app/test: improve hash unit tests") Fixes: c7eb0972e74b ("test/hash: add lock-free r/w concurrency") Fixes: 1e3676a06e4c ("test/latency: add unit tests for latencystats library") Fixes: 0cc67a96e486 ("test/member: add functional and perf tests") Fixes: e6a14121f4ae ("test/rcu: remove arbitrary limit on max core count") Fixes: 104dbec2081a ("test/rcu: increase size of core numbers") Signed-off-by: Ferruh Yigit --- test/test/test_distributor_perf.c | 2 +- test/test/test_efd.c | 2 +- test/test/test_efd_perf.c | 6 +++--- test/test/test_hash_perf.c | 12 ++++++------ test/test/test_member_perf.c | 16 ++++++++-------- 5 files changed, 19 insertions(+), 19 deletions(-) diff --git a/test/test/test_distributor_perf.c b/test/test/test_distributor_perf.c index 4a62a9226f..a1fe0bbb10 100644 --- a/test/test/test_distributor_perf.c +++ b/test/test/test_distributor_perf.c @@ -54,7 +54,7 @@ static volatile unsigned worker_idx; struct worker_stats { volatile unsigned handled_packets; } __rte_cache_aligned; -struct worker_stats worker_stats[RTE_MAX_LCORE]; +static struct worker_stats worker_stats[RTE_MAX_LCORE]; /* * worker thread used for testing the time to do a round-trip of a cache diff --git a/test/test/test_efd.c b/test/test/test_efd.c index 544306166a..0ee09c903c 100644 --- a/test/test/test_efd.c +++ b/test/test/test_efd.c @@ -125,7 +125,7 @@ static struct flow_key keys[5] = { } }; /* Array to store the data */ -efd_value_t data[5]; +static efd_value_t data[5]; static inline uint8_t efd_get_all_sockets_bitmask(void) { diff --git a/test/test/test_efd_perf.c b/test/test/test_efd_perf.c index 2b8a8eac5b..7dca182abe 100644 --- a/test/test/test_efd_perf.c +++ b/test/test/test_efd_perf.c @@ -100,13 +100,13 @@ static uint32_t hashtest_key_lens[] = { }; /* Array to store number of cycles per operation */ -uint64_t cycles[NUM_KEYSIZES][NUM_OPERATIONS]; +static uint64_t cycles[NUM_KEYSIZES][NUM_OPERATIONS]; /* Array to store the data */ -efd_value_t data[KEYS_TO_ADD]; +static efd_value_t data[KEYS_TO_ADD]; /* Array to store all input keys */ -uint8_t keys[KEYS_TO_ADD][MAX_KEYSIZE]; +static uint8_t keys[KEYS_TO_ADD][MAX_KEYSIZE]; /* Shuffle the keys that have been added, so lookups will be totally random */ static void diff --git a/test/test/test_hash_perf.c b/test/test/test_hash_perf.c index b965d9b255..6cd87a600b 100644 --- a/test/test/test_hash_perf.c +++ b/test/test/test_hash_perf.c @@ -81,22 +81,22 @@ static uint32_t hashtest_key_lens[] = { struct rte_hash *h[NUM_KEYSIZES]; /* Array that stores if a slot is full */ -uint8_t slot_taken[MAX_ENTRIES]; +static uint8_t slot_taken[MAX_ENTRIES]; /* Array to store number of cycles per operation */ -uint64_t cycles[NUM_KEYSIZES][NUM_OPERATIONS][2][2]; +static uint64_t cycles[NUM_KEYSIZES][NUM_OPERATIONS][2][2]; /* Array to store all input keys */ -uint8_t keys[KEYS_TO_ADD][MAX_KEYSIZE]; +static uint8_t keys[KEYS_TO_ADD][MAX_KEYSIZE]; /* Array to store the precomputed hash for 'keys' */ -hash_sig_t signatures[KEYS_TO_ADD]; +static hash_sig_t signatures[KEYS_TO_ADD]; /* Array to store how many busy entries have each bucket */ -uint8_t buckets[NUM_BUCKETS]; +static uint8_t buckets[NUM_BUCKETS]; /* Array to store the positions where keys are added */ -int32_t positions[KEYS_TO_ADD]; +static int32_t positions[KEYS_TO_ADD]; /* Parameters used for hash table in unit test functions. */ static struct rte_hash_parameters ut_params = { diff --git a/test/test/test_member_perf.c b/test/test/test_member_perf.c index e13066f19b..554d3d70e3 100644 --- a/test/test/test_member_perf.c +++ b/test/test/test_member_perf.c @@ -94,18 +94,18 @@ static uint32_t hashtest_key_lens[] = { }; /* Array to store number of cycles per operation */ -uint64_t cycles[NUM_TYPE][NUM_KEYSIZES][NUM_OPERATIONS]; -uint64_t false_data[NUM_TYPE][NUM_KEYSIZES]; -uint64_t false_data_bulk[NUM_TYPE][NUM_KEYSIZES]; -uint64_t false_data_multi[NUM_TYPE][NUM_KEYSIZES]; -uint64_t false_data_multi_bulk[NUM_TYPE][NUM_KEYSIZES]; +static uint64_t cycles[NUM_TYPE][NUM_KEYSIZES][NUM_OPERATIONS]; +static uint64_t false_data[NUM_TYPE][NUM_KEYSIZES]; +static uint64_t false_data_bulk[NUM_TYPE][NUM_KEYSIZES]; +static uint64_t false_data_multi[NUM_TYPE][NUM_KEYSIZES]; +static uint64_t false_data_multi_bulk[NUM_TYPE][NUM_KEYSIZES]; -uint64_t false_hit[NUM_TYPE][NUM_KEYSIZES]; +static uint64_t false_hit[NUM_TYPE][NUM_KEYSIZES]; -member_set_t data[NUM_TYPE][/* Array to store the data */KEYS_TO_ADD]; +static member_set_t data[NUM_TYPE][/* Array to store the data */KEYS_TO_ADD]; /* Array to store all input keys */ -uint8_t keys[KEYS_TO_ADD][MAX_KEYSIZE]; +static uint8_t keys[KEYS_TO_ADD][MAX_KEYSIZE]; /* Shuffle the keys that have been added, so lookups will be totally random */ static void -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2019-12-19 14:32:29.502060524 +0000 +++ 0079-test-fix-global-variable-multiple-definitions.patch 2019-12-19 14:32:26.181299332 +0000 @@ -1,8 +1,10 @@ -From d170527643bcee1ef35390d8ac57ddccf6621b82 Mon Sep 17 00:00:00 2001 +From fb474b5fb2117e96be06f9a78fc0e10a27c75de3 Mon Sep 17 00:00:00 2001 From: Ferruh Yigit Date: Thu, 5 Sep 2019 15:53:15 +0100 Subject: [PATCH] test: fix global variable multiple definitions +[ upstream commit d170527643bcee1ef35390d8ac57ddccf6621b82 ] + Multiple global variable are defined in multiple unit test files with same name, but all unit test files are linked into single executable, which means those variables share same storage which is not the @@ -19,43 +21,21 @@ Fixes: 0cc67a96e486 ("test/member: add functional and perf tests") Fixes: e6a14121f4ae ("test/rcu: remove arbitrary limit on max core count") Fixes: 104dbec2081a ("test/rcu: increase size of core numbers") -Cc: stable@dpdk.org Signed-off-by: Ferruh Yigit --- - app/test/test_bitratestats.c | 6 +++--- - app/test/test_distributor_perf.c | 2 +- - app/test/test_efd.c | 2 +- - app/test/test_efd_perf.c | 6 +++--- - app/test/test_hash_perf.c | 12 ++++++------ - app/test/test_hash_readwrite_lf.c | 8 ++++---- - app/test/test_latencystats.c | 6 +++--- - app/test/test_member_perf.c | 16 ++++++++-------- - app/test/test_rcu_qsbr.c | 10 +++++----- - 9 files changed, 34 insertions(+), 34 deletions(-) - -diff --git a/app/test/test_bitratestats.c b/app/test/test_bitratestats.c -index 32b1b0fc0e..3a7d9c037a 100644 ---- a/app/test/test_bitratestats.c -+++ b/app/test/test_bitratestats.c -@@ -18,9 +18,9 @@ - #define BIT_NUM_PACKETS 10 - #define QUEUE_ID 0 - --uint16_t portid; --struct rte_stats_bitrates *bitrate_data; --struct rte_ring *ring; -+static uint16_t portid; -+static struct rte_stats_bitrates *bitrate_data; -+static struct rte_ring *ring; - - /* To test whether rte_stats_bitrate_create is successful */ - static int -diff --git a/app/test/test_distributor_perf.c b/app/test/test_distributor_perf.c -index 664530ff9e..f153bcf9bd 100644 ---- a/app/test/test_distributor_perf.c -+++ b/app/test/test_distributor_perf.c -@@ -25,7 +25,7 @@ static volatile unsigned worker_idx; + test/test/test_distributor_perf.c | 2 +- + test/test/test_efd.c | 2 +- + test/test/test_efd_perf.c | 6 +++--- + test/test/test_hash_perf.c | 12 ++++++------ + test/test/test_member_perf.c | 16 ++++++++-------- + 5 files changed, 19 insertions(+), 19 deletions(-) + +diff --git a/test/test/test_distributor_perf.c b/test/test/test_distributor_perf.c +index 4a62a9226f..a1fe0bbb10 100644 +--- a/test/test/test_distributor_perf.c ++++ b/test/test/test_distributor_perf.c +@@ -54,7 +54,7 @@ static volatile unsigned worker_idx; struct worker_stats { volatile unsigned handled_packets; } __rte_cache_aligned; @@ -64,11 +44,11 @@ /* * worker thread used for testing the time to do a round-trip of a cache -diff --git a/app/test/test_efd.c b/app/test/test_efd.c -index 73b3044316..a779a71f2d 100644 ---- a/app/test/test_efd.c -+++ b/app/test/test_efd.c -@@ -94,7 +94,7 @@ static struct flow_key keys[5] = { +diff --git a/test/test/test_efd.c b/test/test/test_efd.c +index 544306166a..0ee09c903c 100644 +--- a/test/test/test_efd.c ++++ b/test/test/test_efd.c +@@ -125,7 +125,7 @@ static struct flow_key keys[5] = { } }; /* Array to store the data */ @@ -77,11 +57,11 @@ static inline uint8_t efd_get_all_sockets_bitmask(void) { -diff --git a/app/test/test_efd_perf.c b/app/test/test_efd_perf.c -index 1dcb992c6e..d47622d5ca 100644 ---- a/app/test/test_efd_perf.c -+++ b/app/test/test_efd_perf.c -@@ -71,13 +71,13 @@ static uint32_t hashtest_key_lens[] = { +diff --git a/test/test/test_efd_perf.c b/test/test/test_efd_perf.c +index 2b8a8eac5b..7dca182abe 100644 +--- a/test/test/test_efd_perf.c ++++ b/test/test/test_efd_perf.c +@@ -100,13 +100,13 @@ static uint32_t hashtest_key_lens[] = { }; /* Array to store number of cycles per operation */ @@ -98,11 +78,11 @@ /* Shuffle the keys that have been added, so lookups will be totally random */ static void -diff --git a/app/test/test_hash_perf.c b/app/test/test_hash_perf.c -index 5648fce023..a438eae6c8 100644 ---- a/app/test/test_hash_perf.c -+++ b/app/test/test_hash_perf.c -@@ -53,22 +53,22 @@ static uint32_t hashtest_key_lens[] = { +diff --git a/test/test/test_hash_perf.c b/test/test/test_hash_perf.c +index b965d9b255..6cd87a600b 100644 +--- a/test/test/test_hash_perf.c ++++ b/test/test/test_hash_perf.c +@@ -81,22 +81,22 @@ static uint32_t hashtest_key_lens[] = { struct rte_hash *h[NUM_KEYSIZES]; /* Array that stores if a slot is full */ @@ -131,63 +111,11 @@ /* Parameters used for hash table in unit test functions. */ static struct rte_hash_parameters ut_params = { -diff --git a/app/test/test_hash_readwrite_lf.c b/app/test/test_hash_readwrite_lf.c -index 1f2fba41f1..97c304054c 100644 ---- a/app/test/test_hash_readwrite_lf.c -+++ b/app/test/test_hash_readwrite_lf.c -@@ -48,7 +48,7 @@ - #define WRITE_EXT_BKT 2 - - #define NUM_TEST 3 --unsigned int rwc_core_cnt[NUM_TEST] = {1, 2, 4}; -+static unsigned int rwc_core_cnt[NUM_TEST] = {1, 2, 4}; - - struct rwc_perf { - uint32_t w_no_ks_r_hit[2][NUM_TEST]; -@@ -62,7 +62,7 @@ struct rwc_perf { - - static struct rwc_perf rwc_lf_results, rwc_non_lf_results; - --struct { -+static struct { - uint32_t *keys; - uint32_t *keys_no_ks; - uint32_t *keys_ks; -@@ -87,9 +87,9 @@ static rte_atomic64_t greads; - - static volatile uint8_t writer_done; - --uint16_t enabled_core_ids[RTE_MAX_LCORE]; -+static uint16_t enabled_core_ids[RTE_MAX_LCORE]; - --uint8_t *scanned_bkts; -+static uint8_t *scanned_bkts; - - static inline uint16_t - get_short_sig(const hash_sig_t hash) -diff --git a/app/test/test_latencystats.c b/app/test/test_latencystats.c -index 8dd794be46..968e0bc470 100644 ---- a/app/test/test_latencystats.c -+++ b/app/test/test_latencystats.c -@@ -17,10 +17,10 @@ - #define LATENCY_NUM_PACKETS 10 - #define QUEUE_ID 0 - --uint16_t portid; --struct rte_ring *ring; -+static uint16_t portid; -+static struct rte_ring *ring; - --struct rte_metric_name lat_stats_strings[] = { -+static struct rte_metric_name lat_stats_strings[] = { - {"min_latency_ns"}, - {"avg_latency_ns"}, - {"max_latency_ns"}, -diff --git a/app/test/test_member_perf.c b/app/test/test_member_perf.c -index 564a2b3c1e..e2840f12d3 100644 ---- a/app/test/test_member_perf.c -+++ b/app/test/test_member_perf.c -@@ -65,18 +65,18 @@ static uint32_t hashtest_key_lens[] = { +diff --git a/test/test/test_member_perf.c b/test/test/test_member_perf.c +index e13066f19b..554d3d70e3 100644 +--- a/test/test/test_member_perf.c ++++ b/test/test/test_member_perf.c +@@ -94,18 +94,18 @@ static uint32_t hashtest_key_lens[] = { }; /* Array to store number of cycles per operation */ @@ -214,41 +142,6 @@ /* Shuffle the keys that have been added, so lookups will be totally random */ static void -diff --git a/app/test/test_rcu_qsbr.c b/app/test/test_rcu_qsbr.c -index 2f71ec6ad3..85d80e0fbd 100644 ---- a/app/test/test_rcu_qsbr.c -+++ b/app/test/test_rcu_qsbr.c -@@ -25,8 +25,8 @@ - /* Make sure that this has the same value as __RTE_QSBR_CNT_INIT */ - #define TEST_RCU_QSBR_CNT_INIT 1 - --uint16_t enabled_core_ids[RTE_MAX_LCORE]; --unsigned int num_cores; -+static uint16_t enabled_core_ids[RTE_MAX_LCORE]; -+static unsigned int num_cores; - - static uint32_t *keys; - #define TOTAL_ENTRY (1024 * 8) -@@ -35,8 +35,8 @@ static uint32_t *hash_data[RTE_MAX_LCORE][TOTAL_ENTRY]; - static uint8_t writer_done; - - static struct rte_rcu_qsbr *t[RTE_MAX_LCORE]; --struct rte_hash *h[RTE_MAX_LCORE]; --char hash_name[RTE_MAX_LCORE][8]; -+static struct rte_hash *h[RTE_MAX_LCORE]; -+static char hash_name[RTE_MAX_LCORE][8]; - - struct test_rcu_thread_info { - /* Index in RCU array */ -@@ -46,7 +46,7 @@ struct test_rcu_thread_info { - /* lcore IDs registered on the RCU variable */ - uint16_t r_core_ids[2]; - }; --struct test_rcu_thread_info thread_info[RTE_MAX_LCORE/4]; -+static struct test_rcu_thread_info thread_info[RTE_MAX_LCORE/4]; - - static int - alloc_rcu(void) -- 2.20.1