Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/135379/?format=api
https://patches.dpdk.org/api/patches/135379/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/20231220085942.759954-2-rkudurumalla@marvell.com/", "project": { "id": 1, "url": "https://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": "<20231220085942.759954-2-rkudurumalla@marvell.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20231220085942.759954-2-rkudurumalla@marvell.com", "date": "2023-12-20T08:59:41", "name": "[v6,2/3] app/graph: add ethdev forward command", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "584e5deac6a57825ad1accdddf0859b5588da539", "submitter": { "id": 2289, "url": "https://patches.dpdk.org/api/people/2289/?format=api", "name": "Rakesh Kudurumalla", "email": "rkudurumalla@marvell.com" }, "delegate": { "id": 1, "url": "https://patches.dpdk.org/api/users/1/?format=api", "username": "tmonjalo", "first_name": "Thomas", "last_name": "Monjalon", "email": "thomas@monjalon.net" }, "mbox": "https://patches.dpdk.org/project/dpdk/patch/20231220085942.759954-2-rkudurumalla@marvell.com/mbox/", "series": [ { "id": 30624, "url": "https://patches.dpdk.org/api/series/30624/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=30624", "date": "2023-12-20T08:59:40", "name": "[v6,1/3] node: support to add next node to ethdev Rx node", "version": 6, "mbox": "https://patches.dpdk.org/series/30624/mbox/" } ], "comments": "https://patches.dpdk.org/api/patches/135379/comments/", "check": "warning", "checks": "https://patches.dpdk.org/api/patches/135379/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 0A1F543731;\n\tWed, 20 Dec 2023 09:59:58 +0100 (CET)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 9F66240A4B;\n\tWed, 20 Dec 2023 09:59:54 +0100 (CET)", "from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com\n [67.231.156.173])\n by mails.dpdk.org (Postfix) with ESMTP id 230E140689\n for <dev@dpdk.org>; Wed, 20 Dec 2023 09:59:53 +0100 (CET)", "from pps.filterd (m0045851.ppops.net [127.0.0.1])\n by mx0b-0016f401.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id\n 3BK0WruV028376 for <dev@dpdk.org>; Wed, 20 Dec 2023 00:59:52 -0800", "from dc5-exch01.marvell.com ([199.233.59.181])\n by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3v3ntrh9f2-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT)\n for <dev@dpdk.org>; Wed, 20 Dec 2023 00:59:52 -0800 (PST)", "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, 20 Dec 2023 00:59:50 -0800", "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, 20 Dec 2023 00:59:50 -0800", "from localhost.localdomain (unknown [10.28.36.154])\n by maili.marvell.com (Postfix) with ESMTP id 361B63F7048;\n Wed, 20 Dec 2023 00:59:47 -0800 (PST)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=\n from:to:cc:subject:date:message-id:in-reply-to:references\n :mime-version:content-transfer-encoding:content-type; s=\n pfpt0220; bh=ouWCJwem6AjLjrM4HS1qUp+gArntD3QpXTWaSEzAM/c=; b=cEQ\n IpSlvWJ5Ntv8XHBAZRi+dWCg29q1kwq7BQJNRBq2Xt+2wEiLJDVbVqHJNN9NmuHo\n ltcV+UY4868PmH/iMnjFIf4owuI4dYK6XMK5rSBlKcb6wnr3sMK2opfgR7KnAtEF\n 6Lt7syeECFS9BF4UrIcRlAZlLBUewbr0cAUwkgUeDJC6pd3Vnqs6JWbMvayeIZR/\n FKfBd9GwevD6hx69v3GeAXHVd33h3UqS1nhyGQUdPnbpKfPIgM1evMW8mXMhBhwB\n qytMLnkwBEUiOP5ZG8qj/Sd96+Uns/MxyNWjc3v3QGBqifZmz48pqjvu39DwHWd9\n NK6hUnz3loiU3zNPHtQ==", "From": "Rakesh Kudurumalla <rkudurumalla@marvell.com>", "To": "Sunil Kumar Kori <skori@marvell.com>, Rakesh Kudurumalla\n <rkudurumalla@marvell.com>", "CC": "<dev@dpdk.org>, <jerinj@marvell.com>, <ndabilpuram@marvell.com>", "Subject": "[PATCH v6 2/3] app/graph: add ethdev forward command", "Date": "Wed, 20 Dec 2023 14:29:41 +0530", "Message-ID": "<20231220085942.759954-2-rkudurumalla@marvell.com>", "X-Mailer": "git-send-email 2.25.1", "In-Reply-To": "<20231220085942.759954-1-rkudurumalla@marvell.com>", "References": "<20231215091551.298964-1-rkudurumalla@marvell.com>\n <20231220085942.759954-1-rkudurumalla@marvell.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Content-Type": "text/plain", "X-Proofpoint-GUID": "YfNGjzbAQlzPkV5j50zRndm9xf4eyBre", "X-Proofpoint-ORIG-GUID": "YfNGjzbAQlzPkV5j50zRndm9xf4eyBre", "X-Proofpoint-Virus-Version": "vendor=baseguard\n engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26\n definitions=2023-12-09_02,2023-12-07_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": "Adds a txport to forward packet for every rxport\n\nMapping will be used to forward packets to txport\nreceived on rxport\n\nFollowing commands are exposed:\n\t- ethdev forward <tx_dev_name> <rx_dev_name>\"\n\nSigned-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>\n---\n app/graph/cli.c | 1 +\n app/graph/ethdev.c | 63 ++++++++++++++++++++++++++++++++++++++\n app/graph/ethdev.h | 1 +\n app/graph/ethdev_priv.h | 8 +++++\n doc/guides/tools/graph.rst | 4 +++\n 5 files changed, 77 insertions(+)", "diff": "diff --git a/app/graph/cli.c b/app/graph/cli.c\nindex 30b12312d6..76f5b8e670 100644\n--- a/app/graph/cli.c\n+++ b/app/graph/cli.c\n@@ -32,6 +32,7 @@ cmdline_parse_ctx_t modules_ctx[] = {\n \t(cmdline_parse_inst_t *)ðdev_prom_mode_cmd_ctx,\n \t(cmdline_parse_inst_t *)ðdev_ip4_cmd_ctx,\n \t(cmdline_parse_inst_t *)ðdev_ip6_cmd_ctx,\n+\t(cmdline_parse_inst_t *)ðdev_forward_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,\ndiff --git a/app/graph/ethdev.c b/app/graph/ethdev.c\nindex c9b09168c1..bb502a6134 100644\n--- a/app/graph/ethdev.c\n+++ b/app/graph/ethdev.c\n@@ -38,6 +38,9 @@ cmd_ethdev_ip4_addr_help[] = \"ethdev <ethdev_name> ip4 addr add <ip> netmask <ma\n static const char\n cmd_ethdev_ip6_addr_help[] = \"ethdev <ethdev_name> ip6 addr add <ip> netmask <mask>\";\n \n+static const char\n+cmd_ethdev_forward_help[] = \"ethdev forward <tx_dev_name> <rx_dev_name>\";\n+\n static struct rte_eth_conf port_conf_default = {\n \t.link_speeds = 0,\n \t.rxmode = {\n@@ -888,3 +891,63 @@ cmdline_parse_inst_t ethdev_help_cmd_ctx = {\n \t\tNULL,\n \t},\n };\n+\n+static int\n+ethdev_forward_config(char *tx_dev, char *rx_dev)\n+{\n+\tuint16_t portid_rx = 0;\n+\tuint16_t portid_tx = 0;\n+\tstruct ethdev *port;\n+\tint rc = -EINVAL;\n+\n+\trc = rte_eth_dev_get_port_by_name(tx_dev, &portid_tx);\n+\tif (rc < 0)\n+\t\treturn rc;\n+\n+\trc = rte_eth_dev_get_port_by_name(rx_dev, &portid_rx);\n+\tif (rc < 0)\n+\t\treturn rc;\n+\n+\tport = ethdev_port_by_id(portid_rx);\n+\tif (port) {\n+\t\tport->tx_port_id = portid_tx;\n+\t\trc = 0;\n+\t} else {\n+\t\trc = -EINVAL;\n+\t}\n+\n+\treturn rc;\n+}\n+\n+static void\n+cli_ethdev_forward(void *parsed_result, __rte_unused struct cmdline *cl, void *data __rte_unused)\n+{\n+\tstruct ethdev_fwd_cmd_tokens *res = parsed_result;\n+\tint rc = -EINVAL;\n+\n+\trc = ethdev_forward_config(res->tx_dev, res->rx_dev);\n+\tif (rc < 0)\n+\t\tprintf(MSG_CMD_FAIL, res->cmd);\n+}\n+\n+cmdline_parse_token_string_t ethdev_fwd_cfg =\n+\tTOKEN_STRING_INITIALIZER(struct ethdev_fwd_cmd_tokens, cmd, \"ethdev\");\n+cmdline_parse_token_string_t ethdev_fwd_cmd =\n+\tTOKEN_STRING_INITIALIZER(struct ethdev_fwd_cmd_tokens, fwd, \"forward\");\n+cmdline_parse_token_string_t ethdev_tx_device =\n+\tTOKEN_STRING_INITIALIZER(struct ethdev_fwd_cmd_tokens, tx_dev, NULL);\n+cmdline_parse_token_string_t ethdev_rx_device =\n+\tTOKEN_STRING_INITIALIZER(struct ethdev_fwd_cmd_tokens, rx_dev, NULL);\n+\n+cmdline_parse_inst_t ethdev_forward_cmd_ctx = {\n+\t.f = cli_ethdev_forward,\n+\t.data = NULL,\n+\t.help_str = cmd_ethdev_forward_help,\n+\t.tokens = {\n+\t (void *)ðdev_fwd_cfg,\n+\t (void *)ðdev_fwd_cmd,\n+\t (void *)ðdev_tx_device,\n+\t (void *)ðdev_rx_device,\n+\t NULL,\n+\t},\n+};\ndiff --git a/app/graph/ethdev.h b/app/graph/ethdev.h\nindex 94d3247a2c..836052046b 100644\n--- a/app/graph/ethdev.h\n+++ b/app/graph/ethdev.h\n@@ -15,6 +15,7 @@ extern cmdline_parse_inst_t ethdev_mtu_cmd_ctx;\n extern cmdline_parse_inst_t ethdev_prom_mode_cmd_ctx;\n extern cmdline_parse_inst_t ethdev_ip4_cmd_ctx;\n extern cmdline_parse_inst_t ethdev_ip6_cmd_ctx;\n+extern cmdline_parse_inst_t ethdev_forward_cmd_ctx;\n extern cmdline_parse_inst_t ethdev_cmd_ctx;\n extern cmdline_parse_inst_t ethdev_help_cmd_ctx;\n \ndiff --git a/app/graph/ethdev_priv.h b/app/graph/ethdev_priv.h\nindex f231f3f3e1..af79553438 100644\n--- a/app/graph/ethdev_priv.h\n+++ b/app/graph/ethdev_priv.h\n@@ -61,6 +61,13 @@ struct ethdev_ip6_cmd_tokens {\n \tcmdline_fixed_string_t mask;\n };\n \n+struct ethdev_fwd_cmd_tokens {\n+\tcmdline_fixed_string_t cmd;\n+\tcmdline_fixed_string_t fwd;\n+\tcmdline_fixed_string_t tx_dev;\n+\tcmdline_fixed_string_t rx_dev;\n+};\n+\n struct ethdev_cmd_tokens {\n \tcmdline_fixed_string_t cmd;\n \tcmdline_fixed_string_t dev;\n@@ -104,6 +111,7 @@ struct ethdev_config {\n \n struct ethdev {\n \tTAILQ_ENTRY(ethdev) next;\n+\tuint16_t tx_port_id;\n \tstruct ethdev_config config;\n \tstruct ipv4_addr_config ip4_addr;\n \tstruct ipv6_addr_config ip6_addr;\ndiff --git a/doc/guides/tools/graph.rst b/doc/guides/tools/graph.rst\nindex 1855d12891..0b07c12cec 100644\n--- a/doc/guides/tools/graph.rst\n+++ b/doc/guides/tools/graph.rst\n@@ -195,6 +195,9 @@ file to express the requested use case configuration.\n | ethdev <ethdev_name> mtu <mtu_sz> | | Command to configure MTU of DPDK| Yes | Yes |\n | | | port. | | |\n +--------------------------------------+-----------------------------------+---------+----------+\n+ | ethdev forward <tx_dev_name> | | Command to configure port | No | Yes |\n+ | <rx_dev_name> | | forwading of DPDK | | |\n+ +--------------------------------------+-----------------------------------+---------+----------+\n | | ethdev <ethdev_name> promiscuous | | Command to enable/disable | Yes | Yes |\n | | <on/off> | | promiscuous mode on DPDK port. | | |\n +--------------------------------------+-----------------------------------+---------+----------+\n@@ -297,6 +300,7 @@ Example: ``dpdk-graph`` is started with ``-h 10.28.35.207`` and ``-p 50000`` the\n ethdev <ethdev_name> rxq <n_queues> txq <n_queues> <mempool_name>\n ethdev <ethdev_name> ip4 addr add <ip> netmask <mask>\n ethdev <ethdev_name> ip6 addr add <ip> netmask <mask>\n+ ethdev forward <tx_dev_name> <rx_dev_name>\n ethdev <ethdev_name> promiscuous <on/off>\n ethdev <ethdev_name> mtu <mtu_sz>\n ethdev <ethdev_name> stats\n", "prefixes": [ "v6", "2/3" ] }{ "id": 135379, "url": "