get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 62098,
    "url": "http://patches.dpdk.org/api/patches/62098/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20191028090907.824-1-pbhagavatula@marvell.com/",
    "project": {
        "id": 1,
        "url": "http://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": "<20191028090907.824-1-pbhagavatula@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20191028090907.824-1-pbhagavatula@marvell.com",
    "date": "2019-10-28T09:09:04",
    "name": "[1/3] app: use RTE_DIM to calculate array size",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "db77b0c2e459c0c64baf72f6e6697364be1a2e3a",
    "submitter": {
        "id": 1183,
        "url": "http://patches.dpdk.org/api/people/1183/?format=api",
        "name": "Pavan Nikhilesh Bhagavatula",
        "email": "pbhagavatula@marvell.com"
    },
    "delegate": {
        "id": 24651,
        "url": "http://patches.dpdk.org/api/users/24651/?format=api",
        "username": "dmarchand",
        "first_name": "David",
        "last_name": "Marchand",
        "email": "david.marchand@redhat.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20191028090907.824-1-pbhagavatula@marvell.com/mbox/",
    "series": [
        {
            "id": 7102,
            "url": "http://patches.dpdk.org/api/series/7102/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=7102",
            "date": "2019-10-28T09:09:04",
            "name": "[1/3] app: use RTE_DIM to calculate array size",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/7102/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/62098/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/62098/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 84C8B1BF06;\n\tMon, 28 Oct 2019 10:09:17 +0100 (CET)",
            "from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com\n\t[67.231.148.174]) by dpdk.org (Postfix) with ESMTP id 83DBC1BEF9\n\tfor <dev@dpdk.org>; Mon, 28 Oct 2019 10:09:16 +0100 (CET)",
            "from pps.filterd (m0045849.ppops.net [127.0.0.1])\n\tby mx0a-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id\n\tx9S95Ym4010250; Mon, 28 Oct 2019 02:09:14 -0700",
            "from sc-exch03.marvell.com ([199.233.58.183])\n\tby mx0a-0016f401.pphosted.com with ESMTP id 2vvkgq5cem-1\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); \n\tMon, 28 Oct 2019 02:09:14 -0700",
            "from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH03.marvell.com\n\t(10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1367.3;\n\tMon, 28 Oct 2019 02:09:13 -0700",
            "from maili.marvell.com (10.93.176.43) by SC-EXCH01.marvell.com\n\t(10.93.176.81) with Microsoft SMTP Server id 15.0.1367.3 via Frontend\n\tTransport; Mon, 28 Oct 2019 02:09:12 -0700",
            "from BG-LT7430.marvell.com (unknown [10.28.17.14])\n\tby maili.marvell.com (Postfix) with ESMTP id D28323F7041;\n\tMon, 28 Oct 2019 02:09:08 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com;\n\th=from : to : cc :\n\tsubject : date : message-id : mime-version :\n\tcontent-transfer-encoding : content-type; s=pfpt0818;\n\tbh=OTv45Y0LDL9MzdZo80Q0MGUhfSZ6G8zNlLPXx6ZLAJQ=; \n\tb=ghaQOBDp2YEHJKntuFRi2r73fNeu3omHsd4JcLpWBXBazEV2h86tARCfLL2M4IrMH06w\n\tBhFKyW9rI4zQTsEEHmkrU/N0B0eh8Lt0JWtUn4tVXUZsZTqWyUwmZnz88Pd6a0PP2fO/\n\t3SkWDyzr5vmN58/eyRZEHJ9J1pSospeWoKvzR4Dlc6gOA/QkJtuPGVGwm6IibLHeMqU5\n\tlOuNTw9Jc1F5615ZE8AvQXMxz8pSvEmvBKwfhkQhA57qAB5YD8H9vVXAwFkSIamnCVYW\n\thB2DgWDuYUlPWrby0qI1JWHxv6wTjyhQjnKOP54shMCRTzBtFITl+eHLAQEG0jZuE6fN\n\tTg== ",
        "From": "<pbhagavatula@marvell.com>",
        "To": "Wenzhuo Lu <wenzhuo.lu@intel.com>, Jingjing Wu <jingjing.wu@intel.com>, \n\tBernard Iremonger <bernard.iremonger@intel.com>, Olivier Matz\n\t<olivier.matz@6wind.com>, Bruce Richardson <bruce.richardson@intel.com>, \n\tVladimir Medvedkin <vladimir.medvedkin@intel.com>, Anatoly Burakov\n\t<anatoly.burakov@intel.com>, Reshma Pattan <reshma.pattan@intel.com>, \n\t\"Robert Sanford\" <rsanford@akamai.com>, Erik Gabriel Carrillo\n\t<erik.g.carrillo@intel.com>",
        "CC": "<dev@dpdk.org>, Pavan Nikhilesh <pbhagavatula@marvell.com>",
        "Date": "Mon, 28 Oct 2019 14:39:04 +0530",
        "Message-ID": "<20191028090907.824-1-pbhagavatula@marvell.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-Proofpoint-Virus-Version": "vendor=fsecure engine=2.50.10434:6.0.95,1.0.8\n\tdefinitions=2019-10-28_04:2019-10-25,2019-10-28 signatures=0",
        "Subject": "[dpdk-dev]  [PATCH 1/3] app: use RTE_DIM to calculate array size",
        "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": "From: Pavan Nikhilesh <pbhagavatula@marvell.com>\n\nUse RTE_DIM macro to calculate array size\n\nSuggested-by: David Marchand <david.marchand@redhat.com>\nSigned-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>\n---\n app/test-pmd/cmdline.c            |  2 +-\n app/test-pmd/icmpecho.c           |  2 +-\n app/test-pmd/testpmd.c            |  2 +-\n app/test/test.c                   |  2 +-\n app/test/test_cmdline_etheraddr.c | 10 +++-------\n app/test/test_cmdline_ipaddr.c    | 18 ++++++------------\n app/test/test_cmdline_num.c       | 16 +++++-----------\n app/test/test_cmdline_portlist.c  | 12 ++++--------\n app/test/test_cmdline_string.c    | 15 +++++----------\n app/test/test_debug.c             |  2 +-\n app/test/test_eal_flags.c         |  9 ++++-----\n app/test/test_errno.c             |  4 ++--\n app/test/test_lpm.c               |  2 +-\n app/test/test_lpm6.c              |  2 +-\n app/test/test_lpm6_data.h         |  3 +--\n app/test/test_malloc.c            |  2 +-\n app/test/test_memcpy.c            |  2 +-\n app/test/test_memcpy_perf.c       |  4 ++--\n app/test/test_mp_secondary.c      |  3 +--\n app/test/test_pdump.c             |  3 +--\n app/test/test_pmd_ring_perf.c     |  2 +-\n app/test/test_ring_perf.c         |  6 +++---\n app/test/test_timer_secondary.c   |  3 +--\n 23 files changed, 48 insertions(+), 78 deletions(-)\n\n--\n2.23.0",
    "diff": "diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c\nindex 447806991..c6b4e44a2 100644\n--- a/app/test-pmd/cmdline.c\n+++ b/app/test-pmd/cmdline.c\n@@ -5490,7 +5490,7 @@ cmd_show_bypass_config_parsed(void *parsed_result,\n \t\t\"OS/board off\",\n \t\t\"power supply off\",\n \t\t\"timeout\"};\n-\tint num_events = (sizeof events) / (sizeof events[0]);\n+\tint num_events = RTE_DIM(events);\n\n \t/* Display the bypass mode.*/\n \tif (rte_pmd_ixgbe_bypass_state_show(port_id, &bypass_mode) != 0) {\ndiff --git a/app/test-pmd/icmpecho.c b/app/test-pmd/icmpecho.c\nindex 2d359c943..65aece16c 100644\n--- a/app/test-pmd/icmpecho.c\n+++ b/app/test-pmd/icmpecho.c\n@@ -188,7 +188,7 @@ ip_proto_name(uint16_t ip_proto)\n \t\t\"PIM\",        /**< Protocol Independent Mcast */\n \t};\n\n-\tif (ip_proto < sizeof(ip_proto_names) / sizeof(ip_proto_names[0]))\n+\tif (ip_proto < RTE_DIM(ip_proto_names))\n \t\treturn ip_proto_names[ip_proto];\n \tswitch (ip_proto) {\n #ifdef IPPROTO_PGM\ndiff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c\nindex 38acbc58a..1103db629 100644\n--- a/app/test-pmd/testpmd.c\n+++ b/app/test-pmd/testpmd.c\n@@ -2584,7 +2584,7 @@ struct pmd_test_command {\n \tcmd_func_t cmd_func;\n };\n\n-#define PMD_TEST_CMD_NB (sizeof(pmd_test_menu) / sizeof(pmd_test_menu[0]))\n+#define PMD_TEST_CMD_NB RTE_DIM(pmd_test_menu)\n\n /* Check the link status of all ports in up to 9s, and print them finally */\n static void\ndiff --git a/app/test/test.c b/app/test/test.c\nindex cd7aaf645..784535095 100644\n--- a/app/test/test.c\n+++ b/app/test/test.c\n@@ -74,7 +74,7 @@ do_recursive_call(void)\n\n \tif (recursive_call == NULL)\n \t\treturn -1;\n-\tfor (i = 0; i < sizeof(actions)/sizeof(actions[0]); i++) {\n+\tfor (i = 0; i < RTE_DIM(actions); i++) {\n \t\tif (strcmp(actions[i].env_var, recursive_call) == 0)\n \t\t\treturn (actions[i].action_fn)();\n \t}\ndiff --git a/app/test/test_cmdline_etheraddr.c b/app/test/test_cmdline_etheraddr.c\nindex 9a32fd7ec..dc7fa944b 100644\n--- a/app/test/test_cmdline_etheraddr.c\n+++ b/app/test/test_cmdline_etheraddr.c\n@@ -72,13 +72,9 @@ const char * ether_addr_invalid_strs[] = {\n \t\t\" \",\n };\n\n-#define ETHERADDR_VALID_STRS_SIZE \\\n-\t(sizeof(ether_addr_valid_strs) / sizeof(ether_addr_valid_strs[0]))\n-#define ETHERADDR_GARBAGE_STRS_SIZE \\\n-\t(sizeof(ether_addr_garbage_strs) / sizeof(ether_addr_garbage_strs[0]))\n-#define ETHERADDR_INVALID_STRS_SIZE \\\n-\t(sizeof(ether_addr_invalid_strs) / sizeof(ether_addr_invalid_strs[0]))\n-\n+#define ETHERADDR_VALID_STRS_SIZE RTE_DIM(ether_addr_valid_strs)\n+#define ETHERADDR_GARBAGE_STRS_SIZE RTE_DIM(ether_addr_garbage_strs)\n+#define ETHERADDR_INVALID_STRS_SIZE RTE_DIM(ether_addr_invalid_strs)\n\n\n static int\ndiff --git a/app/test/test_cmdline_ipaddr.c b/app/test/test_cmdline_ipaddr.c\nindex 2d11ce936..0c90162e8 100644\n--- a/app/test/test_cmdline_ipaddr.c\n+++ b/app/test/test_cmdline_ipaddr.c\n@@ -264,18 +264,12 @@ const char * ipaddr_invalid_strs[] = {\n \t\t\" \",\n };\n\n-#define IPADDR_VALID_STRS_SIZE \\\n-\t(sizeof(ipaddr_valid_strs) / sizeof(ipaddr_valid_strs[0]))\n-#define IPADDR_GARBAGE_ADDR4_STRS_SIZE \\\n-\t(sizeof(ipaddr_garbage_addr4_strs) / sizeof(ipaddr_garbage_addr4_strs[0]))\n-#define IPADDR_GARBAGE_ADDR6_STRS_SIZE \\\n-\t(sizeof(ipaddr_garbage_addr6_strs) / sizeof(ipaddr_garbage_addr6_strs[0]))\n-#define IPADDR_GARBAGE_NETWORK4_STRS_SIZE \\\n-\t(sizeof(ipaddr_garbage_network4_strs) / sizeof(ipaddr_garbage_network4_strs[0]))\n-#define IPADDR_GARBAGE_NETWORK6_STRS_SIZE \\\n-\t(sizeof(ipaddr_garbage_network6_strs) / sizeof(ipaddr_garbage_network6_strs[0]))\n-#define IPADDR_INVALID_STRS_SIZE \\\n-\t(sizeof(ipaddr_invalid_strs) / sizeof(ipaddr_invalid_strs[0]))\n+#define IPADDR_VALID_STRS_SIZE RTE_DIM(ipaddr_valid_strs)\n+#define IPADDR_GARBAGE_ADDR4_STRS_SIZE RTE_DIM(ipaddr_garbage_addr4_strs)\n+#define IPADDR_GARBAGE_ADDR6_STRS_SIZE RTE_DIM(ipaddr_garbage_addr6_strs)\n+#define IPADDR_GARBAGE_NETWORK4_STRS_SIZE RTE_DIM(ipaddr_garbage_network4_strs)\n+#define IPADDR_GARBAGE_NETWORK6_STRS_SIZE RTE_DIM(ipaddr_garbage_network6_strs)\n+#define IPADDR_INVALID_STRS_SIZE RTE_DIM(ipaddr_invalid_strs)\n\n static void\n dump_addr(cmdline_ipaddr_t addr)\ndiff --git a/app/test/test_cmdline_num.c b/app/test/test_cmdline_num.c\nindex 4c97caf3d..1daeaf840 100644\n--- a/app/test/test_cmdline_num.c\n+++ b/app/test/test_cmdline_num.c\n@@ -216,17 +216,11 @@ const char * num_invalid_strs[] = {\n \t\t\"\\0\",\n };\n\n-#define NUM_POSITIVE_STRS_SIZE \\\n-\t(sizeof(num_valid_positive_strs) / sizeof(num_valid_positive_strs[0]))\n-#define NUM_NEGATIVE_STRS_SIZE \\\n-\t(sizeof(num_valid_negative_strs) / sizeof(num_valid_negative_strs[0]))\n-#define NUM_POSITIVE_GARBAGE_STRS_SIZE \\\n-\t(sizeof(num_garbage_positive_strs) / sizeof(num_garbage_positive_strs[0]))\n-#define NUM_NEGATIVE_GARBAGE_STRS_SIZE \\\n-\t(sizeof(num_garbage_negative_strs) / sizeof(num_garbage_negative_strs[0]))\n-#define NUM_INVALID_STRS_SIZE \\\n-\t(sizeof(num_invalid_strs) / sizeof(num_invalid_strs[0]))\n-\n+#define NUM_POSITIVE_STRS_SIZE RTE_DIM(num_valid_positive_strs)\n+#define NUM_NEGATIVE_STRS_SIZE RTE_DIM(num_valid_negative_strs)\n+#define NUM_POSITIVE_GARBAGE_STRS_SIZE RTE_DIM(num_garbage_positive_strs)\n+#define NUM_NEGATIVE_GARBAGE_STRS_SIZE RTE_DIM(num_garbage_negative_strs)\n+#define NUM_INVALID_STRS_SIZE RTE_DIM(num_invalid_strs)\n\n\n static int\ndiff --git a/app/test/test_cmdline_portlist.c b/app/test/test_cmdline_portlist.c\nindex 0dc6d0030..851215377 100644\n--- a/app/test/test_cmdline_portlist.c\n+++ b/app/test/test_cmdline_portlist.c\n@@ -6,6 +6,7 @@\n #include <string.h>\n #include <inttypes.h>\n\n+#include <rte_common.h>\n #include <cmdline_parse.h>\n #include <cmdline_parse_portlist.h>\n\n@@ -88,14 +89,9 @@ const char * portlist_invalid_strs[] = {\n \t\t\"0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,2\",\n };\n\n-#define PORTLIST_VALID_STRS_SIZE \\\n-\t(sizeof(portlist_valid_strs) / sizeof(portlist_valid_strs[0]))\n-#define PORTLIST_GARBAGE_STRS_SIZE \\\n-\t(sizeof(portlist_garbage_strs) / sizeof(portlist_garbage_strs[0]))\n-#define PORTLIST_INVALID_STRS_SIZE \\\n-\t(sizeof(portlist_invalid_strs) / sizeof(portlist_invalid_strs[0]))\n-\n-\n+#define PORTLIST_VALID_STRS_SIZE RTE_DIM(portlist_valid_strs)\n+#define PORTLIST_GARBAGE_STRS_SIZE RTE_DIM(portlist_garbage_strs)\n+#define PORTLIST_INVALID_STRS_SIZE RTE_DIM(portlist_invalid_strs)\n\n\n /* test invalid parameters */\ndiff --git a/app/test/test_cmdline_string.c b/app/test/test_cmdline_string.c\nindex 0461a85bb..f6ac76fc9 100644\n--- a/app/test/test_cmdline_string.c\n+++ b/app/test/test_cmdline_string.c\n@@ -115,16 +115,11 @@ const char * string_help_strs[] = {\n\n\n\n-#define STRING_PARSE_STRS_SIZE \\\n-\t(sizeof(string_parse_strs) / sizeof(string_parse_strs[0]))\n-#define STRING_HELP_STRS_SIZE \\\n-\t(sizeof(string_help_strs) / sizeof(string_help_strs[0]))\n-#define STRING_ELT_STRS_SIZE \\\n-\t(sizeof(string_elt_strs) / sizeof(string_elt_strs[0]))\n-#define STRING_NB_STRS_SIZE \\\n-\t(sizeof(string_nb_strs) / sizeof(string_nb_strs[0]))\n-#define STRING_INVALID_STRS_SIZE \\\n-\t(sizeof(string_invalid_strs) / sizeof(string_invalid_strs[0]))\n+#define STRING_PARSE_STRS_SIZE RTE_DIM(string_parse_strs)\n+#define STRING_HELP_STRS_SIZE RTE_DIM(string_help_strs)\n+#define STRING_ELT_STRS_SIZE RTE_DIM(string_elt_strs)\n+#define STRING_NB_STRS_SIZE RTE_DIM(string_nb_strs)\n+#define STRING_INVALID_STRS_SIZE RTE_DIM(string_invalid_strs)\n\n #define SMALL_BUF 8\n\ndiff --git a/app/test/test_debug.c b/app/test/test_debug.c\nindex faf2cf557..25eab97e2 100644\n--- a/app/test/test_debug.c\n+++ b/app/test/test_debug.c\n@@ -81,7 +81,7 @@ test_exit(void)\n {\n \tint test_vals[] = { 0, 1, 2, 255, -1 };\n \tunsigned i;\n-\tfor (i = 0; i < sizeof(test_vals) / sizeof(test_vals[0]); i++){\n+\tfor (i = 0; i < RTE_DIM(test_vals); i++) {\n \t\tif (test_exit_val(test_vals[i]) < 0)\n \t\t\treturn -1;\n \t}\ndiff --git a/app/test/test_eal_flags.c b/app/test/test_eal_flags.c\nindex 5b2c0f5cd..4ee809e3d 100644\n--- a/app/test/test_eal_flags.c\n+++ b/app/test/test_eal_flags.c\n@@ -36,8 +36,7 @@\n #define memtest1 \"memtest1\"\n #define memtest2 \"memtest2\"\n #define SOCKET_MEM_STRLEN (RTE_MAX_NUMA_NODES * 20)\n-#define launch_proc(ARGV) process_dup(ARGV, \\\n-\t\tsizeof(ARGV)/(sizeof(ARGV[0])), __func__)\n+#define launch_proc(ARGV) process_dup(ARGV, RTE_DIM(ARGV), __func__)\n\n enum hugepage_action {\n \tHUGEPAGE_CHECK_EXISTS = 0,\n@@ -268,7 +267,7 @@ test_whitelist_flag(void)\n \t\t\tpci_whitelist, \"08:00.1,type=normal\",\n \t};\n\n-\tfor (i = 0; i < sizeof(wlinval) / sizeof(wlinval[0]); i++) {\n+\tfor (i = 0; i < RTE_DIM(wlinval); i++) {\n \t\tif (launch_proc(wlinval[i]) == 0) {\n \t\t\tprintf(\"Error - process did run ok with invalid \"\n \t\t\t    \"whitelist parameter\\n\");\n@@ -324,7 +323,7 @@ test_invalid_b_flag(void)\n\n \tint i;\n\n-\tfor (i = 0; i != sizeof (blinval) / sizeof (blinval[0]); i++) {\n+\tfor (i = 0; i != RTE_DIM(blinval); i++) {\n \t\tif (launch_proc(blinval[i]) == 0) {\n \t\t\tprintf(\"Error - process did run ok with invalid \"\n \t\t\t    \"blacklist parameter\\n\");\n@@ -425,7 +424,7 @@ test_invalid_r_flag(void)\n\n \tint i;\n\n-\tfor (i = 0; i != sizeof (rinval) / sizeof (rinval[0]); i++) {\n+\tfor (i = 0; i != RTE_DIM(rinval); i++) {\n \t\tif (launch_proc(rinval[i]) == 0) {\n \t\t\tprintf(\"Error - process did run ok with invalid \"\n \t\t\t    \"-r (rank) parameter\\n\");\ndiff --git a/app/test/test_errno.c b/app/test/test_errno.c\nindex 7df8192d5..3ff0456a5 100644\n--- a/app/test/test_errno.c\n+++ b/app/test/test_errno.c\n@@ -36,7 +36,7 @@ test_errno(void)\n \tif (rte_errno != 0)\n \t\treturn -1;\n \t/* check for standard errors we return the same as libc */\n-\tfor (i = 0; i < sizeof(std_errs)/sizeof(std_errs[0]); i++){\n+\tfor (i = 0; i < RTE_DIM(std_errs); i++) {\n \t\trte_retval = rte_strerror(std_errs[i]);\n \t\tlibc_retval = strerror(std_errs[i]);\n \t\tprintf(\"rte_strerror: '%s', strerror: '%s'\\n\",\n@@ -47,7 +47,7 @@ test_errno(void)\n \t/* for rte-specific errors ensure we return a different string\n \t * and that the string for libc is for an unknown error\n \t */\n-\tfor (i = 0; i < sizeof(rte_errs)/sizeof(rte_errs[0]); i++){\n+\tfor (i = 0; i < RTE_DIM(rte_errs); i++) {\n \t\trte_retval = rte_strerror(rte_errs[i]);\n \t\tlibc_retval = strerror(rte_errs[i]);\n \t\tprintf(\"rte_strerror: '%s', strerror: '%s'\\n\",\ndiff --git a/app/test/test_lpm.c b/app/test/test_lpm.c\nindex e969fe051..68f000c1b 100644\n--- a/app/test/test_lpm.c\n+++ b/app/test/test_lpm.c\n@@ -64,7 +64,7 @@ rte_lpm_test tests[] = {\n \ttest18\n };\n\n-#define NUM_LPM_TESTS (sizeof(tests)/sizeof(tests[0]))\n+#define NUM_LPM_TESTS RTE_DIM(tests)\n #define MAX_DEPTH 32\n #define MAX_RULES 256\n #define NUMBER_TBL8S 256\ndiff --git a/app/test/test_lpm6.c b/app/test/test_lpm6.c\nindex 670aadb40..1df4af257 100644\n--- a/app/test/test_lpm6.c\n+++ b/app/test/test_lpm6.c\n@@ -85,7 +85,7 @@ rte_lpm6_test tests6[] = {\n \ttest28,\n };\n\n-#define NUM_LPM6_TESTS                (sizeof(tests6)/sizeof(tests6[0]))\n+#define NUM_LPM6_TESTS                                   RTE_DIM(tests6)\n #define MAX_DEPTH                                                    128\n #define MAX_RULES                                                1000000\n #define NUMBER_TBL8S                                           (1 << 16)\ndiff --git a/app/test/test_lpm6_data.h b/app/test/test_lpm6_data.h\nindex 565138a31..c3894f730 100644\n--- a/app/test/test_lpm6_data.h\n+++ b/app/test/test_lpm6_data.h\n@@ -1029,8 +1029,7 @@ static struct rules_tbl_entry large_route_table[] = {\n \t{{234, 149, 220, 106, 0, 144, 214, 128, 35, 102, 0, 0, 0, 0, 0, 0}, 79, 106},\n };\n\n-#define  NUM_ROUTE_ENTRIES \\\n-\t(sizeof(large_route_table) / sizeof(large_route_table[0]))\n+#define  NUM_ROUTE_ENTRIES RTE_DIM(large_route_table)\n\n #define  NUM_IPS_ENTRIES (NUM_ROUTE_ENTRIES * 100)\n\ndiff --git a/app/test/test_malloc.c b/app/test/test_malloc.c\nindex a16e28cc3..67a48ba38 100644\n--- a/app/test/test_malloc.c\n+++ b/app/test/test_malloc.c\n@@ -255,7 +255,7 @@ test_str_to_size(void)\n \t\t\t{\"18446744073709551616\", 0} /* ULLONG_MAX + 1 == out of range*/\n \t};\n \tunsigned i;\n-\tfor (i = 0; i < sizeof(test_values)/sizeof(test_values[0]); i++)\n+\tfor (i = 0; i < RTE_DIM(test_values); i++)\n \t\tif (rte_str_to_size(test_values[i].str) != test_values[i].value)\n \t\t\treturn -1;\n \treturn 0;\ndiff --git a/app/test/test_memcpy.c b/app/test/test_memcpy.c\nindex 2c69ad964..53eb8433a 100644\n--- a/app/test/test_memcpy.c\n+++ b/app/test/test_memcpy.c\n@@ -103,7 +103,7 @@ static int\n func_test(void)\n {\n \tunsigned int off_src, off_dst, i;\n-\tunsigned int num_buf_sizes = sizeof(buf_sizes) / sizeof(buf_sizes[0]);\n+\tunsigned int num_buf_sizes = RTE_DIM(buf_sizes);\n \tint ret;\n\n \tfor (off_src = 0; off_src < ALIGNMENT_UNIT; off_src++) {\ndiff --git a/app/test/test_memcpy_perf.c b/app/test/test_memcpy_perf.c\nindex 6f436f3ef..8f06b0f1e 100644\n--- a/app/test/test_memcpy_perf.c\n+++ b/app/test/test_memcpy_perf.c\n@@ -250,7 +250,7 @@ perf_test_constant_unaligned(void)\n static inline void\n perf_test_variable_aligned(void)\n {\n-\tunsigned n = sizeof(buf_sizes) / sizeof(buf_sizes[0]);\n+\tunsigned n = RTE_DIM(buf_sizes);\n \tunsigned i;\n \tfor (i = 0; i < n; i++) {\n \t\tALL_PERF_TESTS_FOR_SIZE((size_t)buf_sizes[i]);\n@@ -261,7 +261,7 @@ perf_test_variable_aligned(void)\n static inline void\n perf_test_variable_unaligned(void)\n {\n-\tunsigned n = sizeof(buf_sizes) / sizeof(buf_sizes[0]);\n+\tunsigned n = RTE_DIM(buf_sizes);\n \tunsigned i;\n \tfor (i = 0; i < n; i++) {\n \t\tALL_PERF_TESTS_FOR_SIZE_UNALIGNED((size_t)buf_sizes[i]);\ndiff --git a/app/test/test_mp_secondary.c b/app/test/test_mp_secondary.c\nindex 2ac33f781..ac15ddbf2 100644\n--- a/app/test/test_mp_secondary.c\n+++ b/app/test/test_mp_secondary.c\n@@ -47,8 +47,7 @@\n\n #include \"process.h\"\n\n-#define launch_proc(ARGV) process_dup(ARGV, \\\n-\t\tsizeof(ARGV)/(sizeof(ARGV[0])), __func__)\n+#define launch_proc(ARGV) process_dup(ARGV, RTE_DIM(ARGV), __func__)\n\n /*\n  * This function is called in the primary i.e. main test, to spawn off secondary\ndiff --git a/app/test/test_pdump.c b/app/test/test_pdump.c\nindex af206968b..ad183184c 100644\n--- a/app/test/test_pdump.c\n+++ b/app/test/test_pdump.c\n@@ -18,8 +18,7 @@\n #include \"process.h\"\n #include \"test_pdump.h\"\n\n-#define launch_p(ARGV) process_dup(ARGV, \\\n-\t\tsizeof(ARGV)/(sizeof(ARGV[0])), __func__)\n+#define launch_p(ARGV) process_dup(ARGV, RTE_DIM(ARGV), __func__)\n\n struct rte_ring *ring_server;\n uint16_t portid;\ndiff --git a/app/test/test_pmd_ring_perf.c b/app/test/test_pmd_ring_perf.c\nindex 6318da18f..3b2ff9cb4 100644\n--- a/app/test/test_pmd_ring_perf.c\n+++ b/app/test/test_pmd_ring_perf.c\n@@ -100,7 +100,7 @@ test_bulk_enqueue_dequeue(void)\n \tunsigned sz, i = 0;\n \tstruct rte_mbuf *burst[MAX_BURST] = {0};\n\n-\tfor (sz = 0; sz < sizeof(bulk_sizes)/sizeof(bulk_sizes[0]); sz++) {\n+\tfor (sz = 0; sz < RTE_DIM(bulk_sizes); sz++) {\n \t\tconst uint64_t sc_start = rte_rdtsc();\n \t\tfor (i = 0; i < iterations; i++) {\n \t\t\trte_ring_sp_enqueue_bulk(r, (void *)burst,\ndiff --git a/app/test/test_ring_perf.c b/app/test/test_ring_perf.c\nindex 70ee46ffe..f2accb8a0 100644\n--- a/app/test/test_ring_perf.c\n+++ b/app/test/test_ring_perf.c\n@@ -240,7 +240,7 @@ run_on_core_pair(struct lcore_pair *cores, struct rte_ring *r,\n {\n \tstruct thread_params param1 = {0}, param2 = {0};\n \tunsigned i;\n-\tfor (i = 0; i < sizeof(bulk_sizes)/sizeof(bulk_sizes[0]); i++) {\n+\tfor (i = 0; i < RTE_DIM(bulk_sizes); i++) {\n \t\tlcore_count = 0;\n \t\tparam1.size = param2.size = bulk_sizes[i];\n \t\tparam1.r = param2.r = r;\n@@ -376,7 +376,7 @@ test_burst_enqueue_dequeue(struct rte_ring *r)\n \tunsigned sz, i = 0;\n \tvoid *burst[MAX_BURST] = {0};\n\n-\tfor (sz = 0; sz < sizeof(bulk_sizes)/sizeof(bulk_sizes[0]); sz++) {\n+\tfor (sz = 0; sz < RTE_DIM(bulk_sizes); sz++) {\n \t\tconst uint64_t sc_start = rte_rdtsc();\n \t\tfor (i = 0; i < iterations; i++) {\n \t\t\trte_ring_sp_enqueue_burst(r, burst,\n@@ -414,7 +414,7 @@ test_bulk_enqueue_dequeue(struct rte_ring *r)\n \tunsigned sz, i = 0;\n \tvoid *burst[MAX_BURST] = {0};\n\n-\tfor (sz = 0; sz < sizeof(bulk_sizes)/sizeof(bulk_sizes[0]); sz++) {\n+\tfor (sz = 0; sz < RTE_DIM(bulk_sizes); sz++) {\n \t\tconst uint64_t sc_start = rte_rdtsc();\n \t\tfor (i = 0; i < iterations; i++) {\n \t\t\trte_ring_sp_enqueue_bulk(r, burst,\ndiff --git a/app/test/test_timer_secondary.c b/app/test/test_timer_secondary.c\nindex 790f18052..7a3bc873b 100644\n--- a/app/test/test_timer_secondary.c\n+++ b/app/test/test_timer_secondary.c\n@@ -23,8 +23,7 @@\n #define TEST_INFO_MZ_NAME\t\"test_timer_info_mz\"\n #define MSECPERSEC\t\t1E3\n\n-#define launch_proc(ARGV) \\\n-\tprocess_dup(ARGV, sizeof(ARGV)/(sizeof(ARGV[0])), __func__)\n+#define launch_proc(ARGV) process_dup(ARGV, RTE_DIM(ARGV), __func__)\n\n struct test_info {\n \tunsigned int mstr_lcore;\n",
    "prefixes": [
        "1/3"
    ]
}