get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 139508,
    "url": "https://patches.dpdk.org/api/patches/139508/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1713470562-17415-13-git-send-email-roretzla@linux.microsoft.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": "<1713470562-17415-13-git-send-email-roretzla@linux.microsoft.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1713470562-17415-13-git-send-email-roretzla@linux.microsoft.com",
    "date": "2024-04-18T20:02:35",
    "name": "[v2,12/19] test: remove use of VLAs for Windows built code",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "c29db78fb38704a1ffa539265458d96b88397c65",
    "submitter": {
        "id": 2077,
        "url": "https://patches.dpdk.org/api/people/2077/?format=api",
        "name": "Tyler Retzlaff",
        "email": "roretzla@linux.microsoft.com"
    },
    "delegate": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1713470562-17415-13-git-send-email-roretzla@linux.microsoft.com/mbox/",
    "series": [
        {
            "id": 31785,
            "url": "https://patches.dpdk.org/api/series/31785/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=31785",
            "date": "2024-04-18T20:02:24",
            "name": "remove use of VLAs for Windows",
            "version": 2,
            "mbox": "https://patches.dpdk.org/series/31785/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/139508/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/139508/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 29CF043EA8;\n\tThu, 18 Apr 2024 22:04:08 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 613F040A8A;\n\tThu, 18 Apr 2024 22:03:01 +0200 (CEST)",
            "from linux.microsoft.com (linux.microsoft.com [13.77.154.182])\n by mails.dpdk.org (Postfix) with ESMTP id 065B1402D4\n for <dev@dpdk.org>; Thu, 18 Apr 2024 22:02:46 +0200 (CEST)",
            "by linux.microsoft.com (Postfix, from userid 1086)\n id 9B70C20FDA9C; Thu, 18 Apr 2024 13:02:44 -0700 (PDT)"
        ],
        "DKIM-Filter": "OpenDKIM Filter v2.11.0 linux.microsoft.com 9B70C20FDA9C",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com;\n s=default; t=1713470564;\n bh=4szHBJf0Z+fUSKIMOwGmNFUrf4ZSbotJcyUzr5oyLbc=;\n h=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n b=R7wk1/wwiY3ZRrFLErfPYosnO7L1SUpqgNFlPF9iE1h2kt2GEQ0wlxjhJmMlAelwC\n lq3uUCnirZc+Pu3L30s6SjA42SpaLsjI6uQEpCzBvexA5CEcNJ8ayQ6iEyeTLyx3xo\n edNE9JhgFgLBvyuL4klV3i3y58+k0nxchlDGd4G4=",
        "From": "Tyler Retzlaff <roretzla@linux.microsoft.com>",
        "To": "dev@dpdk.org",
        "Cc": "=?utf-8?q?Morten_Br=C3=B8rup?= <mb@smartsharesystems.com>,\n Akhil Goyal <gakhil@marvell.com>, Aman Singh <aman.deep.singh@intel.com>,\n Anatoly Burakov <anatoly.burakov@intel.com>,\n Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>,\n Bruce Richardson <bruce.richardson@intel.com>,\n Chengwen Feng <fengchengwen@huawei.com>,\n Dariusz Sosnowski <dsosnowski@nvidia.com>,\n Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>,\n Fan Zhang <fanzhang.oss@gmail.com>, Ferruh Yigit <ferruh.yigit@amd.com>,\n Harman Kalra <hkalra@marvell.com>,\n Harry van Haaren <harry.van.haaren@intel.com>,\n Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>,\n Jiayu Hu <hujiayu.hu@foxmail.com>, Jingjing Wu <jingjing.wu@intel.com>,\n Kevin Laatz <kevin.laatz@intel.com>,\n Konstantin Ananyev <konstantin.v.ananyev@yandex.ru>,\n Matan Azrad <matan@nvidia.com>, Ori Kam <orika@nvidia.com>,\n Pallavi Kadam <pallavi.kadam@intel.com>,\n Reshma Pattan <reshma.pattan@intel.com>,\n Sameh Gobriel <sameh.gobriel@intel.com>, Suanming Mou <suanmingm@nvidia.com>,\n Thomas Monjalon <thomas@monjalon.net>,\n Tyler Retzlaff <roretzla@linux.microsoft.com>,\n Viacheslav Ovsiienko <viacheslavo@nvidia.com>,\n Vladimir Medvedkin <vladimir.medvedkin@intel.com>,\n Volodymyr Fialko <vfialko@marvell.com>, Yipeng Wang <yipeng1.wang@intel.com>",
        "Subject": "[PATCH v2 12/19] test: remove use of VLAs for Windows built code",
        "Date": "Thu, 18 Apr 2024 13:02:35 -0700",
        "Message-Id": "<1713470562-17415-13-git-send-email-roretzla@linux.microsoft.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "In-Reply-To": "<1713470562-17415-1-git-send-email-roretzla@linux.microsoft.com>",
        "References": "<1713397319-26135-1-git-send-email-roretzla@linux.microsoft.com>\n <1713470562-17415-1-git-send-email-roretzla@linux.microsoft.com>",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <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 <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org"
    },
    "content": "MSVC does not support VLAs, replace VLAs with standard C arrays\nor alloca(). alloca() is available for all toolchain/platform\ncombinations officially supported by DPDK.\n\nSigned-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>\n---\n app/test/test.c                       |  2 +-\n app/test/test_cmdline_string.c        |  2 +-\n app/test/test_cryptodev.c             | 32 +++++++++++------------\n app/test/test_cryptodev_blockcipher.c |  4 +--\n app/test/test_cryptodev_crosscheck.c  |  2 +-\n app/test/test_dmadev.c                |  9 ++++---\n app/test/test_hash.c                  |  8 +++---\n app/test/test_mempool.c               | 25 +++++++++---------\n app/test/test_reassembly_perf.c       |  4 +--\n app/test/test_reorder.c               | 48 +++++++++++++++++++----------------\n app/test/test_service_cores.c         |  9 +++----\n app/test/test_thash.c                 |  7 +++--\n 12 files changed, 79 insertions(+), 73 deletions(-)",
    "diff": "diff --git a/app/test/test.c b/app/test/test.c\nindex 680351f..fd653cb 100644\n--- a/app/test/test.c\n+++ b/app/test/test.c\n@@ -105,7 +105,7 @@\n main(int argc, char **argv)\n {\n \tstruct cmdline *cl;\n-\tchar *tests[argc]; /* store an array of tests to run */\n+\tchar **tests = alloca(sizeof(char *) * argc); /* store an array of tests to run */\n \tint test_count = 0;\n \tint i;\n \tchar *extra_args;\ndiff --git a/app/test/test_cmdline_string.c b/app/test/test_cmdline_string.c\nindex 97516c9..e1cf860 100644\n--- a/app/test/test_cmdline_string.c\n+++ b/app/test/test_cmdline_string.c\n@@ -40,7 +40,7 @@ struct string_elt_str string_elt_strs[] = {\n #if (CMDLINE_TEST_BUFSIZE < STR_TOKEN_SIZE) \\\n || (CMDLINE_TEST_BUFSIZE < STR_MULTI_TOKEN_SIZE)\n #undef CMDLINE_TEST_BUFSIZE\n-#define CMDLINE_TEST_BUFSIZE RTE_MAX(STR_TOKEN_SIZE, STR_MULTI_TOKEN_SIZE)\n+#define CMDLINE_TEST_BUFSIZE RTE_MAX_T(STR_TOKEN_SIZE, STR_MULTI_TOKEN_SIZE, size_t)\n #endif\n \n struct string_nb_str {\ndiff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c\nindex 1703ebc..fead21b 100644\n--- a/app/test/test_cryptodev.c\n+++ b/app/test/test_cryptodev.c\n@@ -2686,7 +2686,7 @@ struct crypto_unittest_params {\n \tenum rte_crypto_auth_operation op,\n \tenum rte_crypto_auth_algorithm algo)\n {\n-\tuint8_t hash_key[key_len];\n+\tuint8_t *hash_key = alloca(key_len);\n \n \tstruct crypto_testsuite_params *ts_params = &testsuite_params;\n \tstruct crypto_unittest_params *ut_params = &unittest_params;\n@@ -2722,7 +2722,7 @@ struct crypto_unittest_params {\n \t\t\tconst uint8_t *key, const uint8_t key_len,\n \t\t\tuint8_t iv_len)\n {\n-\tuint8_t cipher_key[key_len];\n+\tuint8_t *cipher_key = alloca(key_len);\n \tstruct crypto_testsuite_params *ts_params = &testsuite_params;\n \tstruct crypto_unittest_params *ut_params = &unittest_params;\n \n@@ -2874,7 +2874,7 @@ struct crypto_unittest_params {\n \t\tconst struct wireless_test_data *tdata)\n {\n \tconst uint8_t key_len = tdata->key.len;\n-\tuint8_t cipher_auth_key[key_len];\n+\tuint8_t *cipher_auth_key = alloca(key_len);\n \n \tstruct crypto_testsuite_params *ts_params = &testsuite_params;\n \tstruct crypto_unittest_params *ut_params = &unittest_params;\n@@ -8878,7 +8878,7 @@ static int test_snow3g_decryption_oop(const struct snow3g_test_data *tdata)\n \t\tconst uint16_t aad_len, const uint8_t auth_len,\n \t\tuint8_t iv_len)\n {\n-\tuint8_t aead_key[key_len];\n+\tuint8_t *aead_key = alloca(key_len);\n \n \tstruct crypto_testsuite_params *ts_params = &testsuite_params;\n \tstruct crypto_unittest_params *ut_params = &unittest_params;\n@@ -12849,7 +12849,7 @@ static int test_pdcp_proto(int i, int oop, enum rte_crypto_cipher_operation opc,\n test_AES_GCM_auth_encryption_fail_aad_corrupt(void)\n {\n \tstruct aead_test_data tdata;\n-\tuint8_t aad[gcm_test_case_7.aad.len];\n+\tuint8_t *aad = alloca(gcm_test_case_7.aad.len);\n \tint res;\n \n \tRTE_LOG(INFO, USER1, \"This is a negative test, errors are expected\\n\");\n@@ -13238,7 +13238,7 @@ static int test_pdcp_proto(int i, int oop, enum rte_crypto_cipher_operation opc,\n test_AES_GCM_auth_decryption_fail_aad_corrupt(void)\n {\n \tstruct aead_test_data tdata;\n-\tuint8_t aad[gcm_test_case_7.aad.len];\n+\tuint8_t *aad = alloca(gcm_test_case_7.aad.len);\n \tint res;\n \n \tmemcpy(&tdata, &gcm_test_case_7, sizeof(struct aead_test_data));\n@@ -13490,7 +13490,7 @@ static int test_pdcp_proto(int i, int oop, enum rte_crypto_cipher_operation opc,\n \tint retval;\n \tuint8_t *ciphertext, *auth_tag;\n \tuint16_t plaintext_pad_len;\n-\tuint8_t key[tdata->key.len + 1];\n+\tuint8_t *key = alloca(tdata->key.len + 1);\n \tstruct rte_cryptodev_info dev_info;\n \n \trte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info);\n@@ -13592,7 +13592,7 @@ static int test_pdcp_proto(int i, int oop, enum rte_crypto_cipher_operation opc,\n \n \tint retval;\n \tuint8_t *plaintext;\n-\tuint8_t key[tdata->key.len + 1];\n+\tuint8_t *key = alloca(tdata->key.len + 1);\n \tstruct rte_cryptodev_info dev_info;\n \n \trte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info);\n@@ -14895,7 +14895,7 @@ static int create_gmac_session(uint8_t dev_id,\n \t\tconst struct gmac_test_data *tdata,\n \t\tenum rte_crypto_auth_operation auth_op)\n {\n-\tuint8_t auth_key[tdata->key.len];\n+\tuint8_t *auth_key = alloca(tdata->key.len);\n \n \tstruct crypto_testsuite_params *ts_params = &testsuite_params;\n \tstruct crypto_unittest_params *ut_params = &unittest_params;\n@@ -15552,7 +15552,7 @@ struct test_crypto_vector {\n \t\tenum rte_crypto_auth_operation auth_op)\n {\n \tstruct crypto_testsuite_params *ts_params = &testsuite_params;\n-\tuint8_t auth_key[reference->auth_key.len + 1];\n+\tuint8_t *auth_key = alloca(reference->auth_key.len + 1);\n \n \tmemcpy(auth_key, reference->auth_key.data, reference->auth_key.len);\n \n@@ -15583,8 +15583,8 @@ struct test_crypto_vector {\n \t\tenum rte_crypto_cipher_operation cipher_op)\n {\n \tstruct crypto_testsuite_params *ts_params = &testsuite_params;\n-\tuint8_t cipher_key[reference->cipher_key.len + 1];\n-\tuint8_t auth_key[reference->auth_key.len + 1];\n+\tuint8_t *cipher_key = alloca(reference->cipher_key.len + 1);\n+\tuint8_t *auth_key = alloca(reference->auth_key.len + 1);\n \n \tmemcpy(cipher_key, reference->cipher_key.data,\n \t\t\treference->cipher_key.len);\n@@ -16084,8 +16084,8 @@ struct test_crypto_vector {\n \n \tuint8_t *authciphertext, *plaintext, *auth_tag;\n \tuint16_t plaintext_pad_len;\n-\tuint8_t cipher_key[reference->cipher_key.len + 1];\n-\tuint8_t auth_key[reference->auth_key.len + 1];\n+\tuint8_t *cipher_key = alloca(reference->cipher_key.len + 1);\n+\tuint8_t *auth_key = alloca(reference->auth_key.len + 1);\n \tstruct rte_cryptodev_info dev_info;\n \n \trte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info);\n@@ -16216,8 +16216,8 @@ struct test_crypto_vector {\n \tint retval;\n \n \tuint8_t *ciphertext;\n-\tuint8_t cipher_key[reference->cipher_key.len + 1];\n-\tuint8_t auth_key[reference->auth_key.len + 1];\n+\tuint8_t *cipher_key = alloca(reference->cipher_key.len + 1);\n+\tuint8_t *auth_key = alloca(reference->auth_key.len + 1);\n \tstruct rte_cryptodev_info dev_info;\n \n \trte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info);\ndiff --git a/app/test/test_cryptodev_blockcipher.c b/app/test/test_cryptodev_blockcipher.c\nindex 87a321f..da7bf2c 100644\n--- a/app/test/test_cryptodev_blockcipher.c\n+++ b/app/test/test_cryptodev_blockcipher.c\n@@ -85,8 +85,8 @@\n \n \tint status = TEST_SUCCESS;\n \tconst struct blockcipher_test_data *tdata = t->test_data;\n-\tuint8_t cipher_key[tdata->cipher_key.len];\n-\tuint8_t auth_key[tdata->auth_key.len];\n+\tuint8_t *cipher_key = alloca(tdata->cipher_key.len);\n+\tuint8_t *auth_key = alloca(tdata->auth_key.len);\n \tuint32_t buf_len = tdata->ciphertext.len;\n \tuint32_t digest_len = tdata->digest.len;\n \tchar *buf_p = NULL;\ndiff --git a/app/test/test_cryptodev_crosscheck.c b/app/test/test_cryptodev_crosscheck.c\nindex c29b19c..b9a53a4 100644\n--- a/app/test/test_cryptodev_crosscheck.c\n+++ b/app/test/test_cryptodev_crosscheck.c\n@@ -894,7 +894,7 @@ struct crosscheck_testsuite_params {\n crosscheck_with_profile_run(const struct crosscheck_test_profile *profile)\n {\n \tstruct crosscheck_testsuite_params *ts_params = &testsuite_params;\n-\tuint8_t input_text[profile->input_buf_len];\n+\tuint8_t *input_text = alloca(profile->input_buf_len);\n \tuint16_t output_len, encrypted_len;\n \tuint8_t encrypted_text[MBUF_SIZE];\n \tuint8_t output_text[MBUF_SIZE];\ndiff --git a/app/test/test_dmadev.c b/app/test/test_dmadev.c\nindex 143e1bc..9cbb9a6 100644\n--- a/app/test/test_dmadev.c\n+++ b/app/test/test_dmadev.c\n@@ -417,9 +417,12 @@ struct runtest_param {\n \t\t\tdst_len = len / n_dst;\n \t\t\tsrc_len = len / n_src;\n \n-\t\t\tstruct rte_dma_sge sg_src[n_sge], sg_dst[n_sge];\n-\t\t\tstruct rte_mbuf *src[n_sge], *dst[n_sge];\n-\t\t\tchar *src_data[n_sge], *dst_data[n_sge];\n+\t\t\tstruct rte_dma_sge *sg_src = alloca(sizeof(struct rte_dma_sge) * n_sge);\n+\t\t\tstruct rte_dma_sge *sg_dst = alloca(sizeof(struct rte_dma_sge) * n_sge);\n+\t\t\tstruct rte_mbuf **src = alloca(sizeof(struct rte_mbuf *) * n_sge);\n+\t\t\tstruct rte_mbuf **dst = alloca(sizeof(struct rte_mbuf *) * n_sge);\n+\t\t\tchar **src_data = alloca(sizeof(char *) * n_sge);\n+\t\t\tchar **dst_data = alloca(sizeof(char *) * n_sge);\n \n \t\t\tfor (i = 0 ; i < len; i++)\n \t\t\t\torig_src[i] = rte_rand() & 0xFF;\ndiff --git a/app/test/test_hash.c b/app/test/test_hash.c\nindex d586878..65fd9e6 100644\n--- a/app/test/test_hash.c\n+++ b/app/test/test_hash.c\n@@ -1930,8 +1930,8 @@ static int test_hash_iteration(uint32_t ext_table)\n \t\t.socket_id = 0,\n \t\t.extra_flag = hash_extra_flag,\n \t};\n-\tint pos[total_entries];\n-\tint expected_pos[total_entries];\n+\tint *pos = alloca(sizeof(int) * total_entries);\n+\tint *expected_pos = alloca(sizeof(int) * total_entries);\n \tunsigned int i;\n \tsize_t sz;\n \tint32_t status;\n@@ -2100,8 +2100,8 @@ static int test_hash_iteration(uint32_t ext_table)\n \t\t.socket_id = 0,\n \t\t.extra_flag = hash_extra_flag,\n \t};\n-\tint pos[total_entries];\n-\tint expected_pos[total_entries];\n+\tint *pos = alloca(sizeof(int) * total_entries);\n+\tint *expected_pos = alloca(sizeof(int) * total_entries);\n \tunsigned int i;\n \tsize_t sz;\n \tint32_t status;\ndiff --git a/app/test/test_mempool.c b/app/test/test_mempool.c\nindex ad7ebd6..4672795 100644\n--- a/app/test/test_mempool.c\n+++ b/app/test/test_mempool.c\n@@ -515,19 +515,20 @@ struct test_mempool_events_data {\n #undef RTE_TEST_TRACE_FAILURE\n #define RTE_TEST_TRACE_FAILURE(...) do { goto fail; } while (0)\n \n-\tstatic const size_t callback_num = 3;\n-\tstatic const size_t mempool_num = 2;\n+#define CALLBACK_NUM 3u\n+#define MEMPOOL_NUM 2u\n+\n \tstatic const unsigned int mempool_elt_size = 64;\n \tstatic const unsigned int mempool_size = 64;\n \n-\tstruct test_mempool_events_data data[callback_num];\n-\tstruct rte_mempool *mp[mempool_num], *freed;\n+\tstruct test_mempool_events_data data[CALLBACK_NUM];\n+\tstruct rte_mempool *mp[MEMPOOL_NUM], *freed;\n \tchar name[RTE_MEMPOOL_NAMESIZE];\n \tsize_t i, j;\n \tint ret;\n \n \tmemset(mp, 0, sizeof(mp));\n-\tfor (i = 0; i < callback_num; i++) {\n+\tfor (i = 0; i < CALLBACK_NUM; i++) {\n \t\tret = rte_mempool_event_callback_register\n \t\t\t\t(test_mempool_events_cb, &data[i]);\n \t\tRTE_TEST_ASSERT_EQUAL(ret, 0, \"Failed to register the callback %zu: %s\",\n@@ -548,7 +549,7 @@ struct test_mempool_events_data {\n \t\t\t\t\t SOCKET_ID_ANY, 0);\n \tRTE_TEST_ASSERT_NOT_NULL(mp[0], \"Cannot create mempool %s: %s\",\n \t\t\t\t name, rte_strerror(rte_errno));\n-\tfor (j = 0; j < callback_num; j++)\n+\tfor (j = 0; j < CALLBACK_NUM; j++)\n \t\tRTE_TEST_ASSERT_EQUAL(data[j].invoked, false,\n \t\t\t\t      \"Callback %zu invoked on %s mempool creation\",\n \t\t\t\t      j, name);\n@@ -557,7 +558,7 @@ struct test_mempool_events_data {\n \tret = populate(mp[0]);\n \tRTE_TEST_ASSERT_EQUAL(ret, (int)mp[0]->size, \"Failed to populate mempool %s: %s\",\n \t\t\t      name, rte_strerror(-ret));\n-\tfor (j = 0; j < callback_num; j++) {\n+\tfor (j = 0; j < CALLBACK_NUM; j++) {\n \t\tRTE_TEST_ASSERT_EQUAL(data[j].invoked, true,\n \t\t\t\t\t\"Callback %zu not invoked on mempool %s population\",\n \t\t\t\t\tj, name);\n@@ -589,7 +590,7 @@ struct test_mempool_events_data {\n \t\t\t      \"Unregistered callback 0 invoked on %s mempool populaton\",\n \t\t\t      name);\n \n-\tfor (i = 0; i < mempool_num; i++) {\n+\tfor (i = 0; i < MEMPOOL_NUM; i++) {\n \t\tmemset(&data, 0, sizeof(data));\n \t\tsprintf(name, \"empty%zu\", i);\n \t\trte_mempool_free(mp[i]);\n@@ -599,7 +600,7 @@ struct test_mempool_events_data {\n \t\t */\n \t\tfreed = mp[i];\n \t\tmp[i] = NULL;\n-\t\tfor (j = 1; j < callback_num; j++) {\n+\t\tfor (j = 1; j < CALLBACK_NUM; j++) {\n \t\t\tRTE_TEST_ASSERT_EQUAL(data[j].invoked, true,\n \t\t\t\t\t      \"Callback %zu not invoked on mempool %s destruction\",\n \t\t\t\t\t      j, name);\n@@ -615,7 +616,7 @@ struct test_mempool_events_data {\n \t\t\t\t      name);\n \t}\n \n-\tfor (j = 1; j < callback_num; j++) {\n+\tfor (j = 1; j < CALLBACK_NUM; j++) {\n \t\tret = rte_mempool_event_callback_unregister\n \t\t\t\t\t(test_mempool_events_cb, &data[j]);\n \t\tRTE_TEST_ASSERT_EQUAL(ret, 0, \"Failed to unregister the callback %zu: %s\",\n@@ -624,10 +625,10 @@ struct test_mempool_events_data {\n \treturn TEST_SUCCESS;\n \n fail:\n-\tfor (j = 0; j < callback_num; j++)\n+\tfor (j = 0; j < CALLBACK_NUM; j++)\n \t\trte_mempool_event_callback_unregister\n \t\t\t\t\t(test_mempool_events_cb, &data[j]);\n-\tfor (i = 0; i < mempool_num; i++)\n+\tfor (i = 0; i < MEMPOOL_NUM; i++)\n \t\trte_mempool_free(mp[i]);\n \treturn TEST_FAILED;\n \ndiff --git a/app/test/test_reassembly_perf.c b/app/test/test_reassembly_perf.c\nindex 3912179..7f4ed31 100644\n--- a/app/test/test_reassembly_perf.c\n+++ b/app/test/test_reassembly_perf.c\n@@ -604,7 +604,7 @@\n \t\tfor (j = 0; j < 4; j++)\n \t\t\tnb_frags += frag_per_flow[i + j];\n \n-\t\tstruct rte_mbuf *buf_arr[nb_frags];\n+\t\tstruct rte_mbuf **buf_arr = alloca(sizeof(struct rte_mbuf *) * nb_frags);\n \t\tfor (j = 0; j < 4; j++) {\n \t\t\tjoin_array(buf_arr, mbufs[i + j], prev,\n \t\t\t\t   frag_per_flow[i + j]);\n@@ -815,7 +815,7 @@\n \t\tfor (j = 0; j < 4; j++)\n \t\t\tnb_frags += frag_per_flow[i + j];\n \n-\t\tstruct rte_mbuf *buf_arr[nb_frags];\n+\t\tstruct rte_mbuf **buf_arr = alloca(sizeof(struct rte_mbuf *) * nb_frags);\n \t\tfor (j = 0; j < 4; j++) {\n \t\t\tjoin_array(buf_arr, mbufs[i + j], prev,\n \t\t\t\t   frag_per_flow[i + j]);\ndiff --git a/app/test/test_reorder.c b/app/test/test_reorder.c\nindex 501780c..aaa2c57 100644\n--- a/app/test/test_reorder.c\n+++ b/app/test/test_reorder.c\n@@ -130,11 +130,12 @@ struct reorder_unittest_params {\n static int\n test_reorder_insert(void)\n {\n+#define INSERT_NUM_BUFS 7u\n+\n \tstruct rte_reorder_buffer *b = NULL;\n \tstruct rte_mempool *p = test_params->p;\n \tconst unsigned int size = 4;\n-\tconst unsigned int num_bufs = 7;\n-\tstruct rte_mbuf *bufs[num_bufs];\n+\tstruct rte_mbuf *bufs[INSERT_NUM_BUFS];\n \tint ret = 0;\n \tunsigned i;\n \n@@ -146,7 +147,7 @@ struct reorder_unittest_params {\n \tb = rte_reorder_create(\"test_insert\", rte_socket_id(), size);\n \tTEST_ASSERT_NOT_NULL(b, \"Failed to create reorder buffer\");\n \n-\tfor (i = 0; i < num_bufs; i++) {\n+\tfor (i = 0; i < INSERT_NUM_BUFS; i++) {\n \t\tbufs[i] = rte_pktmbuf_alloc(p);\n \t\tTEST_ASSERT_NOT_NULL(bufs[i], \"Packet allocation failed\\n\");\n \t\t*rte_reorder_seqn(bufs[i]) = i;\n@@ -207,26 +208,27 @@ struct reorder_unittest_params {\n \tret = 0;\n exit:\n \trte_reorder_free(b);\n-\tfor (i = 0; i < num_bufs; i++) {\n+\tfor (i = 0; i < INSERT_NUM_BUFS; i++)\n \t\trte_pktmbuf_free(bufs[i]);\n-\t}\n+\n \treturn ret;\n }\n \n static int\n test_reorder_drain(void)\n {\n+#define DRAIN_NUM_BUFS 8u\n+\n \tstruct rte_reorder_buffer *b = NULL;\n \tstruct rte_mempool *p = test_params->p;\n \tconst unsigned int size = 4;\n-\tconst unsigned int num_bufs = 8;\n-\tstruct rte_mbuf *bufs[num_bufs];\n-\tstruct rte_mbuf *robufs[num_bufs];\n+\tstruct rte_mbuf *bufs[DRAIN_NUM_BUFS];\n+\tstruct rte_mbuf *robufs[DRAIN_NUM_BUFS];\n \tint ret = 0;\n \tunsigned i, cnt;\n \n \t/* initialize all robufs to NULL */\n-\tfor (i = 0; i < num_bufs; i++)\n+\tfor (i = 0; i < DRAIN_NUM_BUFS; i++)\n \t\trobufs[i] = NULL;\n \n \t/* This would create a reorder buffer instance consisting of:\n@@ -246,7 +248,7 @@ struct reorder_unittest_params {\n \t\tgoto exit;\n \t}\n \n-\tfor (i = 0; i < num_bufs; i++) {\n+\tfor (i = 0; i < DRAIN_NUM_BUFS; i++) {\n \t\tbufs[i] = rte_pktmbuf_alloc(p);\n \t\tTEST_ASSERT_NOT_NULL(bufs[i], \"Packet allocation failed\\n\");\n \t\t*rte_reorder_seqn(bufs[i]) = i;\n@@ -320,7 +322,7 @@ struct reorder_unittest_params {\n \tret = 0;\n exit:\n \trte_reorder_free(b);\n-\tfor (i = 0; i < num_bufs; i++) {\n+\tfor (i = 0; i < DRAIN_NUM_BUFS; i++) {\n \t\trte_pktmbuf_free(bufs[i]);\n \t\trte_pktmbuf_free(robufs[i]);\n \t}\n@@ -337,15 +339,16 @@ struct reorder_unittest_params {\n static int\n test_reorder_drain_up_to_seqn(void)\n {\n+#define DRAIN_TO_NUM_BUFS 10u\n+\n \tstruct rte_mempool *p = test_params->p;\n \tstruct rte_reorder_buffer *b = NULL;\n-\tconst unsigned int num_bufs = 10;\n \tconst unsigned int size = 4;\n \tunsigned int i, cnt;\n \tint ret = 0;\n \n-\tstruct rte_mbuf *bufs[num_bufs];\n-\tstruct rte_mbuf *robufs[num_bufs];\n+\tstruct rte_mbuf *bufs[DRAIN_TO_NUM_BUFS];\n+\tstruct rte_mbuf *robufs[DRAIN_TO_NUM_BUFS];\n \n \t/* initialize all robufs to NULL */\n \tmemset(robufs, 0, sizeof(robufs));\n@@ -358,7 +361,7 @@ struct reorder_unittest_params {\n \tb = rte_reorder_create(\"test_drain_up_to_seqn\", rte_socket_id(), size);\n \tTEST_ASSERT_NOT_NULL(b, \"Failed to create reorder buffer\");\n \n-\tfor (i = 0; i < num_bufs; i++) {\n+\tfor (i = 0; i < DRAIN_TO_NUM_BUFS; i++) {\n \t\tbufs[i] = rte_pktmbuf_alloc(p);\n \t\tTEST_ASSERT_NOT_NULL(bufs[i], \"Packet allocation failed\\n\");\n \t\t*rte_reorder_seqn(bufs[i]) = i;\n@@ -372,7 +375,7 @@ struct reorder_unittest_params {\n \tbuffer_to_reorder_move(&bufs[2], b);\n \tbuffer_to_reorder_move(&bufs[3], b);\n \t/* Draining 1, 2 */\n-\tcnt = rte_reorder_drain_up_to_seqn(b, robufs, num_bufs, 3);\n+\tcnt = rte_reorder_drain_up_to_seqn(b, robufs, DRAIN_TO_NUM_BUFS, 3);\n \tif (cnt != 2) {\n \t\tprintf(\"%s:%d:%d: number of expected packets not drained\\n\",\n \t\t\t\t__func__, __LINE__, cnt);\n@@ -396,7 +399,7 @@ struct reorder_unittest_params {\n \tbuffer_to_reorder_move(&bufs[8], b);\n \n \t/* Drain 3 and 5 */\n-\tcnt = rte_reorder_drain_up_to_seqn(b, robufs, num_bufs, 6);\n+\tcnt = rte_reorder_drain_up_to_seqn(b, robufs, DRAIN_TO_NUM_BUFS, 6);\n \tif (cnt != 2) {\n \t\tprintf(\"%s:%d:%d: number of expected packets not drained\\n\",\n \t\t\t\t__func__, __LINE__, cnt);\n@@ -410,7 +413,7 @@ struct reorder_unittest_params {\n \tret = 0;\n exit:\n \trte_reorder_free(b);\n-\tfor (i = 0; i < num_bufs; i++) {\n+\tfor (i = 0; i < DRAIN_TO_NUM_BUFS; i++) {\n \t\trte_pktmbuf_free(bufs[i]);\n \t\trte_pktmbuf_free(robufs[i]);\n \t}\n@@ -420,14 +423,15 @@ struct reorder_unittest_params {\n static int\n test_reorder_set_seqn(void)\n {\n+#define SET_SEQN_NUM_BUFS 7u\n+\n \tstruct rte_mempool *p = test_params->p;\n \tstruct rte_reorder_buffer *b = NULL;\n-\tconst unsigned int num_bufs = 7;\n \tconst unsigned int size = 4;\n \tunsigned int i;\n \tint ret = 0;\n \n-\tstruct rte_mbuf *bufs[num_bufs];\n+\tstruct rte_mbuf *bufs[SET_SEQN_NUM_BUFS];\n \n \t/* This would create a reorder buffer instance consisting of:\n \t * reorder_seq = 0\n@@ -437,7 +441,7 @@ struct reorder_unittest_params {\n \tb = rte_reorder_create(\"test_min_seqn_set\", rte_socket_id(), size);\n \tTEST_ASSERT_NOT_NULL(b, \"Failed to create reorder buffer\");\n \n-\tfor (i = 0; i < num_bufs; i++) {\n+\tfor (i = 0; i < SET_SEQN_NUM_BUFS; i++) {\n \t\tbufs[i] = rte_pktmbuf_alloc(p);\n \t\tif (bufs[i] == NULL) {\n \t\t\tprintf(\"Packet allocation failed\\n\");\n@@ -479,7 +483,7 @@ struct reorder_unittest_params {\n \tret = 0;\n exit:\n \trte_reorder_free(b);\n-\tfor (i = 0; i < num_bufs; i++)\n+\tfor (i = 0; i < SET_SEQN_NUM_BUFS; i++)\n \t\trte_pktmbuf_free(bufs[i]);\n \n \treturn ret;\ndiff --git a/app/test/test_service_cores.c b/app/test/test_service_cores.c\nindex c12d52d..7c45733 100644\n--- a/app/test/test_service_cores.c\n+++ b/app/test/test_service_cores.c\n@@ -561,9 +561,8 @@ static int32_t dummy_mt_safe_cb(void *args)\n \t\t\t\"Service core count not equal to one\");\n \n \t/* retrieve core list, checking lcore ids */\n-\tconst uint32_t size = 4;\n-\tuint32_t service_core_ids[size];\n-\tint32_t n = rte_service_lcore_list(service_core_ids, size);\n+\tuint32_t service_core_ids[4];\n+\tint32_t n = rte_service_lcore_list(service_core_ids, RTE_DIM(service_core_ids));\n \tTEST_ASSERT_EQUAL(1, n, \"Service core list return should equal 1\");\n \tTEST_ASSERT_EQUAL(slcore_id, service_core_ids[0],\n \t\t\t\t\"Service core list lcore must equal slcore_id\");\n@@ -589,7 +588,7 @@ static int32_t dummy_mt_safe_cb(void *args)\n \t\t\tcores_at_this_point);\n \n \t/* check longer service core list */\n-\tn = rte_service_lcore_list(service_core_ids, size);\n+\tn = rte_service_lcore_list(service_core_ids, RTE_DIM(service_core_ids));\n \tTEST_ASSERT_EQUAL(3, n, \"Service core list return should equal 3\");\n \tTEST_ASSERT_EQUAL(slcore_id, service_core_ids[0],\n \t\t\t\t\"Service core list[0] lcore must equal 1\");\n@@ -607,7 +606,7 @@ static int32_t dummy_mt_safe_cb(void *args)\n \t\t\t\"Service core add did not return zero\");\n \tTEST_ASSERT_EQUAL(1, rte_service_lcore_count(),\n \t\t\t\"Service core count not equal to one\");\n-\tn = rte_service_lcore_list(service_core_ids, size);\n+\tn = rte_service_lcore_list(service_core_ids, RTE_DIM(service_core_ids));\n \tTEST_ASSERT_EQUAL(1, n, \"Service core list return should equal one\");\n \tTEST_ASSERT_EQUAL(slcore_id, service_core_ids[0],\n \t\t\t\t\"Service core list[0] lcore must equal %d\",\ndiff --git a/app/test/test_thash.c b/app/test/test_thash.c\nindex 65d42fd..80d4106 100644\n--- a/app/test/test_thash.c\n+++ b/app/test/test_thash.c\n@@ -576,9 +576,8 @@ enum {\n {\n \tstruct rte_thash_ctx *ctx;\n \tstruct rte_thash_subtuple_helper *h;\n-\tconst int key_len = 40;\n \tint reta_sz = 6;\n-\tuint8_t initial_key[key_len];\n+\tuint8_t initial_key[40];\n \tconst uint8_t *new_key;\n \tint ret;\n \tunion rte_thash_tuple tuple;\n@@ -586,9 +585,9 @@ enum {\n \tunsigned int desired_value = 27 & HASH_MSK(reta_sz);\n \tuint16_t port_value = 22;\n \n-\tmemset(initial_key, 0, key_len);\n+\tmemset(initial_key, 0, RTE_DIM(initial_key));\n \n-\tctx = rte_thash_init_ctx(\"test\", key_len, reta_sz, initial_key,\n+\tctx = rte_thash_init_ctx(\"test\", RTE_DIM(initial_key), reta_sz, initial_key,\n \t\tRTE_THASH_MINIMAL_SEQ);\n \tRTE_TEST_ASSERT(ctx != NULL, \"can not create thash ctx\\n\");\n \n",
    "prefixes": [
        "v2",
        "12/19"
    ]
}