get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 13106,
    "url": "http://patches.dpdk.org/api/patches/13106/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1464618804-78135-1-git-send-email-jasvinder.singh@intel.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": "<1464618804-78135-1-git-send-email-jasvinder.singh@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1464618804-78135-1-git-send-email-jasvinder.singh@intel.com",
    "date": "2016-05-30T14:33:24",
    "name": "[dpdk-dev,v4] ip_pipeline: configuration file parser cleanup",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "77bf3f58de67e71717bf9fa176371ee02fcc4ad4",
    "submitter": {
        "id": 285,
        "url": "http://patches.dpdk.org/api/people/285/?format=api",
        "name": "Jasvinder Singh",
        "email": "jasvinder.singh@intel.com"
    },
    "delegate": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1464618804-78135-1-git-send-email-jasvinder.singh@intel.com/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/13106/comments/",
    "check": "pending",
    "checks": "http://patches.dpdk.org/api/patches/13106/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 [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id D428A6CA6;\n\tMon, 30 May 2016 16:27:14 +0200 (CEST)",
            "from mga14.intel.com (mga14.intel.com [192.55.52.115])\n\tby dpdk.org (Postfix) with ESMTP id EE6226CA3\n\tfor <dev@dpdk.org>; Mon, 30 May 2016 16:27:12 +0200 (CEST)",
            "from orsmga002.jf.intel.com ([10.7.209.21])\n\tby fmsmga103.fm.intel.com with ESMTP; 30 May 2016 07:27:12 -0700",
            "from sie-lab-212-251.ir.intel.com (HELO\n\tsilpixa00381635.ir.intel.com) ([10.237.212.251])\n\tby orsmga002.jf.intel.com with ESMTP; 30 May 2016 07:27:10 -0700"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.26,390,1459839600\"; d=\"scan'208\";a=\"987479910\"",
        "From": "Jasvinder Singh <jasvinder.singh@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "cristian.dumitrescu@intel.com",
        "Date": "Mon, 30 May 2016 15:33:24 +0100",
        "Message-Id": "<1464618804-78135-1-git-send-email-jasvinder.singh@intel.com>",
        "X-Mailer": "git-send-email 2.5.5",
        "In-Reply-To": "<1462984560-239866-1-git-send-email-jasvinder.singh@intel.com>",
        "References": "<1462984560-239866-1-git-send-email-jasvinder.singh@intel.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=UTF-8",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH v4] ip_pipeline: configuration file parser cleanup",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "patches and discussions about DPDK <dev.dpdk.org>",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "This commit adds following changes to configuration file parsing of\nthe ip pipeline application;\n\n1. Parsing routines related to packet queues (pktq_in/out fields in the\nPIPELINE section) and message queues (msgq_in/out fields of in the MSGQ\nSection) are updated.\n\nIn the parsing routines, function \"strtok_r()\" is used for parsing the\nstring instead of manually checking the string termination, white\nspaces, tabs etc., between the string tokens. Each call to strtok_r()\nreturns a pointer to a null-terminated string containing the next token.\nIf no more tokens are found, strtok_r() returns NULL. As a result of\nusing strtok_r(), the code size of the parsing routines is reduced\nsignificantly.\n\n2. Replace PARSER_PARAM_ADD_CHECK macro by more specific macros such as\nPARSE_CHECK_DUPLICATE_SECTION, PARSE_CHECK_DUPLICATE_SECTION_EAL to detect\nduplicate entries in the various sections of the configuration file\n\n3. Add new macros PARSER_ERROR_NO_ELEMENTS and PARSE_ERROR_TOO_MANY_ELEMENTS\nfor detecting no element and more elements than allowed situations\nrespectively, in the section entry.\n\n4. Add new macros APP_PARAM_ADD_LINK_FOR_RXQ, APP_PARAM_ADD_LINK_FOR_TXQ\nand APP_PARAM_ADD_LINK_FOR_TM which add corresponding nic ports entry to\nthe application param structure while parsing rx/tx queues, TM (Traffic\nManager) port sections and pktq_in/out entries of pipeline sections\n\nSigned-off-by: Jasvinder Singh <jasvinder.singh@intel.com>\nAcked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>\n---\nv4\n- update the commit message\n- move APP_PARAM_ADD macro from app.h to config_parse.c as it is only used\n  by the routines defined in this file\n- remove extra newline character from error message display\n- rebased on top of ip_pipeline CLI patchset\n  (http://dpdk.org/dev/patchwork/patch/12911/) and NULL packet processing\n  fix patch (http://dpdk.org/dev/patchwork/patch/12807/)\n\nv3\n- add check on the number of pktq_in/out entries\n- add check on the number of msgq_in/out entries\n\nv2\n- update the commit message\n- change the local variable name from \"token\" to \"name\"\n\n examples/ip_pipeline/app.h          |  25 +-\n examples/ip_pipeline/config_parse.c | 472 +++++++++++++++---------------------\n 2 files changed, 196 insertions(+), 301 deletions(-)",
    "diff": "diff --git a/examples/ip_pipeline/app.h b/examples/ip_pipeline/app.h\nindex e775024..05d608b 100644\n--- a/examples/ip_pipeline/app.h\n+++ b/examples/ip_pipeline/app.h\n@@ -50,6 +50,7 @@\n \n #define APP_PARAM_NAME_SIZE                      PIPELINE_NAME_SIZE\n #define APP_LINK_PCI_BDF_SIZE                    16\n+\n struct app_mempool_params {\n \tchar *name;\n \tuint32_t parsed;\n@@ -370,6 +371,8 @@ struct app_eal_params {\n \t/* Support running on Xen dom0 without hugetlbfs */\n \tuint32_t xen_dom0_present;\n \tint xen_dom0;\n+\n+\tuint32_t parsed;\n };\n \n #ifndef APP_APPNAME_SIZE\n@@ -529,28 +532,6 @@ do\t\t\t\t\t\t\t\t\t\\\n \tsscanf(obj->name, prefix \"%\" SCNu32, &id);\t\t\t\t\\\n while (0)\t\t\t\t\t\t\t\t\\\n \n-#define APP_PARAM_ADD(obj_array, obj_name)\t\t\t\t\\\n-({\t\t\t\t\t\t\t\t\t\\\n-\tssize_t obj_idx;\t\t\t\t\t\t\\\n-\tconst ssize_t obj_count = RTE_DIM(obj_array);\t\t\t\\\n-\t\t\t\t\t\t\t\t\t\\\n-\tobj_idx = APP_PARAM_FIND(obj_array, obj_name);\t\t\t\\\n-\tif (obj_idx < 0) {\t\t\t\t\t\t\\\n-\t\tfor (obj_idx = 0; obj_idx < obj_count; obj_idx++) {\t\\\n-\t\t\tif (!APP_PARAM_VALID(&((obj_array)[obj_idx])))\t\\\n-\t\t\t\tbreak;\t\t\t\t\t\\\n-\t\t}\t\t\t\t\t\t\t\\\n-\t\t\t\t\t\t\t\t\t\\\n-\t\tif (obj_idx < obj_count) {\t\t\t\t\\\n-\t\t\t(obj_array)[obj_idx].name = strdup(obj_name);   \\\n-\t\t\tif ((obj_array)[obj_idx].name == NULL)          \\\n-\t\t\t\tobj_idx = -EINVAL;\t\t\t\\\n-\t\t} else\t\t\t\t\t\t\t\\\n-\t\t\tobj_idx = -ENOMEM;\t\t\t\t\\\n-\t}\t\t\t\t\t\t\t\t\\\n-\tobj_idx;\t\t\t\t\t\t\t\\\n-})\n-\n #define\tAPP_CHECK(exp, fmt, ...)\t\t\t\t\t\\\n do {\t\t\t\t\t\t\t\t\t\\\n \tif (!(exp)) {\t\t\t\t\t\t\t\\\ndiff --git a/examples/ip_pipeline/config_parse.c b/examples/ip_pipeline/config_parse.c\nindex 3951e1d..53130a0 100644\n--- a/examples/ip_pipeline/config_parse.c\n+++ b/examples/ip_pipeline/config_parse.c\n@@ -1,4 +1,4 @@\n-/*-\n+/*-\n  *   BSD LICENSE\n  *\n  *   Copyright(c) 2010-2016 Intel Corporation. All rights reserved.\n@@ -230,48 +230,122 @@ app_print_usage(char *prgname)\n \trte_exit(0, app_usage, prgname, app_params_default.config_file);\n }\n \n-#define PARSER_PARAM_ADD_CHECK(result, params_array, section_name)\t\\\n+#define APP_PARAM_ADD(set, key)\t\t\t\t\t\t\\\n+({\t\t\t\t\t\t\t\t\t\\\n+\tssize_t pos = APP_PARAM_FIND(set, key);\t\t\t\t\\\n+\tssize_t size = RTE_DIM(set);\t\t\t\t\t\\\n+\t\t\t\t\t\t\t\t\t\\\n+\tif (pos < 0) {\t\t\t\t\t\t\t\\\n+\t\tfor (pos = 0; pos < size; pos++) {\t\t\t\\\n+\t\t\tif (!APP_PARAM_VALID(&((set)[pos])))\t\t\\\n+\t\t\t\tbreak;\t\t\t\t\t\\\n+\t\t}\t\t\t\t\t\t\t\\\n+\t\t\t\t\t\t\t\t\t\\\n+\t\tAPP_CHECK((pos < size),\t\t\t\t\t\\\n+\t\t\t\"Parse error: size of %s is limited to %u elements\",\\\n+\t\t\t#set, (uint32_t) size);\t\t\t\t\\\n+\t\t\t\t\t\t\t\t\t\\\n+\t\t(set)[pos].name = strdup(key);\t\t\t\t\\\n+\t\tAPP_CHECK(((set)[pos].name),\t\t\t\t\\\n+\t\t\t\"Parse error: no free memory\");\t\t\t\\\n+\t}\t\t\t\t\t\t\t\t\\\n+\tpos;\t\t\t\t\t\t\t\t\\\n+})\n+\n+#define APP_PARAM_ADD_LINK_FOR_RXQ(app, rxq_name)\t\t\t\\\n+({\t\t\t\t\t\t\t\t\t\\\n+\tchar link_name[APP_PARAM_NAME_SIZE];\t\t\t\t\\\n+\tssize_t link_param_pos;\t\t\t\t\t\t\\\n+\tuint32_t link_id, queue_id;\t\t\t\t\\\n+\t\t\t\t\t\t\t\t\t\\\n+\tsscanf((rxq_name), \"RXQ%\" SCNu32 \".%\" SCNu32, &link_id, &queue_id);\\\n+\tsprintf(link_name, \"LINK%\" PRIu32, link_id);\t\t\t\\\n+\tlink_param_pos = APP_PARAM_ADD((app)->link_params, link_name);\t\\\n+\tlink_param_pos;\t\t\t\t\t\t\t\\\n+})\n+\n+#define APP_PARAM_ADD_LINK_FOR_TXQ(app, txq_name)\t\t\t\\\n+({\t\t\t\t\t\t\t\t\t\\\n+\tchar link_name[APP_PARAM_NAME_SIZE];\t\t\t\t\\\n+\tssize_t link_param_pos;\t\t\t\t\t\t\\\n+\tuint32_t link_id, queue_id;\t\t\t\t\t\\\n+\t\t\t\t\t\t\t\t\t\\\n+\tsscanf((txq_name), \"TXQ%\" SCNu32 \".%\" SCNu32, &link_id, &queue_id);\\\n+\tsprintf(link_name, \"LINK%\" PRIu32, link_id);\t\t\t\\\n+\tlink_param_pos = APP_PARAM_ADD((app)->link_params, link_name);\t\\\n+\tlink_param_pos;\t\t\t\t\t\t\t\\\n+})\n+\n+#define APP_PARAM_ADD_LINK_FOR_TM(app, tm_name)\t\t\t\t\\\n+({\t\t\t\t\t\t\t\t\t\\\n+\tchar link_name[APP_PARAM_NAME_SIZE];\t\t\t\t\\\n+\tssize_t link_param_pos;\t\t\t\t\t\t\\\n+\tuint32_t link_id;\t\t\t\t\t\t\\\n+\t\t\t\t\t\t\t\t\t\\\n+\tsscanf((tm_name), \"TM%\" SCNu32, &link_id);\t\t\t\\\n+\tsprintf(link_name, \"LINK%\" PRIu32, link_id);\t\t\t\\\n+\tlink_param_pos = APP_PARAM_ADD((app)->link_params, link_name);\t\\\n+\tlink_param_pos;\t\t\t\t\t\t\t\\\n+})\n+\n+#define PARSE_CHECK_DUPLICATE_SECTION(obj)\t\t\t\t\\\n do {\t\t\t\t\t\t\t\t\t\\\n-\tAPP_CHECK((result != -EINVAL),\t\t\t\t\t\\\n-\t\t\"Parse error: no free memory\");\t\t\t\t\\\n-\tAPP_CHECK((result != -ENOMEM),\t\t\t\t\t\\\n-\t\t\"Parse error: too many \\\"%s\\\" sections\", section_name);\t\\\n-\tAPP_CHECK(((result >= 0) && (params_array)[result].parsed == 0),\\\n-\t\t\"Parse error: duplicate \\\"%s\\\" section\", section_name);\t\\\n-\tAPP_CHECK((result >= 0),\t\t\t\t\t\\\n-\t\t\"Parse error in section \\\"%s\\\"\", section_name);\t\t\\\n+\tAPP_CHECK(((obj)->parsed == 0),\t\t\t\t\t\\\n+\t\t\"Parse error: duplicate \\\"%s\\\" section\", (obj)->name);\t\\\n+\t(obj)->parsed++;\t\t\t\t\t\\\n+} while (0)\n+\n+#define PARSE_CHECK_DUPLICATE_SECTION_EAL(obj)\t\t\t\t\\\n+do {\t\t\t\t\t\t\t\t\t\\\n+\tAPP_CHECK(((obj)->parsed == 0),\t\t\t\t\t\\\n+\t\t\"Parse error: duplicate \\\"%s\\\" section\", \"EAL\");\t\\\n+\t(obj)->parsed++;\t\t\t\t\t\\\n } while (0)\n \n #define PARSE_ERROR(exp, section, entry)\t\t\t\t\\\n-APP_CHECK(exp, \"Parse error in section \\\"%s\\\": entry \\\"%s\\\"\\n\", section, entry)\n+APP_CHECK(exp, \"Parse error in section \\\"%s\\\": entry \\\"%s\\\"\", section, entry)\n \n #define PARSE_ERROR_MESSAGE(exp, section, entry, message)\t\t\\\n-APP_CHECK(exp, \"Parse error in section \\\"%s\\\", entry \\\"%s\\\": %s\\n\",\t\\\n+APP_CHECK(exp, \"Parse error in section \\\"%s\\\", entry \\\"%s\\\": %s\",\t\\\n \tsection, entry, message)\n \n+#define PARSE_ERROR_NO_ELEMENTS(exp, section, entry)\t\t\t\\\n+APP_CHECK(exp, \"Parse error in section \\\"%s\\\", entry \\\"%s\\\": \"\t\t\\\n+\t\"no elements detected\",\t\t\t\t\t\t\\\n+\tsection, entry)\n+\n+#define PARSE_ERROR_TOO_MANY_ELEMENTS(exp, section, entry, max)\t\t\\\n+APP_CHECK(exp, \"Parse error in section \\\"%s\\\", entry \\\"%s\\\": \"\t\t\\\n+\t\"maximum number of elements allowed is %lu\",\t\t\t\\\n+\tsection, entry, max)\n+\n+#define PARSE_ERROR_INVALID_ELEMENT(exp, section, entry, value)\t\t\\\n+APP_CHECK(exp, \"Parse error in section \\\"%s\\\", entry \\\"%s\\\": \"\t\t\\\n+\t\"Invalid element value \\\"%s\\\"\",\t\t\t\t\t\\\n+\tsection, entry, value)\n \n #define PARSE_ERROR_MALLOC(exp)\t\t\t\t\t\t\\\n-APP_CHECK(exp, \"Parse error: no free memory\\n\")\n+APP_CHECK(exp, \"Parse error: no free memory\")\n \n #define PARSE_ERROR_SECTION(exp, section)\t\t\t\t\\\n APP_CHECK(exp, \"Parse error in section \\\"%s\\\"\", section)\n \n #define PARSE_ERROR_SECTION_NO_ENTRIES(exp, section)\t\t\t\\\n-APP_CHECK(exp, \"Parse error in section \\\"%s\\\": no entries\\n\", section)\n+APP_CHECK(exp, \"Parse error in section \\\"%s\\\": no entries\", section)\n \n #define PARSE_WARNING_IGNORED(exp, section, entry)\t\t\t\\\n do\t\t\t\t\t\t\t\t\t\\\n if (!(exp))\t\t\t\t\t\t\t\t\\\n \tfprintf(stderr, \"Parse warning in section \\\"%s\\\": \"\t\t\\\n-\t\t\"entry \\\"%s\\\" is ignored\\n\", section, entry);\t\t\\\n+\t\t\"entry \\\"%s\\\" is ignored\", section, entry);\t\t\\\n while (0)\n \n #define PARSE_ERROR_INVALID(exp, section, entry)\t\t\t\\\n-APP_CHECK(exp, \"Parse error in section \\\"%s\\\": unrecognized entry \\\"%s\\\"\\n\",\\\n+APP_CHECK(exp, \"Parse error in section \\\"%s\\\": unrecognized entry \\\"%s\\\"\",\\\n \tsection, entry)\n \n #define PARSE_ERROR_DUPLICATE(exp, section, entry)\t\t\t\\\n-APP_CHECK(exp, \"Parse error in section \\\"%s\\\": duplicate entry \\\"%s\\\"\\n\",\\\n+APP_CHECK(exp, \"Parse error in section \\\"%s\\\": duplicate entry \\\"%s\\\"\",\t\\\n \tsection, entry)\n \n static int\n@@ -329,6 +403,8 @@ parse_eal(struct app_params *app,\n \n \trte_cfgfile_section_entries(cfg, section_name, entries, n_entries);\n \n+\tPARSE_CHECK_DUPLICATE_SECTION_EAL(p);\n+\n \tfor (i = 0; i < n_entries; i++) {\n \t\tstruct rte_cfgfile_entry *entry = &entries[i];\n \n@@ -708,265 +784,154 @@ parse_eal(struct app_params *app,\n \tfree(entries);\n }\n \n-static int\n+static void\n parse_pipeline_pktq_in(struct app_params *app,\n \tstruct app_pipeline_params *p,\n-\tconst char *value)\n+\tchar *value)\n {\n-\tconst char *next = value;\n-\tchar *end;\n-\tchar name[APP_PARAM_NAME_SIZE];\n-\tsize_t name_len;\n+\tp->n_pktq_in = 0;\n \n-\twhile (*next != '\\0') {\n+\twhile (1) {\n \t\tenum app_pktq_in_type type;\n \t\tint id;\n-\t\tchar *end_space;\n-\t\tchar *end_tab;\n+\t\tchar *name = strtok_r(value, PARSE_DELIMITER, &value);\n \n-\t\tnext = skip_white_spaces(next);\n-\t\tif (!next)\n+\t\tif (name == NULL)\n \t\t\tbreak;\n \n-\t\tend_space = strchr(next, ' ');\n-\t\tend_tab = strchr(next, '\t');\n-\n-\t\tif (end_space && (!end_tab))\n-\t\t\tend = end_space;\n-\t\telse if ((!end_space) && end_tab)\n-\t\t\tend = end_tab;\n-\t\telse if (end_space && end_tab)\n-\t\t\tend = RTE_MIN(end_space, end_tab);\n-\t\telse\n-\t\t\tend = NULL;\n-\n-\t\tif (!end)\n-\t\t\tname_len = strlen(next);\n-\t\telse\n-\t\t\tname_len = end - next;\n-\n-\t\tif (name_len == 0 || name_len == sizeof(name))\n-\t\t\treturn -EINVAL;\n-\n-\t\tstrncpy(name, next, name_len);\n-\t\tname[name_len] = '\\0';\n-\t\tnext += name_len;\n-\t\tif (*next != '\\0')\n-\t\t\tnext++;\n+\t\tPARSE_ERROR_TOO_MANY_ELEMENTS(\n+\t\t\t(p->n_pktq_in < RTE_DIM(p->pktq_in)),\n+\t\t\tp->name, \"pktq_in\", RTE_DIM(p->pktq_in));\n \n \t\tif (validate_name(name, \"RXQ\", 2) == 0) {\n \t\t\ttype = APP_PKTQ_IN_HWQ;\n \t\t\tid = APP_PARAM_ADD(app->hwq_in_params, name);\n+\t\t\tAPP_PARAM_ADD_LINK_FOR_RXQ(app, name);\n \t\t} else if (validate_name(name, \"SWQ\", 1) == 0) {\n \t\t\ttype = APP_PKTQ_IN_SWQ;\n \t\t\tid = APP_PARAM_ADD(app->swq_params, name);\n \t\t} else if (validate_name(name, \"TM\", 1) == 0) {\n \t\t\ttype = APP_PKTQ_IN_TM;\n \t\t\tid = APP_PARAM_ADD(app->tm_params, name);\n+\t\t\tAPP_PARAM_ADD_LINK_FOR_TM(app, name);\n \t\t} else if (validate_name(name, \"SOURCE\", 1) == 0) {\n \t\t\ttype = APP_PKTQ_IN_SOURCE;\n \t\t\tid = APP_PARAM_ADD(app->source_params, name);\n \t\t} else\n-\t\t\treturn -EINVAL;\n-\n-\t\tif (id < 0)\n-\t\t\treturn id;\n+\t\t\tPARSE_ERROR_INVALID_ELEMENT(0,\n+\t\t\t\tp->name, \"pktq_in\", name);\n \n \t\tp->pktq_in[p->n_pktq_in].type = type;\n \t\tp->pktq_in[p->n_pktq_in].id = (uint32_t) id;\n \t\tp->n_pktq_in++;\n \t}\n \n-\treturn 0;\n+\tPARSE_ERROR_NO_ELEMENTS((p->n_pktq_in > 0), p->name, \"pktq_in\");\n }\n \n-static int\n+static void\n parse_pipeline_pktq_out(struct app_params *app,\n \tstruct app_pipeline_params *p,\n-\tconst char *value)\n+\tchar *value)\n {\n-\tconst char *next = value;\n-\tchar *end;\n-\tchar name[APP_PARAM_NAME_SIZE];\n-\tsize_t name_len;\n+\tp->n_pktq_out = 0;\n \n-\twhile (*next != '\\0') {\n-\t\tenum app_pktq_out_type type;\n+\twhile (1) {\n+\t\tenum app_pktq_in_type type;\n \t\tint id;\n-\t\tchar *end_space;\n-\t\tchar *end_tab;\n+\t\tchar *name = strtok_r(value, PARSE_DELIMITER, &value);\n \n-\t\tnext = skip_white_spaces(next);\n-\t\tif (!next)\n+\t\tif (name == NULL)\n \t\t\tbreak;\n \n-\t\tend_space = strchr(next, ' ');\n-\t\tend_tab = strchr(next, '\t');\n-\n-\t\tif (end_space && (!end_tab))\n-\t\t\tend = end_space;\n-\t\telse if ((!end_space) && end_tab)\n-\t\t\tend = end_tab;\n-\t\telse if (end_space && end_tab)\n-\t\t\tend = RTE_MIN(end_space, end_tab);\n-\t\telse\n-\t\t\tend = NULL;\n-\n-\t\tif (!end)\n-\t\t\tname_len = strlen(next);\n-\t\telse\n-\t\t\tname_len = end - next;\n-\n-\t\tif (name_len == 0 || name_len == sizeof(name))\n-\t\t\treturn -EINVAL;\n+\t\tPARSE_ERROR_TOO_MANY_ELEMENTS(\n+\t\t\t(p->n_pktq_out < RTE_DIM(p->pktq_out)),\n+\t\t\tp->name, \"pktq_out\", RTE_DIM(p->pktq_out));\n \n-\t\tstrncpy(name, next, name_len);\n-\t\tname[name_len] = '\\0';\n-\t\tnext += name_len;\n-\t\tif (*next != '\\0')\n-\t\t\tnext++;\n \t\tif (validate_name(name, \"TXQ\", 2) == 0) {\n \t\t\ttype = APP_PKTQ_OUT_HWQ;\n \t\t\tid = APP_PARAM_ADD(app->hwq_out_params, name);\n+\t\t\tAPP_PARAM_ADD_LINK_FOR_TXQ(app, name);\n \t\t} else if (validate_name(name, \"SWQ\", 1) == 0) {\n \t\t\ttype = APP_PKTQ_OUT_SWQ;\n \t\t\tid = APP_PARAM_ADD(app->swq_params, name);\n \t\t} else if (validate_name(name, \"TM\", 1) == 0) {\n \t\t\ttype = APP_PKTQ_OUT_TM;\n \t\t\tid = APP_PARAM_ADD(app->tm_params, name);\n+\t\t\tAPP_PARAM_ADD_LINK_FOR_TM(app, name);\n \t\t} else if (validate_name(name, \"SINK\", 1) == 0) {\n \t\t\ttype = APP_PKTQ_OUT_SINK;\n \t\t\tid = APP_PARAM_ADD(app->sink_params, name);\n \t\t} else\n-\t\t\treturn -EINVAL;\n-\n-\t\tif (id < 0)\n-\t\t\treturn id;\n+\t\t\tPARSE_ERROR_INVALID_ELEMENT(0,\n+\t\t\t\tp->name, \"pktq_out\", name);\n \n \t\tp->pktq_out[p->n_pktq_out].type = type;\n \t\tp->pktq_out[p->n_pktq_out].id = id;\n \t\tp->n_pktq_out++;\n \t}\n \n-\treturn 0;\n+\tPARSE_ERROR_NO_ELEMENTS((p->n_pktq_out > 0), p->name, \"pktq_out\");\n }\n \n-static int\n+static void\n parse_pipeline_msgq_in(struct app_params *app,\n \tstruct app_pipeline_params *p,\n-\tconst char *value)\n+\tchar *value)\n {\n-\tconst char *next = value;\n-\tchar *end;\n-\tchar name[APP_PARAM_NAME_SIZE];\n-\tsize_t name_len;\n-\tssize_t idx;\n-\n-\twhile (*next != '\\0') {\n-\t\tchar *end_space;\n-\t\tchar *end_tab;\n-\n-\t\tnext = skip_white_spaces(next);\n-\t\tif (!next)\n-\t\t\tbreak;\n+\tp->n_msgq_in = 0;\n \n-\t\tend_space = strchr(next, ' ');\n-\t\tend_tab = strchr(next, '\t');\n+\twhile (1) {\n+\t\tint idx;\n+\t\tchar *name = strtok_r(value, PARSE_DELIMITER, &value);\n \n-\t\tif (end_space && (!end_tab))\n-\t\t\tend = end_space;\n-\t\telse if ((!end_space) && end_tab)\n-\t\t\tend = end_tab;\n-\t\telse if (end_space && end_tab)\n-\t\t\tend = RTE_MIN(end_space, end_tab);\n-\t\telse\n-\t\t\tend = NULL;\n-\n-\t\tif (!end)\n-\t\t\tname_len = strlen(next);\n-\t\telse\n-\t\t\tname_len = end - next;\n-\n-\t\tif (name_len == 0 || name_len == sizeof(name))\n-\t\t\treturn -EINVAL;\n+\t\tif (name == NULL)\n+\t\t\tbreak;\n \n-\t\tstrncpy(name, next, name_len);\n-\t\tname[name_len] = '\\0';\n-\t\tnext += name_len;\n-\t\tif (*next != '\\0')\n-\t\t\tnext++;\n+\t\tPARSE_ERROR_TOO_MANY_ELEMENTS(\n+\t\t\t(p->n_msgq_in < RTE_DIM(p->msgq_in)),\n+\t\t\tp->name, \"msgq_in\", RTE_DIM(p->msgq_in));\n \n-\t\tif (validate_name(name, \"MSGQ\", 1) != 0)\n-\t\t\treturn -EINVAL;\n+\t\tPARSE_ERROR_INVALID_ELEMENT(\n+\t\t\t(validate_name(name, \"MSGQ\", 1) == 0),\n+\t\t\tp->name, \"msgq_in\", name);\n \n \t\tidx = APP_PARAM_ADD(app->msgq_params, name);\n-\t\tif (idx < 0)\n-\t\t\treturn idx;\n-\n \t\tp->msgq_in[p->n_msgq_in] = idx;\n \t\tp->n_msgq_in++;\n \t}\n \n-\treturn 0;\n+\tPARSE_ERROR_NO_ELEMENTS((p->n_msgq_in > 0), p->name, \"msgq_in\");\n }\n \n-static int\n+static void\n parse_pipeline_msgq_out(struct app_params *app,\n \tstruct app_pipeline_params *p,\n-\tconst char *value)\n+\tchar *value)\n {\n-\tconst char *next = value;\n-\tchar *end;\n-\tchar name[APP_PARAM_NAME_SIZE];\n-\tsize_t name_len;\n-\tssize_t idx;\n-\n-\twhile (*next != '\\0') {\n-\t\tchar *end_space;\n-\t\tchar *end_tab;\n-\n-\t\tnext = skip_white_spaces(next);\n-\t\tif (!next)\n-\t\t\tbreak;\n-\n-\t\tend_space = strchr(next, ' ');\n-\t\tend_tab = strchr(next, '\t');\n-\n-\t\tif (end_space && (!end_tab))\n-\t\t\tend = end_space;\n-\t\telse if ((!end_space) && end_tab)\n-\t\t\tend = end_tab;\n-\t\telse if (end_space && end_tab)\n-\t\t\tend = RTE_MIN(end_space, end_tab);\n-\t\telse\n-\t\t\tend = NULL;\n+\tp->n_msgq_out = 0;\n \n-\t\tif (!end)\n-\t\t\tname_len = strlen(next);\n-\t\telse\n-\t\t\tname_len = end - next;\n+\twhile (1) {\n+\t\tint idx;\n+\t\tchar *name = strtok_r(value, PARSE_DELIMITER, &value);\n \n-\t\tif (name_len == 0 || name_len == sizeof(name))\n-\t\t\treturn -EINVAL;\n+\t\tif (name == NULL)\n+\t\t\tbreak;\n \n-\t\tstrncpy(name, next, name_len);\n-\t\tname[name_len] = '\\0';\n-\t\tnext += name_len;\n-\t\tif (*next != '\\0')\n-\t\t\tnext++;\n+\t\tPARSE_ERROR_TOO_MANY_ELEMENTS(\n+\t\t\t(p->n_msgq_out < RTE_DIM(p->msgq_out)),\n+\t\t\tp->name, \"msgq_out\", RTE_DIM(p->msgq_out));\n \n-\t\tif (validate_name(name, \"MSGQ\", 1) != 0)\n-\t\t\treturn -EINVAL;\n+\t\tPARSE_ERROR_INVALID_ELEMENT(\n+\t\t\t(validate_name(name, \"MSGQ\", 1) == 0),\n+\t\t\tp->name, \"msgq_out\", name);\n \n \t\tidx = APP_PARAM_ADD(app->msgq_params, name);\n-\t\tif (idx < 0)\n-\t\t\treturn idx;\n-\n \t\tp->msgq_out[p->n_msgq_out] = idx;\n \t\tp->n_msgq_out++;\n \t}\n \n-\treturn 0;\n+\tPARSE_ERROR_NO_ELEMENTS((p->n_msgq_out > 0), p->name, \"msgq_out\");\n }\n \n static void\n@@ -989,9 +954,8 @@ parse_pipeline(struct app_params *app,\n \trte_cfgfile_section_entries(cfg, section_name, entries, n_entries);\n \n \tparam_idx = APP_PARAM_ADD(app->pipeline_params, section_name);\n-\tPARSER_PARAM_ADD_CHECK(param_idx, app->pipeline_params, section_name);\n-\n \tparam = &app->pipeline_params[param_idx];\n+\tPARSE_CHECK_DUPLICATE_SECTION(param);\n \n \tfor (i = 0; i < n_entries; i++) {\n \t\tstruct rte_cfgfile_entry *ent = &entries[i];\n@@ -1018,38 +982,26 @@ parse_pipeline(struct app_params *app,\n \t\t}\n \n \t\tif (strcmp(ent->name, \"pktq_in\") == 0) {\n-\t\t\tint status = parse_pipeline_pktq_in(app, param,\n-\t\t\t\tent->value);\n+\t\t\tparse_pipeline_pktq_in(app, param, ent->value);\n \n-\t\t\tPARSE_ERROR((status == 0), section_name,\n-\t\t\t\tent->name);\n \t\t\tcontinue;\n \t\t}\n \n \t\tif (strcmp(ent->name, \"pktq_out\") == 0) {\n-\t\t\tint status = parse_pipeline_pktq_out(app, param,\n-\t\t\t\tent->value);\n+\t\t\tparse_pipeline_pktq_out(app, param, ent->value);\n \n-\t\t\tPARSE_ERROR((status == 0), section_name,\n-\t\t\t\tent->name);\n \t\t\tcontinue;\n \t\t}\n \n \t\tif (strcmp(ent->name, \"msgq_in\") == 0) {\n-\t\t\tint status = parse_pipeline_msgq_in(app, param,\n-\t\t\t\tent->value);\n+\t\t\tparse_pipeline_msgq_in(app, param, ent->value);\n \n-\t\t\tPARSE_ERROR((status == 0), section_name,\n-\t\t\t\tent->name);\n \t\t\tcontinue;\n \t\t}\n \n \t\tif (strcmp(ent->name, \"msgq_out\") == 0) {\n-\t\t\tint status = parse_pipeline_msgq_out(app, param,\n-\t\t\t\tent->value);\n+\t\t\tparse_pipeline_msgq_out(app, param, ent->value);\n \n-\t\t\tPARSE_ERROR((status == 0), section_name,\n-\t\t\t\tent->name);\n \t\t\tcontinue;\n \t\t}\n \n@@ -1078,17 +1030,13 @@ parse_pipeline(struct app_params *app,\n \t\tparam->n_args++;\n \t}\n \n-\tparam->parsed = 1;\n-\n \tsnprintf(name, sizeof(name), \"MSGQ-REQ-%s\", section_name);\n \tparam_idx = APP_PARAM_ADD(app->msgq_params, name);\n-\tPARSER_PARAM_ADD_CHECK(param_idx, app->msgq_params, name);\n \tapp->msgq_params[param_idx].cpu_socket_id = param->socket_id;\n \tparam->msgq_in[param->n_msgq_in++] = param_idx;\n \n \tsnprintf(name, sizeof(name), \"MSGQ-RSP-%s\", section_name);\n \tparam_idx = APP_PARAM_ADD(app->msgq_params, name);\n-\tPARSER_PARAM_ADD_CHECK(param_idx, app->msgq_params, name);\n \tapp->msgq_params[param_idx].cpu_socket_id = param->socket_id;\n \tparam->msgq_out[param->n_msgq_out++] = param_idx;\n \n@@ -1097,7 +1045,6 @@ parse_pipeline(struct app_params *app,\n \t\tparam->core_id,\n \t\t(param->hyper_th_id) ? \"h\" : \"\");\n \tparam_idx = APP_PARAM_ADD(app->msgq_params, name);\n-\tPARSER_PARAM_ADD_CHECK(param_idx, app->msgq_params, name);\n \tapp->msgq_params[param_idx].cpu_socket_id = param->socket_id;\n \n \tsnprintf(name, sizeof(name), \"MSGQ-RSP-CORE-s%\" PRIu32 \"c%\" PRIu32 \"%s\",\n@@ -1105,7 +1052,6 @@ parse_pipeline(struct app_params *app,\n \t\tparam->core_id,\n \t\t(param->hyper_th_id) ? \"h\" : \"\");\n \tparam_idx = APP_PARAM_ADD(app->msgq_params, name);\n-\tPARSER_PARAM_ADD_CHECK(param_idx, app->msgq_params, name);\n \tapp->msgq_params[param_idx].cpu_socket_id = param->socket_id;\n \n \tfree(entries);\n@@ -1130,9 +1076,8 @@ parse_mempool(struct app_params *app,\n \trte_cfgfile_section_entries(cfg, section_name, entries, n_entries);\n \n \tparam_idx = APP_PARAM_ADD(app->mempool_params, section_name);\n-\tPARSER_PARAM_ADD_CHECK(param_idx, app->mempool_params, section_name);\n-\n \tparam = &app->mempool_params[param_idx];\n+\tPARSE_CHECK_DUPLICATE_SECTION(param);\n \n \tfor (i = 0; i < n_entries; i++) {\n \t\tstruct rte_cfgfile_entry *ent = &entries[i];\n@@ -1177,8 +1122,6 @@ parse_mempool(struct app_params *app,\n \t\tPARSE_ERROR_INVALID(0, section_name, ent->name);\n \t}\n \n-\tparam->parsed = 1;\n-\n \tfree(entries);\n }\n \n@@ -1202,9 +1145,8 @@ parse_link(struct app_params *app,\n \trte_cfgfile_section_entries(cfg, section_name, entries, n_entries);\n \n \tparam_idx = APP_PARAM_ADD(app->link_params, section_name);\n-\tPARSER_PARAM_ADD_CHECK(param_idx, app->link_params, section_name);\n-\n \tparam = &app->link_params[param_idx];\n+\tPARSE_CHECK_DUPLICATE_SECTION(param);\n \n \tfor (i = 0; i < n_entries; i++) {\n \t\tstruct rte_cfgfile_entry *ent = &entries[i];\n@@ -1297,8 +1239,6 @@ parse_link(struct app_params *app,\n \t\t\t\"this entry is mandatory (port_mask is not \"\n \t\t\t\"provided)\");\n \n-\tparam->parsed = 1;\n-\n \tfree(entries);\n }\n \n@@ -1321,9 +1261,10 @@ parse_rxq(struct app_params *app,\n \trte_cfgfile_section_entries(cfg, section_name, entries, n_entries);\n \n \tparam_idx = APP_PARAM_ADD(app->hwq_in_params, section_name);\n-\tPARSER_PARAM_ADD_CHECK(param_idx, app->hwq_in_params, section_name);\n-\n \tparam = &app->hwq_in_params[param_idx];\n+\tPARSE_CHECK_DUPLICATE_SECTION(param);\n+\n+\tAPP_PARAM_ADD_LINK_FOR_RXQ(app, section_name);\n \n \tfor (i = 0; i < n_entries; i++) {\n \t\tstruct rte_cfgfile_entry *ent = &entries[i];\n@@ -1335,10 +1276,8 @@ parse_rxq(struct app_params *app,\n \n \t\t\tPARSE_ERROR((status == 0), section_name,\n \t\t\t\tent->name);\n-\t\t\tidx = APP_PARAM_ADD(app->mempool_params,\n-\t\t\t\tent->value);\n-\t\t\tPARSER_PARAM_ADD_CHECK(idx, app->mempool_params,\n-\t\t\t\tsection_name);\n+\n+\t\t\tidx = APP_PARAM_ADD(app->mempool_params, ent->value);\n \t\t\tparam->mempool_id = idx;\n \t\t\tcontinue;\n \t\t}\n@@ -1365,8 +1304,6 @@ parse_rxq(struct app_params *app,\n \t\tPARSE_ERROR_INVALID(0, section_name, ent->name);\n \t}\n \n-\tparam->parsed = 1;\n-\n \tfree(entries);\n }\n \n@@ -1389,9 +1326,10 @@ parse_txq(struct app_params *app,\n \trte_cfgfile_section_entries(cfg, section_name, entries, n_entries);\n \n \tparam_idx = APP_PARAM_ADD(app->hwq_out_params, section_name);\n-\tPARSER_PARAM_ADD_CHECK(param_idx, app->hwq_out_params, section_name);\n-\n \tparam = &app->hwq_out_params[param_idx];\n+\tPARSE_CHECK_DUPLICATE_SECTION(param);\n+\n+\tAPP_PARAM_ADD_LINK_FOR_TXQ(app, section_name);\n \n \tfor (i = 0; i < n_entries; i++) {\n \t\tstruct rte_cfgfile_entry *ent = &entries[i];\n@@ -1428,8 +1366,6 @@ parse_txq(struct app_params *app,\n \t\tPARSE_ERROR_INVALID(0, section_name, ent->name);\n \t}\n \n-\tparam->parsed = 1;\n-\n \tfree(entries);\n }\n \n@@ -1457,9 +1393,8 @@ parse_swq(struct app_params *app,\n \trte_cfgfile_section_entries(cfg, section_name, entries, n_entries);\n \n \tparam_idx = APP_PARAM_ADD(app->swq_params, section_name);\n-\tPARSER_PARAM_ADD_CHECK(param_idx, app->swq_params, section_name);\n-\n \tparam = &app->swq_params[param_idx];\n+\tPARSE_CHECK_DUPLICATE_SECTION(param);\n \n \tfor (i = 0; i < n_entries; i++) {\n \t\tstruct rte_cfgfile_entry *ent = &entries[i];\n@@ -1587,11 +1522,9 @@ parse_swq(struct app_params *app,\n \t\t\tPARSE_ERROR((status == 0), section_name,\n \t\t\t\tent->name);\n \n-\t\t\tidx = APP_PARAM_ADD(app->mempool_params,\n-\t\t\t\tent->value);\n-\t\t\tPARSER_PARAM_ADD_CHECK(idx, app->mempool_params,\n-\t\t\t\tsection_name);\n+\t\t\tidx = APP_PARAM_ADD(app->mempool_params, ent->value);\n \t\t\tparam->mempool_direct_id = idx;\n+\n \t\t\tmempool_direct_present = 1;\n \t\t\tcontinue;\n \t\t}\n@@ -1603,11 +1536,10 @@ parse_swq(struct app_params *app,\n \n \t\t\tPARSE_ERROR((status == 0), section_name,\n \t\t\t\tent->name);\n-\t\t\tidx = APP_PARAM_ADD(app->mempool_params,\n-\t\t\t\tent->value);\n-\t\t\tPARSER_PARAM_ADD_CHECK(idx, app->mempool_params,\n-\t\t\t\tsection_name);\n+\n+\t\t\tidx = APP_PARAM_ADD(app->mempool_params, ent->value);\n \t\t\tparam->mempool_indirect_id = idx;\n+\n \t\t\tmempool_indirect_present = 1;\n \t\t\tcontinue;\n \t\t}\n@@ -1616,32 +1548,30 @@ parse_swq(struct app_params *app,\n \t\tPARSE_ERROR_INVALID(0, section_name, ent->name);\n \t}\n \n-\tAPP_CHECK(((mtu_present) &&\n+\tAPP_CHECK(((mtu_present == 0) ||\n \t\t((param->ipv4_frag == 1) || (param->ipv6_frag == 1))),\n \t\t\"Parse error in section \\\"%s\\\": IPv4/IPv6 fragmentation \"\n \t\t\"is off, therefore entry \\\"mtu\\\" is not allowed\",\n \t\tsection_name);\n \n-\tAPP_CHECK(((metadata_size_present) &&\n+\tAPP_CHECK(((metadata_size_present == 0) ||\n \t\t((param->ipv4_frag == 1) || (param->ipv6_frag == 1))),\n \t\t\"Parse error in section \\\"%s\\\": IPv4/IPv6 fragmentation \"\n \t\t\"is off, therefore entry \\\"metadata_size\\\" is \"\n \t\t\"not allowed\", section_name);\n \n-\tAPP_CHECK(((mempool_direct_present) &&\n+\tAPP_CHECK(((mempool_direct_present == 0) ||\n \t\t((param->ipv4_frag == 1) || (param->ipv6_frag == 1))),\n \t\t\"Parse error in section \\\"%s\\\": IPv4/IPv6 fragmentation \"\n \t\t\"is off, therefore entry \\\"mempool_direct\\\" is \"\n \t\t\"not allowed\", section_name);\n \n-\tAPP_CHECK(((mempool_indirect_present) &&\n+\tAPP_CHECK(((mempool_indirect_present == 0) ||\n \t\t((param->ipv4_frag == 1) || (param->ipv6_frag == 1))),\n \t\t\"Parse error in section \\\"%s\\\": IPv4/IPv6 fragmentation \"\n \t\t\"is off, therefore entry \\\"mempool_indirect\\\" is \"\n \t\t\"not allowed\", section_name);\n \n-\tparam->parsed = 1;\n-\n \tfree(entries);\n }\n \n@@ -1664,9 +1594,10 @@ parse_tm(struct app_params *app,\n \trte_cfgfile_section_entries(cfg, section_name, entries, n_entries);\n \n \tparam_idx = APP_PARAM_ADD(app->tm_params, section_name);\n-\tPARSER_PARAM_ADD_CHECK(param_idx, app->tm_params, section_name);\n-\n \tparam = &app->tm_params[param_idx];\n+\tPARSE_CHECK_DUPLICATE_SECTION(param);\n+\n+\tAPP_PARAM_ADD_LINK_FOR_TXQ(app, section_name);\n \n \tfor (i = 0; i < n_entries; i++) {\n \t\tstruct rte_cfgfile_entry *ent = &entries[i];\n@@ -1699,8 +1630,6 @@ parse_tm(struct app_params *app,\n \t\tPARSE_ERROR_INVALID(0, section_name, ent->name);\n \t}\n \n-\tparam->parsed = 1;\n-\n \tfree(entries);\n }\n \n@@ -1725,9 +1654,8 @@ parse_source(struct app_params *app,\n \trte_cfgfile_section_entries(cfg, section_name, entries, n_entries);\n \n \tparam_idx = APP_PARAM_ADD(app->source_params, section_name);\n-\tPARSER_PARAM_ADD_CHECK(param_idx, app->source_params, section_name);\n-\n \tparam = &app->source_params[param_idx];\n+\tPARSE_CHECK_DUPLICATE_SECTION(param);\n \n \tfor (i = 0; i < n_entries; i++) {\n \t\tstruct rte_cfgfile_entry *ent = &entries[i];\n@@ -1739,10 +1667,8 @@ parse_source(struct app_params *app,\n \n \t\t\tPARSE_ERROR((status == 0), section_name,\n \t\t\t\tent->name);\n-\t\t\tidx = APP_PARAM_ADD(app->mempool_params,\n-\t\t\t\tent->value);\n-\t\t\tPARSER_PARAM_ADD_CHECK(idx, app->mempool_params,\n-\t\t\t\tsection_name);\n+\n+\t\t\tidx = APP_PARAM_ADD(app->mempool_params, ent->value);\n \t\t\tparam->mempool_id = idx;\n \t\t\tcontinue;\n \t\t}\n@@ -1788,8 +1714,6 @@ parse_source(struct app_params *app,\n \t\tPARSE_ERROR_INVALID(0, section_name, ent->name);\n \t}\n \n-\tparam->parsed = 1;\n-\n \tfree(entries);\n }\n \n@@ -1814,9 +1738,8 @@ parse_sink(struct app_params *app,\n \trte_cfgfile_section_entries(cfg, section_name, entries, n_entries);\n \n \tparam_idx = APP_PARAM_ADD(app->sink_params, section_name);\n-\tPARSER_PARAM_ADD_CHECK(param_idx, app->sink_params, section_name);\n-\n \tparam = &app->sink_params[param_idx];\n+\tPARSE_CHECK_DUPLICATE_SECTION(param);\n \n \tfor (i = 0; i < n_entries; i++) {\n \t\tstruct rte_cfgfile_entry *ent = &entries[i];\n@@ -1851,8 +1774,6 @@ parse_sink(struct app_params *app,\n \t\tPARSE_ERROR_INVALID(0, section_name, ent->name);\n \t}\n \n-\tparam->parsed = 1;\n-\n \tfree(entries);\n }\n \n@@ -1875,9 +1796,8 @@ parse_msgq_req_pipeline(struct app_params *app,\n \trte_cfgfile_section_entries(cfg, section_name, entries, n_entries);\n \n \tparam_idx = APP_PARAM_ADD(app->msgq_params, section_name);\n-\tPARSER_PARAM_ADD_CHECK(param_idx, app->msgq_params, section_name);\n-\n \tparam = &app->msgq_params[param_idx];\n+\tPARSE_CHECK_DUPLICATE_SECTION(param);\n \n \tfor (i = 0; i < n_entries; i++) {\n \t\tstruct rte_cfgfile_entry *ent = &entries[i];\n@@ -1895,7 +1815,6 @@ parse_msgq_req_pipeline(struct app_params *app,\n \t\tPARSE_ERROR_INVALID(0, section_name, ent->name);\n \t}\n \n-\tparam->parsed = 1;\n \tfree(entries);\n }\n \n@@ -1918,9 +1837,8 @@ parse_msgq_rsp_pipeline(struct app_params *app,\n \trte_cfgfile_section_entries(cfg, section_name, entries, n_entries);\n \n \tparam_idx = APP_PARAM_ADD(app->msgq_params, section_name);\n-\tPARSER_PARAM_ADD_CHECK(param_idx, app->msgq_params, section_name);\n-\n \tparam = &app->msgq_params[param_idx];\n+\tPARSE_CHECK_DUPLICATE_SECTION(param);\n \n \tfor (i = 0; i < n_entries; i++) {\n \t\tstruct rte_cfgfile_entry *ent = &entries[i];\n@@ -1938,8 +1856,6 @@ parse_msgq_rsp_pipeline(struct app_params *app,\n \t\tPARSE_ERROR_INVALID(0, section_name, ent->name);\n \t}\n \n-\tparam->parsed = 1;\n-\n \tfree(entries);\n }\n \n@@ -1962,9 +1878,8 @@ parse_msgq(struct app_params *app,\n \trte_cfgfile_section_entries(cfg, section_name, entries, n_entries);\n \n \tparam_idx = APP_PARAM_ADD(app->msgq_params, section_name);\n-\tPARSER_PARAM_ADD_CHECK(param_idx, app->msgq_params, section_name);\n-\n \tparam = &app->msgq_params[param_idx];\n+\tPARSE_CHECK_DUPLICATE_SECTION(param);\n \n \tfor (i = 0; i < n_entries; i++) {\n \t\tstruct rte_cfgfile_entry *ent = &entries[i];\n@@ -1991,8 +1906,6 @@ parse_msgq(struct app_params *app,\n \t\tPARSE_ERROR_INVALID(0, section_name, ent->name);\n \t}\n \n-\tparam->parsed = 1;\n-\n \tfree(entries);\n }\n \n@@ -2025,10 +1938,7 @@ static const struct config_section cfg_file_scheme[] = {\n static void\n create_implicit_mempools(struct app_params *app)\n {\n-\tssize_t idx;\n-\n-\tidx = APP_PARAM_ADD(app->mempool_params, \"MEMPOOL0\");\n-\tPARSER_PARAM_ADD_CHECK(idx, app->mempool_params, \"start-up\");\n+\tAPP_PARAM_ADD(app->mempool_params, \"MEMPOOL0\");\n }\n \n static void\n@@ -2047,7 +1957,6 @@ create_implicit_links_from_port_mask(struct app_params *app,\n \n \t\tsnprintf(name, sizeof(name), \"LINK%\" PRIu32, link_id);\n \t\tidx = APP_PARAM_ADD(app->link_params, name);\n-\t\tPARSER_PARAM_ADD_CHECK(idx, app->link_params, name);\n \n \t\tapp->link_params[idx].pmd_id = pmd_id;\n \t\tlink_id++;\n@@ -2062,6 +1971,11 @@ assign_link_pmd_id_from_pci_bdf(struct app_params *app)\n \tfor (i = 0; i < app->n_links; i++) {\n \t\tstruct app_link_params *link = &app->link_params[i];\n \n+\t\tAPP_CHECK((strlen(link->pci_bdf)),\n+\t\t\t\"Parse error: %s pci_bdf is not configured \"\n+\t\t\t\"(port_mask is not provided)\",\n+\t\t\tlink->name);\n+\n \t\tlink->pmd_id = i;\n \t}\n }\n",
    "prefixes": [
        "dpdk-dev",
        "v4"
    ]
}