Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/132011/?format=api
http://patchwork.dpdk.org/api/patches/132011/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20230927115412.55018-10-skori@marvell.com/", "project": { "id": 1, "url": "http://patchwork.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": "<20230927115412.55018-10-skori@marvell.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20230927115412.55018-10-skori@marvell.com", "date": "2023-09-27T11:54:09", "name": "[v7,09/12] app/graph: add ethdev_rx command line interfaces", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "872f8f9a11c713975032219b566973cebcb44c55", "submitter": { "id": 1318, "url": "http://patchwork.dpdk.org/api/people/1318/?format=api", "name": "Sunil Kumar Kori", "email": "skori@marvell.com" }, "delegate": { "id": 1, "url": "http://patchwork.dpdk.org/api/users/1/?format=api", "username": "tmonjalo", "first_name": "Thomas", "last_name": "Monjalon", "email": "thomas@monjalon.net" }, "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20230927115412.55018-10-skori@marvell.com/mbox/", "series": [ { "id": 29655, "url": "http://patchwork.dpdk.org/api/series/29655/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=29655", "date": "2023-09-27T11:54:00", "name": "add CLI based graph application", "version": 7, "mbox": "http://patchwork.dpdk.org/series/29655/mbox/" } ], "comments": "http://patchwork.dpdk.org/api/patches/132011/comments/", "check": "success", "checks": "http://patchwork.dpdk.org/api/patches/132011/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 7CFA042651;\n\tWed, 27 Sep 2023 13:55:30 +0200 (CEST)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 3E03440E8A;\n\tWed, 27 Sep 2023 13:54:45 +0200 (CEST)", "from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com\n [67.231.156.173])\n by mails.dpdk.org (Postfix) with ESMTP id 4A1F140DF5\n for <dev@dpdk.org>; Wed, 27 Sep 2023 13:54:38 +0200 (CEST)", "from pps.filterd (m0045851.ppops.net [127.0.0.1])\n by mx0b-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id\n 38R0M9Jq029231 for <dev@dpdk.org>; Wed, 27 Sep 2023 04:54:37 -0700", "from dc5-exch01.marvell.com ([199.233.59.181])\n by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3t9yhm6a4t-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT)\n for <dev@dpdk.org>; Wed, 27 Sep 2023 04:54:37 -0700", "from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH01.marvell.com\n (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.48;\n Wed, 27 Sep 2023 04:54:35 -0700", "from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com\n (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.48 via Frontend\n Transport; Wed, 27 Sep 2023 04:54:35 -0700", "from localhost.localdomain (unknown [10.28.34.25])\n by maili.marvell.com (Postfix) with ESMTP id 270D93F709D;\n Wed, 27 Sep 2023 04:54:33 -0700 (PDT)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com;\n h=from : to : cc :\n subject : date : message-id : in-reply-to : references : mime-version :\n content-transfer-encoding : content-type; s=pfpt0220;\n bh=ChRk8j4rNBNZ1ZeVAlwYEYzD47ouZJAhABg6l5mbLW0=;\n b=V1UGyMY9zOKuH1WxvenA/wIGXAx+830tZAefuMQV66tEtbYESZwEAJPtCsBZJcBte2Vm\n 57rTcefjYCtJU1WXKz4TrhOzRdIkSThyHb1In0PzDbg4b6quFsGQbqlcr/Iu8Qc4rh0k\n WlLvHvehIXens9foRiRbrvbUEu4mz64uOmLdvDNa/5fdnE6qtQIAJ95oaUUoLlyxcw2b\n P46LSM/2vZ7TgBnuLjg612kKJiVALukjT/ZLL9DBTwGygAUhnRgs1JuzeMryirvMps4D\n JHUrNv9aM2KF5LPs/bj0hNF3kDMkB6dermi87+V+vnWiOlH+PUwOtIWSEe6rOQtIbOyB Kg==", "From": "<skori@marvell.com>", "To": "Sunil Kumar Kori <skori@marvell.com>, Rakesh Kudurumalla\n <rkudurumalla@marvell.com>", "CC": "<dev@dpdk.org>", "Subject": "[PATCH v7 09/12] app/graph: add ethdev_rx command line interfaces", "Date": "Wed, 27 Sep 2023 17:24:09 +0530", "Message-ID": "<20230927115412.55018-10-skori@marvell.com>", "X-Mailer": "git-send-email 2.25.1", "In-Reply-To": "<20230927115412.55018-1-skori@marvell.com>", "References": "<20230926105742.2638594-13-skori@marvell.com>\n <20230927115412.55018-1-skori@marvell.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Content-Type": "text/plain", "X-Proofpoint-GUID": "KGJ8a8DeUCLg_rP2dE08sMhnx3SelEqZ", "X-Proofpoint-ORIG-GUID": "KGJ8a8DeUCLg_rP2dE08sMhnx3SelEqZ", "X-Proofpoint-Virus-Version": "vendor=baseguard\n engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26\n definitions=2023-09-27_06,2023-09-27_01,2023-05-22_02", "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": "From: Rakesh Kudurumalla <rkudurumalla@marvell.com>\n\nIt adds ethdev_rx module to create port-queue-core mapping.\n\nMapping will be used to launch graph worker thread and dequeue\npackets on mentioned core from desired port/queue.\n\nFollowing commands are exposed:\n - ethdev_rx map port <ethdev_name> queue <q_num> core <core_id>\n - help ethdev_rx\n\nSigned-off-by: Sunil Kumar Kori <skori@marvell.com>\nSigned-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>\n---\n app/graph/cli.c | 2 +\n app/graph/ethdev_rx.c | 165 +++++++++++++++++++++++++++++++++++++\n app/graph/ethdev_rx.h | 37 +++++++++\n app/graph/ethdev_rx_priv.h | 39 +++++++++\n app/graph/meson.build | 1 +\n app/graph/module_api.h | 1 +\n doc/guides/tools/graph.rst | 10 +++\n 7 files changed, 255 insertions(+)\n create mode 100644 app/graph/ethdev_rx.c\n create mode 100644 app/graph/ethdev_rx.h\n create mode 100644 app/graph/ethdev_rx_priv.h", "diff": "diff --git a/app/graph/cli.c b/app/graph/cli.c\nindex 36338d5173..e947f61ee4 100644\n--- a/app/graph/cli.c\n+++ b/app/graph/cli.c\n@@ -30,6 +30,8 @@ cmdline_parse_ctx_t modules_ctx[] = {\n \t(cmdline_parse_inst_t *)ðdev_ip6_cmd_ctx,\n \t(cmdline_parse_inst_t *)ðdev_cmd_ctx,\n \t(cmdline_parse_inst_t *)ðdev_help_cmd_ctx,\n+\t(cmdline_parse_inst_t *)ðdev_rx_cmd_ctx,\n+\t(cmdline_parse_inst_t *)ðdev_rx_help_cmd_ctx,\n \t(cmdline_parse_inst_t *)&ipv4_lookup_cmd_ctx,\n \t(cmdline_parse_inst_t *)&ipv4_lookup_help_cmd_ctx,\n \t(cmdline_parse_inst_t *)&ipv6_lookup_cmd_ctx,\ndiff --git a/app/graph/ethdev_rx.c b/app/graph/ethdev_rx.c\nnew file mode 100644\nindex 0000000000..f2cb8cf9a5\n--- /dev/null\n+++ b/app/graph/ethdev_rx.c\n@@ -0,0 +1,165 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(c) 2023 Marvell.\n+ */\n+\n+#include <stdlib.h>\n+#include <string.h>\n+\n+#include <cmdline_parse.h>\n+#include <cmdline_parse_num.h>\n+#include <cmdline_parse_string.h>\n+#include <cmdline_socket.h>\n+#include <rte_ethdev.h>\n+\n+#include \"ethdev_rx_priv.h\"\n+#include \"module_api.h\"\n+\n+static const char\n+cmd_ethdev_rx_help[] = \"ethdev_rx map port <ethdev_name> queue <q_num> core <core_id>\";\n+\n+static struct lcore_params lcore_params_array[ETHDEV_RX_LCORE_PARAMS_MAX];\n+struct rte_node_ethdev_config ethdev_conf[RTE_MAX_ETHPORTS];\n+struct lcore_params *lcore_params = lcore_params_array;\n+struct lcore_conf lcore_conf[RTE_MAX_LCORE];\n+uint16_t nb_lcore_params;\n+\n+static void\n+rx_map_configure(uint8_t port_id, uint32_t queue, uint32_t core)\n+{\n+\tuint8_t n_rx_queue;\n+\n+\tn_rx_queue = lcore_conf[core].n_rx_queue;\n+\tlcore_conf[core].rx_queue_list[n_rx_queue].port_id = port_id;\n+\tlcore_conf[core].rx_queue_list[n_rx_queue].queue_id = queue;\n+\tlcore_conf[core].n_rx_queue++;\n+}\n+\n+uint8_t\n+ethdev_rx_num_rx_queues_get(uint16_t port)\n+{\n+\tint queue = -1;\n+\tuint16_t i;\n+\n+\tfor (i = 0; i < nb_lcore_params; ++i) {\n+\t\tif (lcore_params[i].port_id == port) {\n+\t\t\tif (lcore_params[i].queue_id == queue + 1)\n+\t\t\t\tqueue = lcore_params[i].queue_id;\n+\t\t\telse\n+\t\t\t\trte_exit(EXIT_FAILURE,\n+\t\t\t\t\t \"Queue ids of the port %d must be\"\n+\t\t\t\t\t \" in sequence and must start with 0\\n\",\n+\t\t\t\t\t lcore_params[i].port_id);\n+\t\t}\n+\t}\n+\n+\treturn (uint8_t)(++queue);\n+}\n+\n+static int\n+ethdev_rx_map_add(char *name, uint32_t queue, uint32_t core)\n+{\n+\tuint64_t coremask;\n+\tuint16_t port_id;\n+\tint rc;\n+\n+\tif (nb_lcore_params >= ETHDEV_RX_LCORE_PARAMS_MAX)\n+\t\treturn -EINVAL;\n+\n+\trc = rte_eth_dev_get_port_by_name(name, &port_id);\n+\tif (rc)\n+\t\treturn -EINVAL;\n+\n+\tcoremask = 0xff; /* FIXME: Read from graph configuration */\n+\n+\tif (!(coremask & (1 << core)))\n+\t\treturn -EINVAL;\n+\n+\trx_map_configure(port_id, queue, core);\n+\n+\tlcore_params_array[nb_lcore_params].port_id = port_id;\n+\tlcore_params_array[nb_lcore_params].queue_id = queue;\n+\tlcore_params_array[nb_lcore_params].lcore_id = core;\n+\tnb_lcore_params++;\n+\treturn 0;\n+}\n+\n+static void\n+cli_ethdev_rx_help(__rte_unused void *parsed_result, __rte_unused struct cmdline *cl,\n+\t\t __rte_unused void *data)\n+{\n+\tsize_t len;\n+\n+\tlen = strlen(conn->msg_out);\n+\tconn->msg_out += len;\n+\tsnprintf(conn->msg_out, conn->msg_out_len_max, \"\\n%s\\n%s\\n\",\n+\t\t \"----------------------------- ethdev_rx command help -----------------------------\",\n+\t\t cmd_ethdev_rx_help);\n+\n+\tlen = strlen(conn->msg_out);\n+\tconn->msg_out_len_max -= len;\n+}\n+\n+static void\n+cli_ethdev_rx(void *parsed_result, __rte_unused struct cmdline *cl, void *data __rte_unused)\n+{\n+\tstruct ethdev_rx_cmd_tokens *res = parsed_result;\n+\tint rc = -EINVAL;\n+\n+\trc = ethdev_rx_map_add(res->dev, res->qid, res->core_id);\n+\tif (rc < 0) {\n+\t\tcli_exit();\n+\t\tprintf(MSG_CMD_FAIL, res->cmd);\n+\t\trte_exit(EXIT_FAILURE, \"input core is Invalid\\n\");\n+\t}\n+\n+}\n+\n+cmdline_parse_token_string_t ethdev_rx_cmd =\n+\tTOKEN_STRING_INITIALIZER(struct ethdev_rx_cmd_tokens, cmd, \"ethdev_rx\");\n+cmdline_parse_token_string_t ethdev_rx_map =\n+\tTOKEN_STRING_INITIALIZER(struct ethdev_rx_cmd_tokens, map, \"map\");\n+cmdline_parse_token_string_t ethdev_rx_port =\n+\tTOKEN_STRING_INITIALIZER(struct ethdev_rx_cmd_tokens, port, \"port\");\n+cmdline_parse_token_string_t ethdev_rx_dev =\n+\tTOKEN_STRING_INITIALIZER(struct ethdev_rx_cmd_tokens, dev, NULL);\n+cmdline_parse_token_string_t ethdev_rx_queue =\n+\tTOKEN_STRING_INITIALIZER(struct ethdev_rx_cmd_tokens, queue, \"queue\");\n+cmdline_parse_token_num_t ethdev_rx_qid =\n+\tTOKEN_NUM_INITIALIZER(struct ethdev_rx_cmd_tokens, qid, RTE_UINT32);\n+cmdline_parse_token_string_t ethdev_rx_core =\n+\tTOKEN_STRING_INITIALIZER(struct ethdev_rx_cmd_tokens, core, \"core\");\n+cmdline_parse_token_num_t ethdev_rx_core_id =\n+\tTOKEN_NUM_INITIALIZER(struct ethdev_rx_cmd_tokens, core_id, RTE_UINT32);\n+\n+cmdline_parse_inst_t ethdev_rx_cmd_ctx = {\n+\t.f = cli_ethdev_rx,\n+\t.data = NULL,\n+\t.help_str = cmd_ethdev_rx_help,\n+\t.tokens = {\n+\t\t(void *)ðdev_rx_cmd,\n+\t\t(void *)ðdev_rx_map,\n+\t\t(void *)ðdev_rx_port,\n+\t\t(void *)ðdev_rx_dev,\n+\t\t(void *)ðdev_rx_queue,\n+\t\t(void *)ðdev_rx_qid,\n+\t\t(void *)ðdev_rx_core,\n+\t\t(void *)ðdev_rx_core_id,\n+\t\tNULL,\n+\t},\n+};\n+\n+cmdline_parse_token_string_t ethdev_rx_help_cmd =\n+\tTOKEN_STRING_INITIALIZER(struct ethdev_rx_help_cmd_tokens, cmd, \"help\");\n+cmdline_parse_token_string_t ethdev_rx_help_module =\n+\tTOKEN_STRING_INITIALIZER(struct ethdev_rx_help_cmd_tokens, module, \"ethdev_rx\");\n+\n+cmdline_parse_inst_t ethdev_rx_help_cmd_ctx = {\n+\t.f = cli_ethdev_rx_help,\n+\t.data = NULL,\n+\t.help_str = \"\",\n+\t.tokens = {\n+\t\t(void *)ðdev_rx_help_cmd,\n+\t\t(void *)ðdev_rx_help_module,\n+\t\tNULL,\n+\t},\n+};\ndiff --git a/app/graph/ethdev_rx.h b/app/graph/ethdev_rx.h\nnew file mode 100644\nindex 0000000000..8e7b31448c\n--- /dev/null\n+++ b/app/graph/ethdev_rx.h\n@@ -0,0 +1,37 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(c) 2023 Marvell.\n+ */\n+\n+#ifndef APP_GRAPH_ETHDEV_RX_H\n+#define APP_GRAPH_ETHDEV_RX_H\n+\n+#include <rte_graph.h>\n+#include <rte_node_eth_api.h>\n+\n+#define ETHDEV_RX_LCORE_PARAMS_MAX 1024\n+#define ETHDEV_RX_QUEUE_PER_LCORE_MAX 16\n+\n+struct lcore_rx_queue {\n+\tuint16_t port_id;\n+\tuint8_t queue_id;\n+\tchar node_name[RTE_NODE_NAMESIZE];\n+};\n+\n+struct lcore_conf {\n+\tuint16_t n_rx_queue;\n+\tstruct lcore_rx_queue rx_queue_list[ETHDEV_RX_QUEUE_PER_LCORE_MAX];\n+\tstruct rte_graph *graph;\n+\tchar name[RTE_GRAPH_NAMESIZE];\n+\trte_graph_t graph_id;\n+} __rte_cache_aligned;\n+\n+uint8_t ethdev_rx_num_rx_queues_get(uint16_t port);\n+\n+extern struct rte_node_ethdev_config ethdev_conf[RTE_MAX_ETHPORTS];\n+extern struct lcore_conf lcore_conf[RTE_MAX_LCORE];\n+extern cmdline_parse_inst_t ethdev_rx_help_cmd_ctx;\n+extern cmdline_parse_inst_t ethdev_rx_cmd_ctx;\n+extern struct lcore_params *lcore_params;\n+extern uint16_t nb_lcore_params;\n+\n+#endif\ndiff --git a/app/graph/ethdev_rx_priv.h b/app/graph/ethdev_rx_priv.h\nnew file mode 100644\nindex 0000000000..5d155be043\n--- /dev/null\n+++ b/app/graph/ethdev_rx_priv.h\n@@ -0,0 +1,39 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(c) 2023 Marvell.\n+ */\n+\n+#ifndef APP_GRAPH_ETHDEV_RX_PRIV_H\n+#define APP_GRAPH_ETHDEV_RX_PRIV_H\n+\n+#include <stdint.h>\n+\n+#include <rte_graph.h>\n+#include <rte_node_eth_api.h>\n+\n+#define MAX_RX_QUEUE_PER_PORT 128\n+#define MAX_JUMBO_PKT_LEN 9600\n+#define NB_SOCKETS 8\n+\n+struct ethdev_rx_cmd_tokens {\n+\tcmdline_fixed_string_t cmd;\n+\tcmdline_fixed_string_t map;\n+\tcmdline_fixed_string_t port;\n+\tcmdline_fixed_string_t dev;\n+\tcmdline_fixed_string_t queue;\n+\tcmdline_fixed_string_t core;\n+\tuint32_t core_id;\n+\tuint32_t qid;\n+};\n+\n+struct ethdev_rx_help_cmd_tokens {\n+\tcmdline_fixed_string_t cmd;\n+\tcmdline_fixed_string_t module;\n+};\n+\n+struct lcore_params {\n+\tuint16_t port_id;\n+\tuint8_t queue_id;\n+\tuint8_t lcore_id;\n+} __rte_cache_aligned;\n+\n+#endif\ndiff --git a/app/graph/meson.build b/app/graph/meson.build\nindex 39fe0b984f..cafab04f70 100644\n--- a/app/graph/meson.build\n+++ b/app/graph/meson.build\n@@ -12,6 +12,7 @@ deps += ['bus_pci', 'graph', 'eal', 'lpm', 'ethdev', 'node', 'cmdline']\n sources = files(\n 'cli.c',\n 'conn.c',\n+ 'ethdev_rx.c',\n 'ethdev.c',\n 'ip4_route.c',\n 'ip6_route.c',\ndiff --git a/app/graph/module_api.h b/app/graph/module_api.h\nindex e9e42da7cc..56b7c94ecc 100644\n--- a/app/graph/module_api.h\n+++ b/app/graph/module_api.h\n@@ -11,6 +11,7 @@\n #include \"cli.h\"\n #include \"conn.h\"\n #include \"ethdev.h\"\n+#include \"ethdev_rx.h\"\n #include \"mempool.h\"\n #include \"neigh.h\"\n #include \"route.h\"\ndiff --git a/doc/guides/tools/graph.rst b/doc/guides/tools/graph.rst\nindex 9ec801aa64..f2920ff136 100644\n--- a/doc/guides/tools/graph.rst\n+++ b/doc/guides/tools/graph.rst\n@@ -154,6 +154,16 @@ file to express the requested use case configuration.\n - Command to dump neigh help message\n - Yes\n - Yes\n+ * - ethdev_rx map port <ethdev_name> queue <q_num> core <core_id>\n+ - Command to add port-queue-core mapping to ``ethdev_rx`` node. ``ethdev_rx``\n+ node instance will be pinned on given core and will poll on requested\n+ port/queue pair.\n+ - No\n+ - No\n+ * - help ethdev_rx\n+ - Command to dump ethdev_rx help message\n+ - Yes\n+ - Yes\n \n Runtime configuration\n ---------------------\n", "prefixes": [ "v7", "09/12" ] }{ "id": 132011, "url": "