get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 128497,
    "url": "http://patches.dpdk.org/api/patches/128497/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20230609191245.252521-17-zhirun.yan@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": "<20230609191245.252521-17-zhirun.yan@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230609191245.252521-17-zhirun.yan@intel.com",
    "date": "2023-06-09T19:12:45",
    "name": "[v12,16/16] examples/l3fwd-graph: introduce mcore dispatch worker model",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "2b631ed2fea4cef2e8a4850382e5c218c4fe243c",
    "submitter": {
        "id": 1154,
        "url": "http://patches.dpdk.org/api/people/1154/?format=api",
        "name": "Yan, Zhirun",
        "email": "zhirun.yan@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/20230609191245.252521-17-zhirun.yan@intel.com/mbox/",
    "series": [
        {
            "id": 28444,
            "url": "http://patches.dpdk.org/api/series/28444/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=28444",
            "date": "2023-06-09T19:12:29",
            "name": "graph enhancement for multi-core dispatch",
            "version": 12,
            "mbox": "http://patches.dpdk.org/series/28444/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/128497/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/128497/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 519B642C71;\n\tFri,  9 Jun 2023 21:21:53 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 3500542DA4;\n\tFri,  9 Jun 2023 21:20:38 +0200 (CEST)",
            "from mga09.intel.com (mga09.intel.com [134.134.136.24])\n by mails.dpdk.org (Postfix) with ESMTP id 5D01B42D93\n for <dev@dpdk.org>; Fri,  9 Jun 2023 21:20:36 +0200 (CEST)",
            "from fmsmga006.fm.intel.com ([10.253.24.20])\n by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 09 Jun 2023 12:20:35 -0700",
            "from dpdk-zhirun-lmm.sh.intel.com ([10.67.119.94])\n by fmsmga006.fm.intel.com with ESMTP; 09 Jun 2023 12:20:32 -0700"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n t=1686338436; x=1717874436;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=IJQqBnw7n5zEHLbBUt8aYrpXAYkiwzupXGC0MKWuemQ=;\n b=SGpSLQtYIjteQWJr/TQ/MSKCmoUC7aNFRse+dh/fol2xHKFlOZJHyU1R\n MSVHohC7lyExLRJu1iWNVCTOvLasAV7fEv08OpnwUhYPosx4ylHM26131\n rsPEDFNb53lxtUT6DmuW0AFwd+MY7XQp54hN/DDVkWWxt8h1z5hba1Yy0\n NOaXKTyoFZ09bZ4DNSYYWMpG14wv4W+faNSpceFRe4YZnPxT7X4rrAAI8\n Zch3iug9bKKks7VRDnCbdaK01exEiYv3hsbiGRTyqIvsODBBd6iT6COmx\n QxigZFV22N6ACOJLMAyRIrmd3dN7Z00Ri6cXjDcKX6QGRd6amoDGTQynN Q==;",
        "X-IronPort-AV": [
            "E=McAfee;i=\"6600,9927,10736\"; a=\"360155202\"",
            "E=Sophos;i=\"6.00,230,1681196400\"; d=\"scan'208\";a=\"360155202\"",
            "E=McAfee;i=\"6600,9927,10736\"; a=\"957254710\"",
            "E=Sophos;i=\"6.00,230,1681196400\"; d=\"scan'208\";a=\"957254710\""
        ],
        "X-ExtLoop1": "1",
        "From": "Zhirun Yan <zhirun.yan@intel.com>",
        "To": "dev@dpdk.org, jerinj@marvell.com, kirankumark@marvell.com,\n ndabilpuram@marvell.com, stephen@networkplumber.org,\n pbhagavatula@marvell.com, jerinjacobk@gmail.com, david.marchand@redhat.com",
        "Cc": "cunming.liang@intel.com, haiyue.wang@intel.com,\n mattias.ronnblom@ericsson.com, Zhirun Yan <zhirun.yan@intel.com>",
        "Subject": "[PATCH v12 16/16] examples/l3fwd-graph: introduce mcore dispatch\n worker model",
        "Date": "Sat, 10 Jun 2023 03:12:45 +0800",
        "Message-Id": "<20230609191245.252521-17-zhirun.yan@intel.com>",
        "X-Mailer": "git-send-email 2.37.2",
        "In-Reply-To": "<20230609191245.252521-1-zhirun.yan@intel.com>",
        "References": "<20230608151844.1823783-1-zhirun.yan@intel.com>\n <20230609191245.252521-1-zhirun.yan@intel.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "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": "Add new parameter \"model\" to choose mcore dispatch or rtc model.\nAnd in dispatch model, the node will affinity to worker core successively.\n\nRTE_GRAPH_MODEL_SELECT is set to RTE_GRAPH_MODEL_RTC by default. Must set\nmodel the same as RTE_GRAPH_MODEL_SELECT if set it as rtc or mcore\ndispatch explicitly. If not define it, it could choose by param model\nin runtime.\nOnly support one RX node for mcore dispatch model in current\nimplementation.\n\n./dpdk-l3fwd-graph  -l 1,2,3,4 -n 4 -- -p 0x1 --config=\"(0,0,1)\" -P\n--model=\"dispatch\"\n\nSigned-off-by: Haiyue Wang <haiyue.wang@intel.com>\nSigned-off-by: Cunming Liang <cunming.liang@intel.com>\nSigned-off-by: Zhirun Yan <zhirun.yan@intel.com>\nAcked-by: Jerin Jacob <jerinj@marvell.com>\nAcked-by: Pavan Nikhilesh <pbhagavatula@marvell.com>\n---\n doc/guides/sample_app_ug/l3_forward_graph.rst |  16 ++\n examples/l3fwd-graph/main.c                   | 230 +++++++++++++++---\n 2 files changed, 208 insertions(+), 38 deletions(-)",
    "diff": "diff --git a/doc/guides/sample_app_ug/l3_forward_graph.rst b/doc/guides/sample_app_ug/l3_forward_graph.rst\nindex 585ac8c898..7189fa33ec 100644\n--- a/doc/guides/sample_app_ug/l3_forward_graph.rst\n+++ b/doc/guides/sample_app_ug/l3_forward_graph.rst\n@@ -54,6 +54,7 @@ The application has a number of command line options similar to l3fwd::\n                                    [--pcap-enable]\n                                    [--pcap-num-cap]\n                                    [--pcap-file-name]\n+                                   [--model]\n \n Where,\n \n@@ -78,6 +79,8 @@ Where,\n \n * ``--pcap-file-name:`` Optional, Pcap filename to capture packets in.\n \n+* ``--model:`` Optional, select graph walking model.\n+\n For example, consider a dual processor socket platform with 8 physical cores, where cores 0-7 and 16-23 appear on socket 0,\n while cores 8-15 and 24-31 appear on socket 1.\n \n@@ -122,6 +125,19 @@ In this command:\n \n *   The --pcap-file-name option enables user to give filename in which packets are to be captured.\n \n+To enable mcore dispatch model, the application need change RTE_GRAPH_MODEL_SELECT to ``#define RTE_GRAPH_MODEL_SELECT RTE_GRAPH_MODEL_MCORE_DISPATCH``\n+before including rte_graph_worker.h. Recompile and use following command:\n+\n+.. code-block:: console\n+\n+    ./<build_dir>/examples/dpdk-l3fwd-graph -l 1,2,3,4 -n 4 -- -p 0x1 --config=\"(0,0,1)\" -P --model=\"dispatch\"\n+\n+To enable graph walking model selection in run-time, remove the define of ``RTE_GRAPH_MODEL_SELECT``. Recompile and use the same command.\n+\n+In this command:\n+\n+*   The --model option enables user to select ``rtc`` or ``dispatch`` model.\n+\n Refer to the *DPDK Getting Started Guide* for general information on running applications and\n the Environment Abstraction Layer (EAL) options.\n \ndiff --git a/examples/l3fwd-graph/main.c b/examples/l3fwd-graph/main.c\nindex 5feeab4f0f..be69fcace1 100644\n--- a/examples/l3fwd-graph/main.c\n+++ b/examples/l3fwd-graph/main.c\n@@ -23,6 +23,7 @@\n #include <rte_cycles.h>\n #include <rte_eal.h>\n #include <rte_ethdev.h>\n+#define RTE_GRAPH_MODEL_SELECT RTE_GRAPH_MODEL_RTC\n #include <rte_graph_worker.h>\n #include <rte_launch.h>\n #include <rte_lcore.h>\n@@ -55,6 +56,9 @@\n \n #define NB_SOCKETS 8\n \n+/* Graph module */\n+#define WORKER_MODEL_RTC \"rtc\"\n+#define WORKER_MODEL_MCORE_DISPATCH \"dispatch\"\n /* Static global variables used within this file. */\n static uint16_t nb_rxd = RX_DESC_DEFAULT;\n static uint16_t nb_txd = TX_DESC_DEFAULT;\n@@ -88,6 +92,8 @@ struct lcore_rx_queue {\n \tchar node_name[RTE_NODE_NAMESIZE];\n };\n \n+static uint8_t model_conf = RTE_GRAPH_MODEL_DEFAULT;\n+\n /* Lcore conf */\n struct lcore_conf {\n \tuint16_t n_rx_queue;\n@@ -153,6 +159,19 @@ static struct ipv4_l3fwd_lpm_route ipv4_l3fwd_lpm_route_array[] = {\n \t{RTE_IPV4(198, 18, 6, 0), 24, 6}, {RTE_IPV4(198, 18, 7, 0), 24, 7},\n };\n \n+static int\n+check_worker_model_params(void)\n+{\n+\tif (model_conf == RTE_GRAPH_MODEL_MCORE_DISPATCH &&\n+\t    nb_lcore_params > 1) {\n+\t\tprintf(\"Exceeded max number of lcore params for remote model: %hu\\n\",\n+\t\t       nb_lcore_params);\n+\t\treturn -1;\n+\t}\n+\n+\treturn 0;\n+}\n+\n static int\n check_lcore_params(void)\n {\n@@ -276,6 +295,7 @@ print_usage(const char *prgname)\n \t\t\"  --eth-dest=X,MM:MM:MM:MM:MM:MM: Ethernet destination for \"\n \t\t\"port X\\n\"\n \t\t\"  --max-pkt-len PKTLEN: maximum packet length in decimal (64-9600)\\n\"\n+\t\t\"  --model NAME: walking model name, dispatch or rtc(by default)\\n\"\n \t\t\"  --no-numa: Disable numa awareness\\n\"\n \t\t\"  --per-port-pool: Use separate buffer pool per port\\n\"\n \t\t\"  --pcap-enable: Enables pcap capture\\n\"\n@@ -318,6 +338,23 @@ parse_max_pkt_len(const char *pktlen)\n \treturn len;\n }\n \n+static void\n+parse_worker_model(const char *model)\n+{\n+\tif (strcmp(model, WORKER_MODEL_MCORE_DISPATCH) == 0)\n+\t\tmodel_conf = RTE_GRAPH_MODEL_MCORE_DISPATCH;\n+\telse if (strcmp(model, WORKER_MODEL_RTC) == 0)\n+\t\tmodel_conf = RTE_GRAPH_MODEL_RTC;\n+\telse\n+\t\trte_exit(EXIT_FAILURE, \"Invalid worker model: %s\", model);\n+\n+#if defined(RTE_GRAPH_MODEL_SELECT)\n+\tif (model_conf != RTE_GRAPH_MODEL_SELECT)\n+\t\tprintf(\"Warning: model mismatch, will use the RTE_GRAPH_MODEL_SELECT model\\n\");\n+\tmodel_conf = RTE_GRAPH_MODEL_SELECT;\n+#endif\n+}\n+\n static int\n parse_portmask(const char *portmask)\n {\n@@ -434,6 +471,8 @@ static const char short_options[] = \"p:\" /* portmask */\n #define CMD_LINE_OPT_PCAP_ENABLE   \"pcap-enable\"\n #define CMD_LINE_OPT_NUM_PKT_CAP   \"pcap-num-cap\"\n #define CMD_LINE_OPT_PCAP_FILENAME \"pcap-file-name\"\n+#define CMD_LINE_OPT_WORKER_MODEL  \"model\"\n+\n enum {\n \t/* Long options mapped to a short option */\n \n@@ -449,6 +488,7 @@ enum {\n \tCMD_LINE_OPT_PARSE_PCAP_ENABLE,\n \tCMD_LINE_OPT_PARSE_NUM_PKT_CAP,\n \tCMD_LINE_OPT_PCAP_FILENAME_CAP,\n+\tCMD_LINE_OPT_WORKER_MODEL_TYPE,\n };\n \n static const struct option lgopts[] = {\n@@ -460,6 +500,7 @@ static const struct option lgopts[] = {\n \t{CMD_LINE_OPT_PCAP_ENABLE, 0, 0, CMD_LINE_OPT_PARSE_PCAP_ENABLE},\n \t{CMD_LINE_OPT_NUM_PKT_CAP, 1, 0, CMD_LINE_OPT_PARSE_NUM_PKT_CAP},\n \t{CMD_LINE_OPT_PCAP_FILENAME, 1, 0, CMD_LINE_OPT_PCAP_FILENAME_CAP},\n+\t{CMD_LINE_OPT_WORKER_MODEL, 1, 0, CMD_LINE_OPT_WORKER_MODEL_TYPE},\n \t{NULL, 0, 0, 0},\n };\n \n@@ -551,6 +592,11 @@ parse_args(int argc, char **argv)\n \t\t\tprintf(\"Pcap file name: %s\\n\", pcap_filename);\n \t\t\tbreak;\n \n+\t\tcase CMD_LINE_OPT_WORKER_MODEL_TYPE:\n+\t\t\tprintf(\"Use new worker model: %s\\n\", optarg);\n+\t\t\tparse_worker_model(optarg);\n+\t\t\tbreak;\n+\n \t\tdefault:\n \t\t\tprint_usage(prgname);\n \t\t\treturn -1;\n@@ -788,6 +834,142 @@ config_port_max_pkt_len(struct rte_eth_conf *conf,\n \treturn 0;\n }\n \n+static void\n+graph_config_mcore_dispatch(struct rte_graph_param graph_conf)\n+{\n+\tuint16_t nb_patterns = graph_conf.nb_node_patterns;\n+\tint worker_count = rte_lcore_count() - 1;\n+\tint main_lcore_id = rte_get_main_lcore();\n+\trte_graph_t main_graph_id = 0;\n+\tstruct rte_node *node_tmp;\n+\tstruct lcore_conf *qconf;\n+\tstruct rte_graph *graph;\n+\trte_graph_t graph_id;\n+\trte_graph_off_t off;\n+\tint n_rx_node = 0;\n+\tint worker_lcore;\n+\trte_node_t count;\n+\tint i, j;\n+\tint ret;\n+\n+\tfor (j = 0; j < nb_lcore_params; j++) {\n+\t\tqconf = &lcore_conf[lcore_params[j].lcore_id];\n+\t\t/* Add rx node patterns of all lcore */\n+\t\tfor (i = 0; i < qconf->n_rx_queue; i++) {\n+\t\t\tchar *node_name = qconf->rx_queue_list[i].node_name;\n+\t\t\tunsigned int lcore_id = lcore_params[j].lcore_id;\n+\n+\t\t\tgraph_conf.node_patterns[nb_patterns + n_rx_node + i] = node_name;\n+\t\t\tn_rx_node++;\n+\t\t\tret = rte_graph_model_mcore_dispatch_node_lcore_affinity_set(node_name,\n+\t\t\t\t\t\t\t\t\t\t     lcore_id);\n+\t\t\tif (ret == 0)\n+\t\t\t\tprintf(\"Set node %s affinity to lcore %u\\n\", node_name,\n+\t\t\t\t       lcore_params[j].lcore_id);\n+\t\t}\n+\t}\n+\n+\tgraph_conf.nb_node_patterns = nb_patterns + n_rx_node;\n+\tgraph_conf.socket_id = rte_lcore_to_socket_id(main_lcore_id);\n+\n+\tqconf = &lcore_conf[main_lcore_id];\n+\tsnprintf(qconf->name, sizeof(qconf->name), \"worker_%u\",\n+\t\t main_lcore_id);\n+\n+\t/* create main graph */\n+\tmain_graph_id = rte_graph_create(qconf->name, &graph_conf);\n+\tif (main_graph_id == RTE_GRAPH_ID_INVALID)\n+\t\trte_exit(EXIT_FAILURE,\n+\t\t\t \"rte_graph_create(): main_graph_id invalid for lcore %u\\n\",\n+\t\t\t main_lcore_id);\n+\n+\t/* set the graph model for the main graph */\n+\trte_graph_worker_model_set(RTE_GRAPH_MODEL_MCORE_DISPATCH);\n+\tqconf->graph_id = main_graph_id;\n+\tqconf->graph = rte_graph_lookup(qconf->name);\n+\tif (!qconf->graph)\n+\t\trte_exit(EXIT_FAILURE,\n+\t\t\t \"rte_graph_lookup(): graph %s not found\\n\",\n+\t\t\t qconf->name);\n+\n+\tgraph = qconf->graph;\n+\tworker_lcore = lcore_params[nb_lcore_params - 1].lcore_id;\n+\trte_graph_foreach_node(count, off, graph, node_tmp) {\n+\t\t/* Need to set the node Lcore affinity before clone graph for each lcore */\n+\t\tif (node_tmp->dispatch.lcore_id == RTE_MAX_LCORE) {\n+\t\t\tworker_lcore = rte_get_next_lcore(worker_lcore, true, 1);\n+\t\t\tret = rte_graph_model_mcore_dispatch_node_lcore_affinity_set(node_tmp->name,\n+\t\t\t\t\t\t\t\t\t\t     worker_lcore);\n+\t\t\tif (ret == 0)\n+\t\t\t\tprintf(\"Set node %s affinity to lcore %u\\n\",\n+\t\t\t\t       node_tmp->name, worker_lcore);\n+\t\t}\n+\t}\n+\n+\tworker_lcore = main_lcore_id;\n+\tfor (i = 0; i < worker_count; i++) {\n+\t\tworker_lcore = rte_get_next_lcore(worker_lcore, true, 1);\n+\n+\t\tqconf = &lcore_conf[worker_lcore];\n+\t\tsnprintf(qconf->name, sizeof(qconf->name), \"cloned-%u\", worker_lcore);\n+\t\tgraph_id = rte_graph_clone(main_graph_id, qconf->name, &graph_conf);\n+\t\tret = rte_graph_model_mcore_dispatch_core_bind(graph_id, worker_lcore);\n+\t\tif (ret == 0)\n+\t\t\tprintf(\"bind graph %d to lcore %u\\n\", graph_id, worker_lcore);\n+\n+\t\t/* full cloned graph name */\n+\t\tsnprintf(qconf->name, sizeof(qconf->name), \"%s\",\n+\t\t\t rte_graph_id_to_name(graph_id));\n+\t\tqconf->graph_id = graph_id;\n+\t\tqconf->graph = rte_graph_lookup(qconf->name);\n+\t\tif (!qconf->graph)\n+\t\t\trte_exit(EXIT_FAILURE,\n+\t\t\t\t \"Failed to lookup graph %s\\n\",\n+\t\t\t\t qconf->name);\n+\t\tcontinue;\n+\t}\n+}\n+\n+static void\n+graph_config_rtc(struct rte_graph_param graph_conf)\n+{\n+\tuint16_t nb_patterns = graph_conf.nb_node_patterns;\n+\tstruct lcore_conf *qconf;\n+\trte_graph_t graph_id;\n+\tuint32_t lcore_id;\n+\trte_edge_t i;\n+\n+\tfor (lcore_id = 0; lcore_id < RTE_MAX_LCORE; lcore_id++) {\n+\t\tif (rte_lcore_is_enabled(lcore_id) == 0)\n+\t\t\tcontinue;\n+\n+\t\tqconf = &lcore_conf[lcore_id];\n+\t\t/* Skip graph creation if no source exists */\n+\t\tif (!qconf->n_rx_queue)\n+\t\t\tcontinue;\n+\t\t/* Add rx node patterns of this lcore */\n+\t\tfor (i = 0; i < qconf->n_rx_queue; i++) {\n+\t\t\tgraph_conf.node_patterns[nb_patterns + i] =\n+\t\t\t\tqconf->rx_queue_list[i].node_name;\n+\t\t}\n+\t\tgraph_conf.nb_node_patterns = nb_patterns + i;\n+\t\tgraph_conf.socket_id = rte_lcore_to_socket_id(lcore_id);\n+\t\tsnprintf(qconf->name, sizeof(qconf->name), \"worker_%u\",\n+\t\t\t lcore_id);\n+\t\tgraph_id = rte_graph_create(qconf->name, &graph_conf);\n+\t\tif (graph_id == RTE_GRAPH_ID_INVALID)\n+\t\t\trte_exit(EXIT_FAILURE,\n+\t\t\t\t \"rte_graph_create(): graph_id invalid for lcore %u\\n\",\n+\t\t\t\t lcore_id);\n+\t\tqconf->graph_id = graph_id;\n+\t\tqconf->graph = rte_graph_lookup(qconf->name);\n+\t\tif (!qconf->graph)\n+\t\t\trte_exit(EXIT_FAILURE,\n+\t\t\t\t \"rte_graph_lookup(): graph %s not found\\n\",\n+\t\t\t\t qconf->name);\n+\t}\n+}\n+\n int\n main(int argc, char **argv)\n {\n@@ -840,6 +1022,9 @@ main(int argc, char **argv)\n \tif (check_lcore_params() < 0)\n \t\trte_exit(EXIT_FAILURE, \"check_lcore_params() failed\\n\");\n \n+\tif (check_worker_model_params() < 0)\n+\t\trte_exit(EXIT_FAILURE, \"check_worker_model_params() failed\\n\");\n+\n \tret = init_lcore_rx_queues();\n \tif (ret < 0)\n \t\trte_exit(EXIT_FAILURE, \"init_lcore_rx_queues() failed\\n\");\n@@ -1079,51 +1264,20 @@ main(int argc, char **argv)\n \n \tmemset(&graph_conf, 0, sizeof(graph_conf));\n \tgraph_conf.node_patterns = node_patterns;\n+\tgraph_conf.nb_node_patterns = nb_patterns;\n \n \t/* Pcap config */\n \tgraph_conf.pcap_enable = pcap_trace_enable;\n \tgraph_conf.num_pkt_to_capture = packet_to_capture;\n \tgraph_conf.pcap_filename = pcap_filename;\n \n-\tfor (lcore_id = 0; lcore_id < RTE_MAX_LCORE; lcore_id++) {\n-\t\trte_graph_t graph_id;\n-\t\trte_edge_t i;\n-\n-\t\tif (rte_lcore_is_enabled(lcore_id) == 0)\n-\t\t\tcontinue;\n-\n-\t\tqconf = &lcore_conf[lcore_id];\n-\n-\t\t/* Skip graph creation if no source exists */\n-\t\tif (!qconf->n_rx_queue)\n-\t\t\tcontinue;\n-\n-\t\t/* Add rx node patterns of this lcore */\n-\t\tfor (i = 0; i < qconf->n_rx_queue; i++) {\n-\t\t\tgraph_conf.node_patterns[nb_patterns + i] =\n-\t\t\t\tqconf->rx_queue_list[i].node_name;\n-\t\t}\n-\n-\t\tgraph_conf.nb_node_patterns = nb_patterns + i;\n-\t\tgraph_conf.socket_id = rte_lcore_to_socket_id(lcore_id);\n-\n-\t\tsnprintf(qconf->name, sizeof(qconf->name), \"worker_%u\",\n-\t\t\t lcore_id);\n-\n-\t\tgraph_id = rte_graph_create(qconf->name, &graph_conf);\n-\t\tif (graph_id == RTE_GRAPH_ID_INVALID)\n-\t\t\trte_exit(EXIT_FAILURE,\n-\t\t\t\t \"rte_graph_create(): graph_id invalid\"\n-\t\t\t\t \" for lcore %u\\n\", lcore_id);\n+\tif (model_conf == RTE_GRAPH_MODEL_MCORE_DISPATCH)\n+\t\tgraph_config_mcore_dispatch(graph_conf);\n+\telse\n+\t\tgraph_config_rtc(graph_conf);\n \n-\t\tqconf->graph_id = graph_id;\n-\t\tqconf->graph = rte_graph_lookup(qconf->name);\n-\t\t/* >8 End of graph initialization. */\n-\t\tif (!qconf->graph)\n-\t\t\trte_exit(EXIT_FAILURE,\n-\t\t\t\t \"rte_graph_lookup(): graph %s not found\\n\",\n-\t\t\t\t qconf->name);\n-\t}\n+\trte_graph_worker_model_set(model_conf);\n+\t/* >8 End of graph initialization. */\n \n \tmemset(&rewrite_data, 0, sizeof(rewrite_data));\n \trewrite_len = sizeof(rewrite_data);\n",
    "prefixes": [
        "v12",
        "16/16"
    ]
}