get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 77008,
    "url": "http://patches.dpdk.org/api/patches/77008/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1599634114-148013-12-git-send-email-jiaweiw@nvidia.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": "<1599634114-148013-12-git-send-email-jiaweiw@nvidia.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1599634114-148013-12-git-send-email-jiaweiw@nvidia.com",
    "date": "2020-09-09T06:48:33",
    "name": "[v6,11/12] app/testpmd: add port and encap support for sample action",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "93a1a48595ddaf7a9ba0caaa6782f9c0221fefdd",
    "submitter": {
        "id": 1939,
        "url": "http://patches.dpdk.org/api/people/1939/?format=api",
        "name": "Jiawei Wang",
        "email": "jiaweiw@nvidia.com"
    },
    "delegate": {
        "id": 319,
        "url": "http://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1599634114-148013-12-git-send-email-jiaweiw@nvidia.com/mbox/",
    "series": [
        {
            "id": 12045,
            "url": "http://patches.dpdk.org/api/series/12045/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=12045",
            "date": "2020-09-09T06:48:29",
            "name": "support the flow-based traffic sampling",
            "version": 6,
            "mbox": "http://patches.dpdk.org/series/12045/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/77008/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/77008/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 dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 133DFA04B1;\n\tWed,  9 Sep 2020 08:50:14 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 4147D1C18E;\n\tWed,  9 Sep 2020 08:48:50 +0200 (CEST)",
            "from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129])\n by dpdk.org (Postfix) with ESMTP id A19381C0CD\n for <dev@dpdk.org>; Wed,  9 Sep 2020 08:48:36 +0200 (CEST)",
            "from Internal Mail-Server by MTLPINE1 (envelope-from\n jiaweiw@nvidia.com) with SMTP; 9 Sep 2020 09:48:34 +0300",
            "from nvidia.com (gen-l-vrt-280.mtl.labs.mlnx [10.237.45.1])\n by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 0896mYG6029471;\n Wed, 9 Sep 2020 09:48:34 +0300"
        ],
        "From": "Jiawei Wang <jiaweiw@nvidia.com>",
        "To": "orika@nvidia.com, viacheslavo@nvidia.com, matan@nvidia.com,\n thomas@monjalon.net, ferruh.yigit@intel.com, marko.kovacevic@intel.com,\n arybchenko@solarflare.com",
        "Cc": "dev@dpdk.org, rasland@nvidia.com, ian.stokes@intel.com, fbl@redhat.com,\n asafp@nvidia.com",
        "Date": "Wed,  9 Sep 2020 09:48:33 +0300",
        "Message-Id": "<1599634114-148013-12-git-send-email-jiaweiw@nvidia.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "In-Reply-To": "<1599634114-148013-1-git-send-email-jiaweiw@nvidia.com>",
        "References": "<1598540492-406340-1-git-send-email-jiaweiw@nvidia.com>\n <1599634114-148013-1-git-send-email-jiaweiw@nvidia.com>",
        "Subject": "[dpdk-dev] [PATCH v6 11/12] app/testpmd: add port and encap support\n\tfor sample action",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "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",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Use sample action with ratio is 1 for mirroring flow, add\nsupports to set the different port or encap action for mirrored\npackets.\n\nThe example of test-pmd command:\n\n1. set sample_actions 1 port_id id 1 / end\n   flow create 0 ... pattern eth / end actions\n\tsample ratio 1 index 1 / port_id id 2...\nThe flow will result in all the matched ingress packets will be sent to\nport 2, and also mirrored the packets and sent to port 2.\n\n2. set raw_encap 0 eth src.../ ipv4.../...\n   set raw_encap 1 eth src.../ ipv4.../...\n   set sample_actions 2 raw_encap index 0 / port_id id 0 / end\n   flow create 0 ... pattern eth / end actions\n\tsample ratio 1 index 2 / raw_encap index 1 / port_id id 0...\nThe flow will result in all the matched egress packets will be encapsulated\nand sent to wire, and also mirrored the packets and with the different\nencapsulated data and sent to wire.\n\nSigned-off-by: Jiawei Wang <jiaweiw@nvidia.com>\n---\n app/test-pmd/cmdline_flow.c | 16 ++++++++++++++++\n 1 file changed, 16 insertions(+)",
    "diff": "diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c\nindex 27fa294..1860657 100644\n--- a/app/test-pmd/cmdline_flow.c\n+++ b/app/test-pmd/cmdline_flow.c\n@@ -514,6 +514,8 @@ struct raw_sample_conf {\n struct rte_flow_action_mark sample_mark[RAW_SAMPLE_CONFS_MAX_NUM];\n struct rte_flow_action_queue sample_queue[RAW_SAMPLE_CONFS_MAX_NUM];\n struct rte_flow_action_count sample_count[RAW_SAMPLE_CONFS_MAX_NUM];\n+struct rte_flow_action_port_id sample_port_id[RAW_SAMPLE_CONFS_MAX_NUM];\n+struct rte_flow_action_raw_encap sample_encap[RAW_SAMPLE_CONFS_MAX_NUM];\n \n /** Maximum number of subsequent tokens and arguments on the stack. */\n #define CTX_STACK_SIZE 16\n@@ -1456,6 +1458,8 @@ struct parse_action_priv {\n \tACTION_QUEUE,\n \tACTION_MARK,\n \tACTION_COUNT,\n+\tACTION_PORT_ID,\n+\tACTION_RAW_ENCAP,\n \tACTION_NEXT,\n \tZERO,\n };\n@@ -7009,6 +7013,18 @@ static int comp_set_sample_index(struct context *, const struct token *,\n \t\t\t\t(const void *)action->conf, size);\n \t\t\taction->conf = &sample_queue[idx];\n \t\t\tbreak;\n+\t\tcase RTE_FLOW_ACTION_TYPE_RAW_ENCAP:\n+\t\t\tsize = sizeof(struct rte_flow_action_raw_encap);\n+\t\t\trte_memcpy(&sample_encap[idx],\n+\t\t\t\t(const void *)action->conf, size);\n+\t\t\taction->conf = &sample_encap[idx];\n+\t\t\tbreak;\n+\t\tcase RTE_FLOW_ACTION_TYPE_PORT_ID:\n+\t\t\tsize = sizeof(struct rte_flow_action_port_id);\n+\t\t\trte_memcpy(&sample_port_id[idx],\n+\t\t\t\t(const void *)action->conf, size);\n+\t\t\taction->conf = &sample_port_id[idx];\n+\t\t\tbreak;\n \t\tdefault:\n \t\t\tprintf(\"Error - Not supported action\\n\");\n \t\t\treturn;\n",
    "prefixes": [
        "v6",
        "11/12"
    ]
}