get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 134813,
    "url": "https://patches.dpdk.org/api/patches/134813/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20231204180415.1212837-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": "<20231204180415.1212837-2-rkudurumalla@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20231204180415.1212837-2-rkudurumalla@marvell.com",
    "date": "2023-12-04T18:04:14",
    "name": "[v2,2/3] app/graph: add ethdev forward command",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "604896d01f51de21fd913f3174eadf9d9a2179fe",
    "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/20231204180415.1212837-2-rkudurumalla@marvell.com/mbox/",
    "series": [
        {
            "id": 30444,
            "url": "https://patches.dpdk.org/api/series/30444/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=30444",
            "date": "2023-12-04T18:04:13",
            "name": "[v2,1/3] node: support to add next node to ethdev Rx node",
            "version": 2,
            "mbox": "https://patches.dpdk.org/series/30444/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/134813/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/134813/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 302FB4366C;\n\tMon,  4 Dec 2023 19:04:29 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 668DD41109;\n\tMon,  4 Dec 2023 19:04:27 +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 A6FCE41101\n for <dev@dpdk.org>; Mon,  4 Dec 2023 19:04:26 +0100 (CET)",
            "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 3B4HsxkZ032577 for <dev@dpdk.org>; Mon, 4 Dec 2023 10:04:26 -0800",
            "from dc5-exch02.marvell.com ([199.233.59.182])\n by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3ur4yrp5ea-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT)\n for <dev@dpdk.org>; Mon, 04 Dec 2023 10:04:25 -0800",
            "from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH02.marvell.com\n (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.48;\n Mon, 4 Dec 2023 10:04:23 -0800",
            "from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com\n (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.48 via Frontend\n Transport; Mon, 4 Dec 2023 10:04:23 -0800",
            "from localhost.localdomain (unknown [10.28.36.154])\n by maili.marvell.com (Postfix) with ESMTP id D3BBE3F709C;\n Mon,  4 Dec 2023 10:04:21 -0800 (PST)"
        ],
        "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=CZHM07lCXioNMJolAh1SarWf9ZXUX4JkEEUkozhBELM=;\n b=OcMm6k/KAN+g/7gUB2xhQmollMV1OhUQcssD7tv9gWyZiMQpw9ukcptGCiia4eErDyoX\n 01sQxyAcSazBrlJAT4KmvuwmWBgaeBI+FgOVLzbIrNzEKpiSljF7tMmvTy/TG8qbnIYh\n D98UrhJ9wajBcmx2Xve1nSIdfC/dhPeJxbR2NX65A9B/pFi0qeXJrfZsSVlRQ8uPrub0\n +CwelU7G+Wo9dsaQnt1t7EhoQykzDQk/93MnD+WQPTZ4Yi1R40CzUUGcNXd/+pWhLEIN\n WHfwWGhZtWCWAzdqQ/G5hdTdk2xJk63pAbGhs2oteA7JY88qRzJCZlvDopIO6VVPTlGv Fw==",
        "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 v2 2/3] app/graph: add ethdev forward command",
        "Date": "Mon, 4 Dec 2023 23:34:14 +0530",
        "Message-ID": "<20231204180415.1212837-2-rkudurumalla@marvell.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20231204180415.1212837-1-rkudurumalla@marvell.com>",
        "References": "<20231123061555.469038-1-rkudurumalla@marvell.com>\n <20231204180415.1212837-1-rkudurumalla@marvell.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-Proofpoint-GUID": "KI45q-YJmrODcKguvOOn_Qo4zAXRhGa3",
        "X-Proofpoint-ORIG-GUID": "KI45q-YJmrODcKguvOOn_Qo4zAXRhGa3",
        "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-04_17,2023-12-04_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      | 62 +++++++++++++++++++++++++++++++++++++++++\n app/graph/ethdev.h      |  1 +\n app/graph/ethdev_priv.h |  8 ++++++\n 4 files changed, 72 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 *)&ethdev_prom_mode_cmd_ctx,\n \t(cmdline_parse_inst_t *)&ethdev_ip4_cmd_ctx,\n \t(cmdline_parse_inst_t *)&ethdev_ip6_cmd_ctx,\n+\t(cmdline_parse_inst_t *)&ethdev_forward_cmd_ctx,\n \t(cmdline_parse_inst_t *)&ethdev_cmd_ctx,\n \t(cmdline_parse_inst_t *)&ethdev_help_cmd_ctx,\n \t(cmdline_parse_inst_t *)&ethdev_rx_cmd_ctx,\ndiff --git a/app/graph/ethdev.c b/app/graph/ethdev.c\nindex c9b09168c1..bceee659a2 100644\n--- a/app/graph/ethdev.c\n+++ b/app/graph/ethdev.c\n@@ -38,6 +38,10 @@ 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+\n static struct rte_eth_conf port_conf_default = {\n \t.link_speeds = 0,\n \t.rxmode = {\n@@ -888,3 +892,61 @@ cmdline_parse_inst_t ethdev_help_cmd_ctx = {\n \t\tNULL,\n \t},\n };\n+\n+static int\n+ethdev_forward_config(char *tx_name, char *rx_name)\n+{\n+\tstruct ethdev *port;\n+\tuint16_t portid_rx = 0;\n+\tuint16_t portid_tx = 0;\n+\tint rc = -EINVAL;\n+\n+\trc = rte_eth_dev_get_port_by_name(tx_name, &portid_tx);\n+\tif (rc < 0)\n+\t\treturn rc;\n+\n+\trc = rte_eth_dev_get_port_by_name(rx_name, &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->config.tx_port_id = portid_tx;\n+\t\trc = 0;\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_l2_cmd =\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 *)&ethdev_l2_cmd,\n+\t       (void *)&ethdev_fwd_cmd,\n+\t       (void *)&ethdev_tx_device,\n+\t       (void *)&ethdev_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..e5e5fbc9ae 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@@ -98,6 +105,7 @@ struct ethdev_config {\n \t\tuint32_t queue_size;\n \t} tx;\n \n+\tuint16_t tx_port_id;\n \tint promiscuous;\n \tuint32_t mtu;\n };\n",
    "prefixes": [
        "v2",
        "2/3"
    ]
}