get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 135017,
    "url": "http://patches.dpdk.org/api/patches/135017/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20231211095110.18946-13-fengchengwen@huawei.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": "<20231211095110.18946-13-fengchengwen@huawei.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20231211095110.18946-13-fengchengwen@huawei.com",
    "date": "2023-12-11T09:51:10",
    "name": "[RFC,v3,12/12] examples/dma: replace getopt with argparse",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "55b5c20f4729b7bdb93c2f4b6fcfa50c8bcbff67",
    "submitter": {
        "id": 2146,
        "url": "http://patches.dpdk.org/api/people/2146/?format=api",
        "name": "fengchengwen",
        "email": "fengchengwen@huawei.com"
    },
    "delegate": null,
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20231211095110.18946-13-fengchengwen@huawei.com/mbox/",
    "series": [
        {
            "id": 30506,
            "url": "http://patches.dpdk.org/api/series/30506/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=30506",
            "date": "2023-12-11T09:50:58",
            "name": "add argparse library",
            "version": 3,
            "mbox": "http://patches.dpdk.org/series/30506/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/135017/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/135017/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 2DACE436C8;\n\tMon, 11 Dec 2023 10:55:38 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 52126427E5;\n\tMon, 11 Dec 2023 10:54:39 +0100 (CET)",
            "from szxga06-in.huawei.com (szxga06-in.huawei.com [45.249.212.32])\n by mails.dpdk.org (Postfix) with ESMTP id D24FB40ED6\n for <dev@dpdk.org>; Mon, 11 Dec 2023 10:54:24 +0100 (CET)",
            "from mail.maildlp.com (unknown [172.19.162.112])\n by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4SpcXX5Lxcz1vnjf;\n Mon, 11 Dec 2023 17:54:20 +0800 (CST)",
            "from dggpeml500024.china.huawei.com (unknown [7.185.36.10])\n by mail.maildlp.com (Postfix) with ESMTPS id C916B1400D4;\n Mon, 11 Dec 2023 17:54:23 +0800 (CST)",
            "from localhost.localdomain (10.50.165.33) by\n dggpeml500024.china.huawei.com (7.185.36.10) with Microsoft SMTP Server\n (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id\n 15.1.2507.35; Mon, 11 Dec 2023 17:54:23 +0800"
        ],
        "From": "Chengwen Feng <fengchengwen@huawei.com>",
        "To": "<dev@dpdk.org>, <thomas@monjalon.net>, <ferruh.yigit@amd.com>,\n <stephen@networkplumber.org>",
        "CC": "<tangkunshan@huawei.com>",
        "Subject": "[RFC v3 12/12] examples/dma: replace getopt with argparse",
        "Date": "Mon, 11 Dec 2023 09:51:10 +0000",
        "Message-ID": "<20231211095110.18946-13-fengchengwen@huawei.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20231211095110.18946-1-fengchengwen@huawei.com>",
        "References": "<20231121122651.7078-1-fengchengwen@huawei.com>\n <20231211095110.18946-1-fengchengwen@huawei.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain",
        "X-Originating-IP": "[10.50.165.33]",
        "X-ClientProxiedBy": "dggems703-chm.china.huawei.com (10.3.19.180) To\n dggpeml500024.china.huawei.com (7.185.36.10)",
        "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": "Replace getopt with argparse.\n\nSigned-off-by: Chengwen Feng <fengchengwen@huawei.com>\n---\n examples/dma/dmafwd.c    | 279 ++++++++++++++++++---------------------\n examples/dma/meson.build |   2 +-\n 2 files changed, 127 insertions(+), 154 deletions(-)",
    "diff": "diff --git a/examples/dma/dmafwd.c b/examples/dma/dmafwd.c\nindex f27317a622..4cc0913240 100644\n--- a/examples/dma/dmafwd.c\n+++ b/examples/dma/dmafwd.c\n@@ -4,11 +4,11 @@\n \n #include <stdint.h>\n #include <stdlib.h>\n-#include <getopt.h>\n #include <signal.h>\n #include <stdbool.h>\n #include <unistd.h>\n \n+#include <rte_argparse.h>\n #include <rte_malloc.h>\n #include <rte_ethdev.h>\n #include <rte_dmadev.h>\n@@ -18,16 +18,18 @@\n #define MAX_PKT_BURST 32\n #define MEMPOOL_CACHE_SIZE 512\n #define MIN_POOL_SIZE 65536U\n-#define CMD_LINE_OPT_MAC_UPDATING \"mac-updating\"\n-#define CMD_LINE_OPT_NO_MAC_UPDATING \"no-mac-updating\"\n-#define CMD_LINE_OPT_PORTMASK \"portmask\"\n-#define CMD_LINE_OPT_NB_QUEUE \"nb-queue\"\n-#define CMD_LINE_OPT_COPY_TYPE \"copy-type\"\n-#define CMD_LINE_OPT_RING_SIZE \"ring-size\"\n-#define CMD_LINE_OPT_BATCH_SIZE \"dma-batch-size\"\n-#define CMD_LINE_OPT_FRAME_SIZE \"max-frame-size\"\n-#define CMD_LINE_OPT_FORCE_COPY_SIZE \"force-min-copy-size\"\n-#define CMD_LINE_OPT_STATS_INTERVAL \"stats-interval\"\n+#define CMD_LINE_OPT_MAC_UPDATING \"--mac-updating\"\n+#define CMD_LINE_OPT_NO_MAC_UPDATING \"--no-mac-updating\"\n+#define CMD_LINE_OPT_PORTMASK \"--portmask\"\n+#define CMD_LINE_OPT_PORTMASK_INDEX 1\n+#define CMD_LINE_OPT_NB_QUEUE \"--nb-queue\"\n+#define CMD_LINE_OPT_COPY_TYPE \"--copy-type\"\n+#define CMD_LINE_OPT_COPY_TYPE_INDEX 2\n+#define CMD_LINE_OPT_RING_SIZE \"--ring-size\"\n+#define CMD_LINE_OPT_BATCH_SIZE \"--dma-batch-size\"\n+#define CMD_LINE_OPT_FRAME_SIZE \"--max-frame-size\"\n+#define CMD_LINE_OPT_FORCE_COPY_SIZE \"--force-min-copy-size\"\n+#define CMD_LINE_OPT_STATS_INTERVAL \"--stats-interval\"\n \n /* configurable number of RX/TX ring descriptors */\n #define RX_DEFAULT_RINGSIZE 1024\n@@ -95,10 +97,10 @@ static copy_mode_t copy_mode = COPY_MODE_DMA_NUM;\n /* size of descriptor ring for hardware copy mode or\n  * rte_ring for software copy mode\n  */\n-static unsigned short ring_size = 2048;\n+static uint16_t ring_size = 2048;\n \n /* interval, in seconds, between stats prints */\n-static unsigned short stats_interval = 1;\n+static uint16_t stats_interval = 1;\n /* global mbuf arrays for tracking DMA bufs */\n #define MBUF_RING_SIZE\t2048\n #define MBUF_RING_MASK\t(MBUF_RING_SIZE - 1)\n@@ -583,26 +585,6 @@ static void start_forwarding_cores(void)\n }\n /* >8 End of starting to process for each lcore. */\n \n-/* Display usage */\n-static void\n-dma_usage(const char *prgname)\n-{\n-\tprintf(\"%s [EAL options] -- -p PORTMASK [-q NQ]\\n\"\n-\t\t\"  -b --dma-batch-size: number of requests per DMA batch\\n\"\n-\t\t\"  -f --max-frame-size: max frame size\\n\"\n-\t\t\"  -m --force-min-copy-size: force a minimum copy length, even for smaller packets\\n\"\n-\t\t\"  -p --portmask: hexadecimal bitmask of ports to configure\\n\"\n-\t\t\"  -q NQ: number of RX queues per port (default is 1)\\n\"\n-\t\t\"  --[no-]mac-updating: Enable or disable MAC addresses updating (enabled by default)\\n\"\n-\t\t\"      When enabled:\\n\"\n-\t\t\"       - The source MAC address is replaced by the TX port MAC address\\n\"\n-\t\t\"       - The destination MAC address is replaced by 02:00:00:00:00:TX_PORT_ID\\n\"\n-\t\t\"  -c --copy-type CT: type of copy: sw|hw\\n\"\n-\t\t\"  -s --ring-size RS: size of dmadev descriptor ring for hardware copy mode or rte_ring for software copy mode\\n\"\n-\t\t\"  -i --stats-interval SI: interval, in seconds, between stats prints (default is 1)\\n\",\n-\t\t\tprgname);\n-}\n-\n static int\n dma_parse_portmask(const char *portmask)\n {\n@@ -628,142 +610,133 @@ dma_parse_copy_mode(const char *copy_mode)\n \treturn COPY_MODE_INVALID_NUM;\n }\n \n+static int\n+dma_parse_args_cb(uint32_t index, const char *value, void *opaque)\n+{\n+\tint port_mask;\n+\n+\tRTE_SET_USED(opaque);\n+\n+\tif (index == CMD_LINE_OPT_PORTMASK_INDEX) {\n+\t\tport_mask = dma_parse_portmask(value);\n+\t\tif (port_mask & ~dma_enabled_port_mask || port_mask <= 0) {\n+\t\t\tprintf(\"Invalid portmask, %s, suggest 0x%x\\n\",\n+\t\t\t\t\tvalue, dma_enabled_port_mask);\n+\t\t\treturn -1;\n+\t\t}\n+\t\tdma_enabled_port_mask = port_mask;\n+\t} else if (index == CMD_LINE_OPT_COPY_TYPE_INDEX) {\n+\t\tcopy_mode = dma_parse_copy_mode(value);\n+\t\tif (copy_mode == COPY_MODE_INVALID_NUM) {\n+\t\t\tprintf(\"Invalid copy type. Use: sw, hw\\n\");\n+\t\t\treturn -1;\n+\t\t}\n+\t} else {\n+\t\tprintf(\"Invalid index %u\\n\", index);\n+\t\treturn -1;\n+\t}\n+\n+\treturn 0;\n+}\n+\n /* Parse the argument given in the command line of the application */\n static int\n dma_parse_args(int argc, char **argv, unsigned int nb_ports)\n {\n-\tstatic const char short_options[] =\n-\t\t\"b:\"  /* dma batch size */\n-\t\t\"c:\"  /* copy type (sw|hw) */\n-\t\t\"f:\"  /* max frame size */\n-\t\t\"m:\"  /* force min copy size */\n-\t\t\"p:\"  /* portmask */\n-\t\t\"q:\"  /* number of RX queues per port */\n-\t\t\"s:\"  /* ring size */\n-\t\t\"i:\"  /* interval, in seconds, between stats prints */\n-\t\t;\n-\n-\tstatic const struct option lgopts[] = {\n-\t\t{CMD_LINE_OPT_MAC_UPDATING, no_argument, &mac_updating, 1},\n-\t\t{CMD_LINE_OPT_NO_MAC_UPDATING, no_argument, &mac_updating, 0},\n-\t\t{CMD_LINE_OPT_PORTMASK, required_argument, NULL, 'p'},\n-\t\t{CMD_LINE_OPT_NB_QUEUE, required_argument, NULL, 'q'},\n-\t\t{CMD_LINE_OPT_COPY_TYPE, required_argument, NULL, 'c'},\n-\t\t{CMD_LINE_OPT_RING_SIZE, required_argument, NULL, 's'},\n-\t\t{CMD_LINE_OPT_BATCH_SIZE, required_argument, NULL, 'b'},\n-\t\t{CMD_LINE_OPT_FRAME_SIZE, required_argument, NULL, 'f'},\n-\t\t{CMD_LINE_OPT_FORCE_COPY_SIZE, required_argument, NULL, 'm'},\n-\t\t{CMD_LINE_OPT_STATS_INTERVAL, required_argument, NULL, 'i'},\n-\t\t{NULL, 0, 0, 0}\n+\tstatic struct rte_argparse obj = {\n+\t\t.prog_name = \"dma\",\n+\t\t.usage = \"[EAL options] -- [optional parameters]\",\n+\t\t.descriptor = NULL,\n+\t\t.epilog = NULL,\n+\t\t.exit_on_error = false,\n+\t\t.callback = dma_parse_args_cb,\n+\t\t.opaque = NULL,\n+\t\t.args = {\n+\t\t\t{ CMD_LINE_OPT_MAC_UPDATING, NULL, \"Enable MAC addresses updating\",\n+\t\t\t  &mac_updating, (void *)1,\n+\t\t\t  RTE_ARGPARSE_ARG_NO_VALUE | RTE_ARGPARSE_ARG_VALUE_INT,\n+\t\t\t},\n+\t\t\t{ CMD_LINE_OPT_NO_MAC_UPDATING, NULL, \"Disable MAC addresses updating\",\n+\t\t\t  &mac_updating, (void *)0,\n+\t\t\t  RTE_ARGPARSE_ARG_NO_VALUE | RTE_ARGPARSE_ARG_VALUE_INT,\n+\t\t\t},\n+\t\t\t{ CMD_LINE_OPT_PORTMASK, \"-p\", \"hexadecimal bitmask of ports to configure\",\n+\t\t\t  NULL, (void *)CMD_LINE_OPT_PORTMASK_INDEX,\n+\t\t\t  RTE_ARGPARSE_ARG_REQUIRED_VALUE,\n+\t\t\t},\n+\t\t\t{ CMD_LINE_OPT_NB_QUEUE, \"-q\", \"number of RX queues per port (default is 1)\",\n+\t\t\t  &nb_queues, NULL,\n+\t\t\t  RTE_ARGPARSE_ARG_REQUIRED_VALUE | RTE_ARGPARSE_ARG_VALUE_U16,\n+\t\t\t},\n+\t\t\t{ CMD_LINE_OPT_COPY_TYPE, \"-c\", \"type of copy: sw|hw\",\n+\t\t\t  NULL, (void *)CMD_LINE_OPT_COPY_TYPE_INDEX,\n+\t\t\t  RTE_ARGPARSE_ARG_REQUIRED_VALUE,\n+\t\t\t},\n+\t\t\t{ CMD_LINE_OPT_RING_SIZE, \"-s\", \"size of dmadev descriptor ring for hardware copy mode or rte_ring for software copy mode\",\n+\t\t\t  &ring_size, NULL,\n+\t\t\t  RTE_ARGPARSE_ARG_REQUIRED_VALUE | RTE_ARGPARSE_ARG_VALUE_U16,\n+\t\t\t},\n+\t\t\t{ CMD_LINE_OPT_BATCH_SIZE, \"-b\", \"number of requests per DMA batch\",\n+\t\t\t  &dma_batch_sz, NULL,\n+\t\t\t  RTE_ARGPARSE_ARG_REQUIRED_VALUE | RTE_ARGPARSE_ARG_VALUE_U32,\n+\t\t\t},\n+\t\t\t{ CMD_LINE_OPT_FRAME_SIZE, \"-f\", \"max frame size\",\n+\t\t\t  &max_frame_size, NULL,\n+\t\t\t  RTE_ARGPARSE_ARG_REQUIRED_VALUE | RTE_ARGPARSE_ARG_VALUE_U32,\n+\t\t\t},\n+\t\t\t{ CMD_LINE_OPT_FORCE_COPY_SIZE, \"-m\", \"force a minimum copy length, even for smaller packets\",\n+\t\t\t  &force_min_copy_size, NULL,\n+\t\t\t  RTE_ARGPARSE_ARG_REQUIRED_VALUE | RTE_ARGPARSE_ARG_VALUE_U32,\n+\t\t\t},\n+\t\t\t{ CMD_LINE_OPT_STATS_INTERVAL, \"-i\", \"interval, in seconds, between stats prints (default is 1)\",\n+\t\t\t  &stats_interval, NULL,\n+\t\t\t  RTE_ARGPARSE_ARG_REQUIRED_VALUE | RTE_ARGPARSE_ARG_VALUE_U16,\n+\t\t\t},\n+\t\t\tARGPARSE_ARG_END(),\n+\t\t},\n \t};\n \n \tconst unsigned int default_port_mask = (1 << nb_ports) - 1;\n-\tint opt, ret;\n-\tchar **argvopt;\n-\tint option_index;\n-\tchar *prgname = argv[0];\n+\tint ret;\n \n \tdma_enabled_port_mask = default_port_mask;\n-\targvopt = argv;\n-\n-\twhile ((opt = getopt_long(argc, argvopt, short_options,\n-\t\t\tlgopts, &option_index)) != EOF) {\n-\n-\t\tswitch (opt) {\n-\t\tcase 'b':\n-\t\t\tdma_batch_sz = atoi(optarg);\n-\t\t\tif (dma_batch_sz > MAX_PKT_BURST) {\n-\t\t\t\tprintf(\"Invalid dma batch size, %s.\\n\", optarg);\n-\t\t\t\tdma_usage(prgname);\n-\t\t\t\treturn -1;\n-\t\t\t}\n-\t\t\tbreak;\n-\t\tcase 'f':\n-\t\t\tmax_frame_size = atoi(optarg);\n-\t\t\tif (max_frame_size > RTE_ETHER_MAX_JUMBO_FRAME_LEN) {\n-\t\t\t\tprintf(\"Invalid max frame size, %s.\\n\", optarg);\n-\t\t\t\tdma_usage(prgname);\n-\t\t\t\treturn -1;\n-\t\t\t}\n-\t\t\tbreak;\n-\n-\t\tcase 'm':\n-\t\t\tforce_min_copy_size = atoi(optarg);\n-\t\t\tbreak;\n-\n-\t\t/* portmask */\n-\t\tcase 'p':\n-\t\t\tdma_enabled_port_mask = dma_parse_portmask(optarg);\n-\t\t\tif (dma_enabled_port_mask & ~default_port_mask ||\n-\t\t\t\t\tdma_enabled_port_mask <= 0) {\n-\t\t\t\tprintf(\"Invalid portmask, %s, suggest 0x%x\\n\",\n-\t\t\t\t\t\toptarg, default_port_mask);\n-\t\t\t\tdma_usage(prgname);\n-\t\t\t\treturn -1;\n-\t\t\t}\n-\t\t\tbreak;\n-\n-\t\tcase 'q':\n-\t\t\tnb_queues = atoi(optarg);\n-\t\t\tif (nb_queues == 0 || nb_queues > MAX_RX_QUEUES_COUNT) {\n-\t\t\t\tprintf(\"Invalid RX queues number %s. Max %u\\n\",\n-\t\t\t\t\toptarg, MAX_RX_QUEUES_COUNT);\n-\t\t\t\tdma_usage(prgname);\n-\t\t\t\treturn -1;\n-\t\t\t}\n-\t\t\tbreak;\n-\n-\t\tcase 'c':\n-\t\t\tcopy_mode = dma_parse_copy_mode(optarg);\n-\t\t\tif (copy_mode == COPY_MODE_INVALID_NUM) {\n-\t\t\t\tprintf(\"Invalid copy type. Use: sw, hw\\n\");\n-\t\t\t\tdma_usage(prgname);\n-\t\t\t\treturn -1;\n-\t\t\t}\n-\t\t\tbreak;\n+\tret = rte_argparse_parse(&obj, argc, argv);\n+\tif (ret != 0)\n+\t\treturn ret;\n \n-\t\tcase 's':\n-\t\t\tring_size = atoi(optarg);\n-\t\t\tif (ring_size == 0) {\n-\t\t\t\tprintf(\"Invalid ring size, %s.\\n\", optarg);\n-\t\t\t\tdma_usage(prgname);\n-\t\t\t\treturn -1;\n-\t\t\t}\n-\t\t\t/* ring_size must be less-than or equal to MBUF_RING_SIZE\n-\t\t\t * to avoid overwriting bufs\n-\t\t\t */\n-\t\t\tif (ring_size > MBUF_RING_SIZE) {\n-\t\t\t\tprintf(\"Max ring_size is %d, setting ring_size to max\",\n-\t\t\t\t\t\tMBUF_RING_SIZE);\n-\t\t\t\tring_size = MBUF_RING_SIZE;\n-\t\t\t}\n-\t\t\tbreak;\n+\t/* check argument's value which parsing by autosave. */\n+\tif (dma_batch_sz <= 0 || dma_batch_sz > MAX_PKT_BURST) {\n+\t\tprintf(\"Invalid dma batch size, %d.\\n\", dma_batch_sz);\n+\t\treturn -1;\n+\t}\n \n-\t\tcase 'i':\n-\t\t\tstats_interval = atoi(optarg);\n-\t\t\tif (stats_interval == 0) {\n-\t\t\t\tprintf(\"Invalid stats interval, setting to 1\\n\");\n-\t\t\t\tstats_interval = 1;\t/* set to default */\n-\t\t\t}\n-\t\t\tbreak;\n+\tif (max_frame_size <= 0 || max_frame_size > RTE_ETHER_MAX_JUMBO_FRAME_LEN) {\n+\t\tprintf(\"Invalid max frame size, %d.\\n\", max_frame_size);\n+\t\treturn -1;\n+\t}\n \n-\t\t/* long options */\n-\t\tcase 0:\n-\t\t\tbreak;\n+\tif (nb_queues <= 0 || nb_queues > MAX_RX_QUEUES_COUNT) {\n+\t\tprintf(\"Invalid RX queues number %d. Max %u\\n\",\n+\t\t\tnb_queues, MAX_RX_QUEUES_COUNT);\n+\t\treturn -1;\n+\t}\n \n-\t\tdefault:\n-\t\t\tdma_usage(prgname);\n-\t\t\treturn -1;\n-\t\t}\n+\tif (ring_size <= 0) {\n+\t\tprintf(\"Invalid ring size, %d.\\n\", ring_size);\n+\t\treturn -1;\n+\t}\n+\tif (ring_size > MBUF_RING_SIZE) {\n+\t\tprintf(\"Max ring_size is %d, setting ring_size to max\",\n+\t\t\t\tMBUF_RING_SIZE);\n+\t\tring_size = MBUF_RING_SIZE;\n \t}\n \n-\tprintf(\"MAC updating %s\\n\", mac_updating ? \"enabled\" : \"disabled\");\n-\tif (optind >= 0)\n-\t\targv[optind - 1] = prgname;\n+\tif (stats_interval <= 0) {\n+\t\tprintf(\"Invalid stats interval, setting to 1\\n\");\n+\t\tstats_interval = 1;\t/* set to default */\n+\t}\n \n-\tret = optind - 1;\n-\toptind = 1; /* reset getopt lib */\n-\treturn ret;\n+\treturn 0;\n }\n \n /* check link status, return true if at least one port is up */\ndiff --git a/examples/dma/meson.build b/examples/dma/meson.build\nindex 9fdcad660e..124f9476fc 100644\n--- a/examples/dma/meson.build\n+++ b/examples/dma/meson.build\n@@ -8,7 +8,7 @@\n \n allow_experimental_apis = true\n \n-deps += ['dmadev']\n+deps += ['argparse', 'dmadev']\n \n sources = files(\n         'dmafwd.c',\n",
    "prefixes": [
        "RFC",
        "v3",
        "12/12"
    ]
}