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 6E247A04F0 for ; Tue, 10 Dec 2019 16:00:34 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 595F81BECF; Tue, 10 Dec 2019 16:00:34 +0100 (CET) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by dpdk.org (Postfix) with ESMTP id 1B3CB1B13C for ; Tue, 10 Dec 2019 16:00:33 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1575990032; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Y6ZCBG75XsvVVfXJy73w31Bp8IEErWqGzCpvZj41iCg=; b=JehhQftOZ4QBv8oHLL9Y0/II8c9WTYnqZKZpkeSahmmPxtOLc0IMo6p3m1Xx/CD7tvP9ck yQmcDs6ibKskh5blE2NfONpUtlhg7x3HMwMuJ4nJadJBHHwwGMOT2gKetV7UCuG9OC/UqO a6HAWVvfLG2MJ5VfgfBzTpQ4E+zcwGE= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-279-Xb08tY-lMF27kMEFg_-UNA-1; Tue, 10 Dec 2019 10:00:31 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 07A631883521; Tue, 10 Dec 2019 15:00:30 +0000 (UTC) Received: from rh.redhat.com (ovpn-116-64.ams2.redhat.com [10.36.116.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0F7F85D9C5; Tue, 10 Dec 2019 15:00:28 +0000 (UTC) From: Kevin Traynor To: Ferruh Yigit Cc: dpdk stable Date: Tue, 10 Dec 2019 14:58:53 +0000 Message-Id: <20191210145937.32755-19-ktraynor@redhat.com> In-Reply-To: <20191210145937.32755-1-ktraynor@redhat.com> References: <20191210145937.32755-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-MC-Unique: Xb08tY-lMF27kMEFg_-UNA-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Subject: [dpdk-stable] patch 'test: fix global variable multiple definitions' has been queued to LTS release 18.11.6 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 18.11.6 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/16/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 rebasi= ng (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/kevintraynor/dpdk-stable-queue This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable-queue/commit/dfdfcaaaae23066838= 5c9ef63a077ef78eb56d80 Thanks. Kevin. --- >From dfdfcaaaae230668385c9ef63a077ef78eb56d80 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_hash_readwrite_lf.c | 8 ++++---- test/test/test_member_perf.c | 16 ++++++++-------- 6 files changed, 23 insertions(+), 23 deletions(-) diff --git a/test/test/test_distributor_perf.c b/test/test/test_distributor= _perf.c index edf1998ab..928794cfc 100644 --- a/test/test/test_distributor_perf.c +++ b/test/test/test_distributor_perf.c @@ -26,5 +26,5 @@ struct worker_stats { =09volatile unsigned handled_packets; } __rte_cache_aligned; -struct worker_stats worker_stats[RTE_MAX_LCORE]; +static struct worker_stats worker_stats[RTE_MAX_LCORE]; =20 /* diff --git a/test/test/test_efd.c b/test/test/test_efd.c index ced091aab..f5313cbd2 100644 --- a/test/test/test_efd.c +++ b/test/test/test_efd.c @@ -97,5 +97,5 @@ static struct flow_key keys[5] =3D { }; /* Array to store the data */ -efd_value_t data[5]; +static efd_value_t data[5]; =20 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 1dcb992c6..d47622d5c 100644 --- a/test/test/test_efd_perf.c +++ b/test/test/test_efd_perf.c @@ -72,11 +72,11 @@ static uint32_t hashtest_key_lens[] =3D { =20 /* Array to store number of cycles per operation */ -uint64_t cycles[NUM_KEYSIZES][NUM_OPERATIONS]; +static uint64_t cycles[NUM_KEYSIZES][NUM_OPERATIONS]; =20 /* Array to store the data */ -efd_value_t data[KEYS_TO_ADD]; +static efd_value_t data[KEYS_TO_ADD]; =20 /* Array to store all input keys */ -uint8_t keys[KEYS_TO_ADD][MAX_KEYSIZE]; +static uint8_t keys[KEYS_TO_ADD][MAX_KEYSIZE]; =20 /* Shuffle the keys that have been added, so lookups will be totally rando= m */ diff --git a/test/test/test_hash_perf.c b/test/test/test_hash_perf.c index 5648fce02..a438eae6c 100644 --- a/test/test/test_hash_perf.c +++ b/test/test/test_hash_perf.c @@ -54,20 +54,20 @@ struct rte_hash *h[NUM_KEYSIZES]; =20 /* Array that stores if a slot is full */ -uint8_t slot_taken[MAX_ENTRIES]; +static uint8_t slot_taken[MAX_ENTRIES]; =20 /* 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]; =20 /* Array to store all input keys */ -uint8_t keys[KEYS_TO_ADD][MAX_KEYSIZE]; +static uint8_t keys[KEYS_TO_ADD][MAX_KEYSIZE]; =20 /* Array to store the precomputed hash for 'keys' */ -hash_sig_t signatures[KEYS_TO_ADD]; +static hash_sig_t signatures[KEYS_TO_ADD]; =20 /* Array to store how many busy entries have each bucket */ -uint8_t buckets[NUM_BUCKETS]; +static uint8_t buckets[NUM_BUCKETS]; =20 /* Array to store the positions where keys are added */ -int32_t positions[KEYS_TO_ADD]; +static int32_t positions[KEYS_TO_ADD]; =20 /* Parameters used for hash table in unit test functions. */ diff --git a/test/test/test_hash_readwrite_lf.c b/test/test/test_hash_readw= rite_lf.c index 432e86e0e..8fb56d3f9 100644 --- a/test/test/test_hash_readwrite_lf.c +++ b/test/test/test_hash_readwrite_lf.c @@ -43,5 +43,5 @@ #define BULK_LOOKUP 16 #define NUM_TEST 3 -unsigned int rwc_core_cnt[NUM_TEST] =3D {1, 2, 4}; +static unsigned int rwc_core_cnt[NUM_TEST] =3D {1, 2, 4}; =20 struct rwc_perf { @@ -56,5 +56,5 @@ struct rwc_perf { static struct rwc_perf rwc_lf_results, rwc_non_lf_results; =20 -struct { +static struct { =09uint32_t *keys; =09uint32_t *keys_no_ks; @@ -77,7 +77,7 @@ static rte_atomic64_t greads; static volatile uint8_t writer_done; =20 -uint16_t enabled_core_ids[RTE_MAX_LCORE]; +static uint16_t enabled_core_ids[RTE_MAX_LCORE]; =20 -uint8_t *scanned_bkts; +static uint8_t *scanned_bkts; =20 static inline int diff --git a/test/test/test_member_perf.c b/test/test/test_member_perf.c index 564a2b3c1..e2840f12d 100644 --- a/test/test/test_member_perf.c +++ b/test/test/test_member_perf.c @@ -66,16 +66,16 @@ static uint32_t hashtest_key_lens[] =3D { =20 /* 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]; =20 -uint64_t false_hit[NUM_TYPE][NUM_KEYSIZES]; +static uint64_t false_hit[NUM_TYPE][NUM_KEYSIZES]; =20 -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_AD= D]; =20 /* Array to store all input keys */ -uint8_t keys[KEYS_TO_ADD][MAX_KEYSIZE]; +static uint8_t keys[KEYS_TO_ADD][MAX_KEYSIZE]; =20 /* Shuffle the keys that have been added, so lookups will be totally rando= m */ --=20 2.21.0 --- Diff of the applied patch vs upstream commit (please double-check if non-= empty: --- --- -=092019-12-10 14:49:40.360491873 +0000 +++ 0019-test-fix-global-variable-multiple-definitions.patch=092019-12-10 1= 4:49:39.012458513 +0000 @@ -1 +1 @@ -From d170527643bcee1ef35390d8ac57ddccf6621b82 Mon Sep 17 00:00:00 2001 +From dfdfcaaaae230668385c9ef63a077ef78eb56d80 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit d170527643bcee1ef35390d8ac57ddccf6621b82 ] + @@ -22 +23,0 @@ -Cc: stable@dpdk.org @@ -26,30 +27,12 @@ - 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 32b1b0fc0..3a7d9c037 100644 ---- a/app/test/test_bitratestats.c -+++ b/app/test/test_bitratestats.c -@@ -19,7 +19,7 @@ - #define QUEUE_ID 0 -=20 --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; -=20 - /* To test whether rte_stats_bitrate_create is successful */ -diff --git a/app/test/test_distributor_perf.c b/app/test/test_distributor_= perf.c -index 664530ff9..f153bcf9b 100644 ---- a/app/test/test_distributor_perf.c -+++ b/app/test/test_distributor_perf.c + 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_hash_readwrite_lf.c | 8 ++++---- + test/test/test_member_perf.c | 16 ++++++++-------- + 6 files changed, 23 insertions(+), 23 deletions(-) + +diff --git a/test/test/test_distributor_perf.c b/test/test/test_distributo= r_perf.c +index edf1998ab..928794cfc 100644 +--- a/test/test/test_distributor_perf.c ++++ b/test/test/test_distributor_perf.c @@ -63,5 +46,5 @@ -diff --git a/app/test/test_efd.c b/app/test/test_efd.c -index 73b304431..a779a71f2 100644 ---- a/app/test/test_efd.c -+++ b/app/test/test_efd.c -@@ -95,5 +95,5 @@ static struct flow_key keys[5] =3D { +diff --git a/test/test/test_efd.c b/test/test/test_efd.c +index ced091aab..f5313cbd2 100644 +--- a/test/test/test_efd.c ++++ b/test/test/test_efd.c +@@ -97,5 +97,5 @@ static struct flow_key keys[5] =3D { @@ -74 +57 @@ -diff --git a/app/test/test_efd_perf.c b/app/test/test_efd_perf.c +diff --git a/test/test/test_efd_perf.c b/test/test/test_efd_perf.c @@ -76,2 +59,2 @@ ---- a/app/test/test_efd_perf.c -+++ b/app/test/test_efd_perf.c +--- a/test/test/test_efd_perf.c ++++ b/test/test/test_efd_perf.c @@ -93 +76 @@ -diff --git a/app/test/test_hash_perf.c b/app/test/test_hash_perf.c +diff --git a/test/test/test_hash_perf.c b/test/test/test_hash_perf.c @@ -95,2 +78,2 @@ ---- a/app/test/test_hash_perf.c -+++ b/app/test/test_hash_perf.c +--- a/test/test/test_hash_perf.c ++++ b/test/test/test_hash_perf.c @@ -124,6 +107,6 @@ -diff --git a/app/test/test_hash_readwrite_lf.c b/app/test/test_hash_readwr= ite_lf.c -index 1f2fba41f..97c304054 100644 ---- a/app/test/test_hash_readwrite_lf.c -+++ b/app/test/test_hash_readwrite_lf.c -@@ -49,5 +49,5 @@ -=20 +diff --git a/test/test/test_hash_readwrite_lf.c b/test/test/test_hash_read= write_lf.c +index 432e86e0e..8fb56d3f9 100644 +--- a/test/test/test_hash_readwrite_lf.c ++++ b/test/test/test_hash_readwrite_lf.c +@@ -43,5 +43,5 @@ + #define BULK_LOOKUP 16 @@ -135 +118 @@ -@@ -63,5 +63,5 @@ struct rwc_perf { +@@ -56,5 +56,5 @@ struct rwc_perf { @@ -142 +125 @@ -@@ -88,7 +88,7 @@ static rte_atomic64_t greads; +@@ -77,7 +77,7 @@ static rte_atomic64_t greads; @@ -151,18 +134,2 @@ - static inline uint16_t -diff --git a/app/test/test_latencystats.c b/app/test/test_latencystats.c -index 8dd794be4..968e0bc47 100644 ---- a/app/test/test_latencystats.c -+++ b/app/test/test_latencystats.c -@@ -18,8 +18,8 @@ - #define QUEUE_ID 0 -=20 --uint16_t portid; --struct rte_ring *ring; -+static uint16_t portid; -+static struct rte_ring *ring; -=20 --struct rte_metric_name lat_stats_strings[] =3D { -+static struct rte_metric_name lat_stats_strings[] =3D { - =09{"min_latency_ns"}, - =09{"avg_latency_ns"}, -diff --git a/app/test/test_member_perf.c b/app/test/test_member_perf.c + static inline int +diff --git a/test/test/test_member_perf.c b/test/test/test_member_perf.c @@ -170,2 +137,2 @@ ---- a/app/test/test_member_perf.c -+++ b/app/test/test_member_perf.c +--- a/test/test/test_member_perf.c ++++ b/test/test/test_member_perf.c @@ -197,29 +163,0 @@ -diff --git a/app/test/test_rcu_qsbr.c b/app/test/test_rcu_qsbr.c -index 2f71ec6ad..85d80e0fb 100644 ---- a/app/test/test_rcu_qsbr.c -+++ b/app/test/test_rcu_qsbr.c -@@ -26,6 +26,6 @@ - #define TEST_RCU_QSBR_CNT_INIT 1 -=20 --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; -=20 - static uint32_t *keys; -@@ -36,6 +36,6 @@ static uint8_t writer_done; -=20 - 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]; -=20 - struct test_rcu_thread_info { -@@ -47,5 +47,5 @@ struct test_rcu_thread_info { - =09uint16_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]; -=20 - static int