get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/58665/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 58665,
    "url": "https://patches.dpdk.org/api/patches/58665/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20190905145315.19395-11-ferruh.yigit@intel.com/",
    "project": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<20190905145315.19395-11-ferruh.yigit@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20190905145315.19395-11-ferruh.yigit@intel.com",
    "date": "2019-09-05T14:53:15",
    "name": "[10/10] test: fix global variable multiple definitions",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "e2f8a2c5b7dff50aababd04852d320ce28213f53",
    "submitter": {
        "id": 324,
        "url": "https://patches.dpdk.org/api/people/324/?format=api",
        "name": "Ferruh Yigit",
        "email": "ferruh.yigit@intel.com"
    },
    "delegate": {
        "id": 24651,
        "url": "https://patches.dpdk.org/api/users/24651/?format=api",
        "username": "dmarchand",
        "first_name": "David",
        "last_name": "Marchand",
        "email": "david.marchand@redhat.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20190905145315.19395-11-ferruh.yigit@intel.com/mbox/",
    "series": [
        {
            "id": 6259,
            "url": "https://patches.dpdk.org/api/series/6259/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=6259",
            "date": "2019-09-05T14:53:05",
            "name": "fix global variable multiple definitions",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/6259/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/58665/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/58665/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id C794E1F040;\n\tThu,  5 Sep 2019 16:53:45 +0200 (CEST)",
            "from mga17.intel.com (mga17.intel.com [192.55.52.151])\n\tby dpdk.org (Postfix) with ESMTP id 710671EFF9;\n\tThu,  5 Sep 2019 16:53:35 +0200 (CEST)",
            "from fmsmga008.fm.intel.com ([10.253.24.58])\n\tby fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t05 Sep 2019 07:53:35 -0700",
            "from silpixa00399752.ir.intel.com (HELO\n\tsilpixa00399752.ger.corp.intel.com) ([10.237.223.78])\n\tby fmsmga008.fm.intel.com with ESMTP; 05 Sep 2019 07:53:32 -0700"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.64,470,1559545200\"; d=\"scan'208\";a=\"182846399\"",
        "From": "Ferruh Yigit <ferruh.yigit@intel.com>",
        "To": "David Hunt <david.hunt@intel.com>, Byron Marohn <byron.marohn@intel.com>,\n\tPablo de Lara Guarch <pablo.de.lara.guarch@intel.com>,\n\tYipeng Wang <yipeng1.wang@intel.com>,\n\tSameh Gobriel <sameh.gobriel@intel.com>,\n\tBruce Richardson <bruce.richardson@intel.com>,\n\tReshma Pattan <reshma.pattan@intel.com>,\n\tHonnappa Nagarahalli <honnappa.nagarahalli@arm.com>",
        "Cc": "dev@dpdk.org,\n\tstable@dpdk.org",
        "Date": "Thu,  5 Sep 2019 15:53:15 +0100",
        "Message-Id": "<20190905145315.19395-11-ferruh.yigit@intel.com>",
        "X-Mailer": "git-send-email 2.21.0",
        "In-Reply-To": "<20190905145315.19395-1-ferruh.yigit@intel.com>",
        "References": "<20190905145315.19395-1-ferruh.yigit@intel.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH 10/10] test: fix global variable multiple\n\tdefinitions",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Multiple global variable are defined in multiple unit test files with\nsame name, but all unit test files are linked into single executable,\nwhich means those variables share same storage which is not the\nintention, fixed by making global variables 'static'.\n\nIssue has been detected by '-fno-common' gcc flag.\n\nFixes: fdeb30fa7102 (\"test/bitrate: add unit tests for bitrate library\")\nFixes: c3eabff124e6 (\"distributor: add unit tests\")\nFixes: 0e925aef2779 (\"app/test: add EFD functional and perf tests\")\nFixes: 359e17bf081f (\"app/test: improve hash unit tests\")\nFixes: c7eb0972e74b (\"test/hash: add lock-free r/w concurrency\")\nFixes: 1e3676a06e4c (\"test/latency: add unit tests for latencystats library\")\nFixes: 0cc67a96e486 (\"test/member: add functional and perf tests\")\nFixes: e6a14121f4ae (\"test/rcu: remove arbitrary limit on max core count\")\nFixes: 104dbec2081a (\"test/rcu: increase size of core numbers\")\nCc: stable@dpdk.org\n\nSigned-off-by: Ferruh Yigit <ferruh.yigit@intel.com>\n---\n app/test/test_bitratestats.c      |  6 +++---\n app/test/test_distributor_perf.c  |  2 +-\n app/test/test_efd.c               |  2 +-\n app/test/test_efd_perf.c          |  6 +++---\n app/test/test_hash_perf.c         | 12 ++++++------\n app/test/test_hash_readwrite_lf.c |  8 ++++----\n app/test/test_latencystats.c      |  6 +++---\n app/test/test_member_perf.c       | 16 ++++++++--------\n app/test/test_rcu_qsbr.c          | 10 +++++-----\n 9 files changed, 34 insertions(+), 34 deletions(-)",
    "diff": "diff --git a/app/test/test_bitratestats.c b/app/test/test_bitratestats.c\nindex 32b1b0fc0..3a7d9c037 100644\n--- a/app/test/test_bitratestats.c\n+++ b/app/test/test_bitratestats.c\n@@ -18,9 +18,9 @@\n #define BIT_NUM_PACKETS 10\n #define QUEUE_ID 0\n \n-uint16_t portid;\n-struct rte_stats_bitrates *bitrate_data;\n-struct rte_ring *ring;\n+static uint16_t portid;\n+static struct rte_stats_bitrates *bitrate_data;\n+static struct rte_ring *ring;\n \n /* To test whether rte_stats_bitrate_create is successful */\n static int\ndiff --git a/app/test/test_distributor_perf.c b/app/test/test_distributor_perf.c\nindex 664530ff9..f153bcf9b 100644\n--- a/app/test/test_distributor_perf.c\n+++ b/app/test/test_distributor_perf.c\n@@ -25,7 +25,7 @@ static volatile unsigned worker_idx;\n struct worker_stats {\n \tvolatile unsigned handled_packets;\n } __rte_cache_aligned;\n-struct worker_stats worker_stats[RTE_MAX_LCORE];\n+static struct worker_stats worker_stats[RTE_MAX_LCORE];\n \n /*\n  * worker thread used for testing the time to do a round-trip of a cache\ndiff --git a/app/test/test_efd.c b/app/test/test_efd.c\nindex 73b304431..a779a71f2 100644\n--- a/app/test/test_efd.c\n+++ b/app/test/test_efd.c\n@@ -94,7 +94,7 @@ static struct flow_key keys[5] = {\n \t}\n };\n /* Array to store the data */\n-efd_value_t data[5];\n+static efd_value_t data[5];\n \n static inline uint8_t efd_get_all_sockets_bitmask(void)\n {\ndiff --git a/app/test/test_efd_perf.c b/app/test/test_efd_perf.c\nindex 1dcb992c6..d47622d5c 100644\n--- a/app/test/test_efd_perf.c\n+++ b/app/test/test_efd_perf.c\n@@ -71,13 +71,13 @@ static uint32_t hashtest_key_lens[] = {\n };\n \n /* Array to store number of cycles per operation */\n-uint64_t cycles[NUM_KEYSIZES][NUM_OPERATIONS];\n+static uint64_t cycles[NUM_KEYSIZES][NUM_OPERATIONS];\n \n /* Array to store the data */\n-efd_value_t data[KEYS_TO_ADD];\n+static efd_value_t data[KEYS_TO_ADD];\n \n /* Array to store all input keys */\n-uint8_t keys[KEYS_TO_ADD][MAX_KEYSIZE];\n+static uint8_t keys[KEYS_TO_ADD][MAX_KEYSIZE];\n \n /* Shuffle the keys that have been added, so lookups will be totally random */\n static void\ndiff --git a/app/test/test_hash_perf.c b/app/test/test_hash_perf.c\nindex 5648fce02..a438eae6c 100644\n--- a/app/test/test_hash_perf.c\n+++ b/app/test/test_hash_perf.c\n@@ -53,22 +53,22 @@ static uint32_t hashtest_key_lens[] = {\n struct rte_hash *h[NUM_KEYSIZES];\n \n /* Array that stores if a slot is full */\n-uint8_t slot_taken[MAX_ENTRIES];\n+static uint8_t slot_taken[MAX_ENTRIES];\n \n /* Array to store number of cycles per operation */\n-uint64_t cycles[NUM_KEYSIZES][NUM_OPERATIONS][2][2];\n+static uint64_t cycles[NUM_KEYSIZES][NUM_OPERATIONS][2][2];\n \n /* Array to store all input keys */\n-uint8_t keys[KEYS_TO_ADD][MAX_KEYSIZE];\n+static uint8_t keys[KEYS_TO_ADD][MAX_KEYSIZE];\n \n /* Array to store the precomputed hash for 'keys' */\n-hash_sig_t signatures[KEYS_TO_ADD];\n+static hash_sig_t signatures[KEYS_TO_ADD];\n \n /* Array to store how many busy entries have each bucket */\n-uint8_t buckets[NUM_BUCKETS];\n+static uint8_t buckets[NUM_BUCKETS];\n \n /* Array to store the positions where keys are added */\n-int32_t positions[KEYS_TO_ADD];\n+static int32_t positions[KEYS_TO_ADD];\n \n /* Parameters used for hash table in unit test functions. */\n static struct rte_hash_parameters ut_params = {\ndiff --git a/app/test/test_hash_readwrite_lf.c b/app/test/test_hash_readwrite_lf.c\nindex 1f2fba41f..97c304054 100644\n--- a/app/test/test_hash_readwrite_lf.c\n+++ b/app/test/test_hash_readwrite_lf.c\n@@ -48,7 +48,7 @@\n #define WRITE_EXT_BKT 2\n \n #define NUM_TEST 3\n-unsigned int rwc_core_cnt[NUM_TEST] = {1, 2, 4};\n+static unsigned int rwc_core_cnt[NUM_TEST] = {1, 2, 4};\n \n struct rwc_perf {\n \tuint32_t w_no_ks_r_hit[2][NUM_TEST];\n@@ -62,7 +62,7 @@ struct rwc_perf {\n \n static struct rwc_perf rwc_lf_results, rwc_non_lf_results;\n \n-struct {\n+static struct {\n \tuint32_t *keys;\n \tuint32_t *keys_no_ks;\n \tuint32_t *keys_ks;\n@@ -87,9 +87,9 @@ static rte_atomic64_t greads;\n \n static volatile uint8_t writer_done;\n \n-uint16_t enabled_core_ids[RTE_MAX_LCORE];\n+static uint16_t enabled_core_ids[RTE_MAX_LCORE];\n \n-uint8_t *scanned_bkts;\n+static uint8_t *scanned_bkts;\n \n static inline uint16_t\n get_short_sig(const hash_sig_t hash)\ndiff --git a/app/test/test_latencystats.c b/app/test/test_latencystats.c\nindex 8dd794be4..968e0bc47 100644\n--- a/app/test/test_latencystats.c\n+++ b/app/test/test_latencystats.c\n@@ -17,10 +17,10 @@\n #define LATENCY_NUM_PACKETS 10\n #define QUEUE_ID 0\n \n-uint16_t portid;\n-struct rte_ring *ring;\n+static uint16_t portid;\n+static struct rte_ring *ring;\n \n-struct rte_metric_name lat_stats_strings[] = {\n+static struct rte_metric_name lat_stats_strings[] = {\n \t{\"min_latency_ns\"},\n \t{\"avg_latency_ns\"},\n \t{\"max_latency_ns\"},\ndiff --git a/app/test/test_member_perf.c b/app/test/test_member_perf.c\nindex 564a2b3c1..e2840f12d 100644\n--- a/app/test/test_member_perf.c\n+++ b/app/test/test_member_perf.c\n@@ -65,18 +65,18 @@ static uint32_t hashtest_key_lens[] = {\n };\n \n /* Array to store number of cycles per operation */\n-uint64_t cycles[NUM_TYPE][NUM_KEYSIZES][NUM_OPERATIONS];\n-uint64_t false_data[NUM_TYPE][NUM_KEYSIZES];\n-uint64_t false_data_bulk[NUM_TYPE][NUM_KEYSIZES];\n-uint64_t false_data_multi[NUM_TYPE][NUM_KEYSIZES];\n-uint64_t false_data_multi_bulk[NUM_TYPE][NUM_KEYSIZES];\n+static uint64_t cycles[NUM_TYPE][NUM_KEYSIZES][NUM_OPERATIONS];\n+static uint64_t false_data[NUM_TYPE][NUM_KEYSIZES];\n+static uint64_t false_data_bulk[NUM_TYPE][NUM_KEYSIZES];\n+static uint64_t false_data_multi[NUM_TYPE][NUM_KEYSIZES];\n+static uint64_t false_data_multi_bulk[NUM_TYPE][NUM_KEYSIZES];\n \n-uint64_t false_hit[NUM_TYPE][NUM_KEYSIZES];\n+static uint64_t false_hit[NUM_TYPE][NUM_KEYSIZES];\n \n-member_set_t data[NUM_TYPE][/* Array to store the data */KEYS_TO_ADD];\n+static member_set_t data[NUM_TYPE][/* Array to store the data */KEYS_TO_ADD];\n \n /* Array to store all input keys */\n-uint8_t keys[KEYS_TO_ADD][MAX_KEYSIZE];\n+static uint8_t keys[KEYS_TO_ADD][MAX_KEYSIZE];\n \n /* Shuffle the keys that have been added, so lookups will be totally random */\n static void\ndiff --git a/app/test/test_rcu_qsbr.c b/app/test/test_rcu_qsbr.c\nindex d1b9e46a2..53c46ccc1 100644\n--- a/app/test/test_rcu_qsbr.c\n+++ b/app/test/test_rcu_qsbr.c\n@@ -25,8 +25,8 @@\n /* Make sure that this has the same value as __RTE_QSBR_CNT_INIT */\n #define TEST_RCU_QSBR_CNT_INIT 1\n \n-uint16_t enabled_core_ids[RTE_MAX_LCORE];\n-unsigned int num_cores;\n+static uint16_t enabled_core_ids[RTE_MAX_LCORE];\n+static unsigned int num_cores;\n \n static uint32_t *keys;\n #define TOTAL_ENTRY (1024 * 8)\n@@ -35,8 +35,8 @@ static uint32_t *hash_data[RTE_MAX_LCORE][TOTAL_ENTRY];\n static uint8_t writer_done;\n \n static struct rte_rcu_qsbr *t[RTE_MAX_LCORE];\n-struct rte_hash *h[RTE_MAX_LCORE];\n-char hash_name[RTE_MAX_LCORE][8];\n+static struct rte_hash *h[RTE_MAX_LCORE];\n+static char hash_name[RTE_MAX_LCORE][8];\n \n struct test_rcu_thread_info {\n \t/* Index in RCU array */\n@@ -46,7 +46,7 @@ struct test_rcu_thread_info {\n \t/* lcore IDs registered on the RCU variable */\n \tuint16_t r_core_ids[2];\n };\n-struct test_rcu_thread_info thread_info[RTE_MAX_LCORE/4];\n+static struct test_rcu_thread_info thread_info[RTE_MAX_LCORE/4];\n \n static int\n alloc_rcu(void)\n",
    "prefixes": [
        "10/10"
    ]
}