get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 77006,
    "url": "http://patches.dpdk.org/api/patches/77006/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1599634114-148013-2-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-2-git-send-email-jiaweiw@nvidia.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1599634114-148013-2-git-send-email-jiaweiw@nvidia.com",
    "date": "2020-09-09T06:48:23",
    "name": "[v6,01/12] ethdev: introduce sample action for rte flow",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "3e49a89de8d4e34ec67bddfde07f7a2feeb55c77",
    "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-2-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/77006/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/77006/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 3B869A04B1;\n\tWed,  9 Sep 2020 08:49:52 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 7177F1C12F;\n\tWed,  9 Sep 2020 08:48:48 +0200 (CEST)",
            "from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129])\n by dpdk.org (Postfix) with ESMTP id 92BFE1C0CA\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 0896mYFu029471;\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:23 +0300",
        "Message-Id": "<1599634114-148013-2-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 01/12] ethdev: introduce sample action for rte\n\tflow",
        "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": "When using full offload, all traffic will be handled by the HW, and\ndirected to the requested VF or wire, the control application loses\nvisibility on the traffic.\nSo there's a need for an action that will enable the control application\nsome visibility.\n\nThe solution is introduced a new action that will sample the incoming\ntraffic and send a duplicated traffic with the specified ratio to the\napplication, while the original packet will continue to the target\ndestination.\n\nThe packets sampled equals is '1/ratio', if the ratio value be set to 1,\nmeans that the packets would be completely mirrored. The sample packet\ncan be assigned with different set of actions from the original packet.\n\nIn order to support the sample packet in rte_flow, new rte_flow action\ndefinition RTE_FLOW_ACTION_TYPE_SAMPLE and structure rte_flow_action_sample\nwill be introduced.\n\nSigned-off-by: Jiawei Wang <jiaweiw@nvidia.com>\nAcked-by: Ori Kam <orika@nvidia.com>\nAcked-by: Jerin Jacob <jerinj@marvell.com>\nAcked-by: Andrew Rybchenko <arybchenko@solarflare.com>\n---\n doc/guides/prog_guide/rte_flow.rst     | 25 +++++++++++++++++++++++++\n doc/guides/rel_notes/release_20_11.rst |  6 ++++++\n lib/librte_ethdev/rte_flow.c           |  1 +\n lib/librte_ethdev/rte_flow.h           | 30 ++++++++++++++++++++++++++++++\n 4 files changed, 62 insertions(+)",
    "diff": "diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/rte_flow.rst\nindex 3e5cd1e..f8f3f51 100644\n--- a/doc/guides/prog_guide/rte_flow.rst\n+++ b/doc/guides/prog_guide/rte_flow.rst\n@@ -2653,6 +2653,31 @@ timeout passed without any matching on the flow.\n    | ``context``  | user input flow context         |\n    +--------------+---------------------------------+\n \n+Action: ``SAMPLE``\n+^^^^^^^^^^^^^^^^^^\n+\n+Adds a sample action to a matched flow.\n+\n+The matching packets will be duplicated with the specified ``ratio`` and\n+applied with own set of actions with a fate action, the packets sampled\n+equals is '1/ratio'. All the packets continue to the target destination.\n+\n+When the ``ratio`` is set to 1 then the packets will be 100% mirrored.\n+``actions`` represent the different set of actions for the sampled or mirrored\n+packets, and must have a fate action.\n+\n+.. _table_rte_flow_action_sample:\n+\n+.. table:: SAMPLE\n+\n+   +--------------+---------------------------------+\n+   | Field        | Value                           |\n+   +==============+=================================+\n+   | ``ratio``    | 32 bits sample ratio value      |\n+   +--------------+---------------------------------+\n+   | ``actions``  | sub-action list for sampling    |\n+   +--------------+---------------------------------+\n+\n Negative types\n ~~~~~~~~~~~~~~\n \ndiff --git a/doc/guides/rel_notes/release_20_11.rst b/doc/guides/rel_notes/release_20_11.rst\nindex df227a1..7f99563 100644\n--- a/doc/guides/rel_notes/release_20_11.rst\n+++ b/doc/guides/rel_notes/release_20_11.rst\n@@ -55,6 +55,12 @@ New Features\n      Also, make sure to start the actual text at the margin.\n      =======================================================\n \n+* **Added flow-based traffic sampling support.**\n+\n+  Added new action: ``RTE_FLOW_ACTION_TYPE_SAMPLE`` to duplicate the matching\n+  packets with specified ratio, and apply with own set of actions with a fate\n+  action. When the ratio is set to 1 then the packets will be 100% mirrored.\n+\n \n Removed Items\n -------------\ndiff --git a/lib/librte_ethdev/rte_flow.c b/lib/librte_ethdev/rte_flow.c\nindex f8fdd68..035671d 100644\n--- a/lib/librte_ethdev/rte_flow.c\n+++ b/lib/librte_ethdev/rte_flow.c\n@@ -174,6 +174,7 @@ struct rte_flow_desc_data {\n \tMK_FLOW_ACTION(SET_IPV4_DSCP, sizeof(struct rte_flow_action_set_dscp)),\n \tMK_FLOW_ACTION(SET_IPV6_DSCP, sizeof(struct rte_flow_action_set_dscp)),\n \tMK_FLOW_ACTION(AGE, sizeof(struct rte_flow_action_age)),\n+\tMK_FLOW_ACTION(SAMPLE, sizeof(struct rte_flow_action_sample)),\n };\n \n int\ndiff --git a/lib/librte_ethdev/rte_flow.h b/lib/librte_ethdev/rte_flow.h\nindex da8bfa5..fa70d40 100644\n--- a/lib/librte_ethdev/rte_flow.h\n+++ b/lib/librte_ethdev/rte_flow.h\n@@ -2132,6 +2132,14 @@ enum rte_flow_action_type {\n \t * see enum RTE_ETH_EVENT_FLOW_AGED\n \t */\n \tRTE_FLOW_ACTION_TYPE_AGE,\n+\n+\t/**\n+\t * The matching packets will be duplicated with specified ratio and\n+\t * applied with own set of actions with a fate action.\n+\t *\n+\t * See struct rte_flow_action_sample.\n+\t */\n+\tRTE_FLOW_ACTION_TYPE_SAMPLE,\n };\n \n /**\n@@ -2742,6 +2750,28 @@ struct rte_flow_action {\n struct rte_flow;\n \n /**\n+ * @warning\n+ * @b EXPERIMENTAL: this structure may change without prior notice\n+ *\n+ * RTE_FLOW_ACTION_TYPE_SAMPLE\n+ *\n+ * Adds a sample action to a matched flow.\n+ *\n+ * The matching packets will be duplicated with specified ratio and applied\n+ * with own set of actions with a fate action, the sampled packet could be\n+ * redirected to queue or port. All the packets continue processing on the\n+ * default flow path.\n+ *\n+ * When the sample ratio is set to 1 then the packets will be 100% mirrored.\n+ * Additional action list be supported to add for sampled or mirrored packets.\n+ */\n+struct rte_flow_action_sample {\n+\tuint32_t ratio; /**< packets sampled equals to '1/ratio'. */\n+\tconst struct rte_flow_action *actions;\n+\t\t/**< sub-action list specific for the sampling hit cases. */\n+};\n+\n+/**\n  * Verbose error types.\n  *\n  * Most of them provide the type of the object referenced by struct\n",
    "prefixes": [
        "v6",
        "01/12"
    ]
}