get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 85384,
    "url": "https://patches.dpdk.org/api/patches/85384/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20201218013129.25186-1-akozyrev@nvidia.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": "<20201218013129.25186-1-akozyrev@nvidia.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20201218013129.25186-1-akozyrev@nvidia.com",
    "date": "2020-12-18T01:31:29",
    "name": "[RFC] ethdev: introduce copy_field rte flow action",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "8d1c49dd78dff70162e9c672bc7dee7a6df14bd4",
    "submitter": {
        "id": 1873,
        "url": "https://patches.dpdk.org/api/people/1873/?format=api",
        "name": "Alexander Kozyrev",
        "email": "akozyrev@nvidia.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/20201218013129.25186-1-akozyrev@nvidia.com/mbox/",
    "series": [
        {
            "id": 14356,
            "url": "https://patches.dpdk.org/api/series/14356/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=14356",
            "date": "2020-12-18T01:31:29",
            "name": "[RFC] ethdev: introduce copy_field rte flow action",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/14356/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/85384/comments/",
    "check": "warning",
    "checks": "https://patches.dpdk.org/api/patches/85384/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 78192A09F6;\n\tFri, 18 Dec 2020 02:31:43 +0100 (CET)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id C8F2BCA39;\n\tFri, 18 Dec 2020 02:31:41 +0100 (CET)",
            "from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129])\n by dpdk.org (Postfix) with ESMTP id 1DE46CA38\n for <dev@dpdk.org>; Fri, 18 Dec 2020 02:31:40 +0100 (CET)",
            "from Internal Mail-Server by MTLPINE1 (envelope-from\n akozyrev@nvidia.com) with SMTP; 18 Dec 2020 03:31:35 +0200",
            "from nvidia.com (pegasus02.mtr.labs.mlnx [10.210.16.122])\n by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 0BI1VYxA027710;\n Fri, 18 Dec 2020 03:31:35 +0200"
        ],
        "From": "Alexander Kozyrev <akozyrev@nvidia.com>",
        "To": "dev@dpdk.org",
        "Cc": "viacheslavo@nvidia.com, orika@nvidia.com, thomas@monjalon.net,\n ferruh.yigit@intel.com, andrew.rybchenko@oktetlabs.ru",
        "Date": "Fri, 18 Dec 2020 01:31:29 +0000",
        "Message-Id": "<20201218013129.25186-1-akozyrev@nvidia.com>",
        "X-Mailer": "git-send-email 2.24.1",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [RFC] ethdev: introduce copy_field rte flow 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": "RTE Flows API lacks the ability to save an arbitrary header field in\norder to use it later for advanced packet manipulations. Examples\ninclude the usage of VxLAN ID after the packet is decapsulated or\nstoring this ID inside the packet payload itself or swapping an\narbitrary inner and outer packet fields.\n\nThe idea is to allow a copy of a specified number of bits form any\npacket header field into another header field:\nRTE_FLOW_ACTION_TYPE_COPY_FIELD with the structure defined below.\n\nstruct rte_flow_action_copy_field {\n\tstruct rte_flow_action_copy_data dest;\n\tstruct rte_flow_action_copy_data src;\n\tuint16_t width;\n};\n\nArbitrary header field (as well as mark, metadata or tag values) can be\nused as both source and destination fields. This way we can save an\narbitrary header field by copying its value to a tag/mark/metadata or\ncopy it into another header field directly. tag/mark/metadata can also\nbe used as a value to be stored in an arbitrary packet header field.\n\nstruct rte_flow_action_copy_data {\n\tenum rte_flow_field_id field;\n\tuint16_t index;\n\tuint16_t offset;\n};\n\nThe rte_flow_field_id specifies the particular packet field (or\ntag/mark/metadata) to be used as a copy source or destination.\nThe index gives access to inner packet headers or elements in the tags\narray. The offset allows to copy a packet field value into the payload.\n\nIt is proposed to implement the \"set copy_field\" command to store all\nthe required parameters and then to use this template by specifying the\nindex of the needed copy action. For example, to modify the GTP tunnel\nID after the packet is encapsulated following testpmd rules are used:\n\n      set copy_field width 32 src field tag index 1 offset 0\n        dst field teid index 0 offset 0\n      flow create 0 ingress pattern ... / end\n        raw_decap index 1 / raw_encap index 2 /\n        copy_field index 1 / end\n\nA more generic mechanism to overwrite an arbitrary header field may be\nintroduced to the RTE flows implementation later:\nRTE_FLOW_ACTION_TYPE_SET_FIELD with the structure defined below.\n\nstruct rte_flow_action_copy_field {\n\tstruct rte_flow_action_copy_data dest;\n\tuint8_t *data;\n\tuint16_t width;\n};\n\nThis way we can have the generic way to specify an immediate value and\nuse it as data for any packet header field instead of having separate\nRTE Flow action for each of the packet fields. Deprecation notice may\nbe issued to RTE_FLOW_ACTION_TYPE_SET_XXX actions after the unified\nmethod of setting a value to any packet field is implemented.\n\nSigned-off-by: Alexander Kozyrev <akozyrev@nvidia.com>\n---\n lib/librte_ethdev/rte_flow.c |  1 +\n lib/librte_ethdev/rte_flow.h | 59 ++++++++++++++++++++++++++++++++++++\n 2 files changed, 60 insertions(+)",
    "diff": "diff --git a/lib/librte_ethdev/rte_flow.c b/lib/librte_ethdev/rte_flow.c\nindex a06f64c271..c3154a29e2 100644\n--- a/lib/librte_ethdev/rte_flow.c\n+++ b/lib/librte_ethdev/rte_flow.c\n@@ -176,6 +176,7 @@ static const struct rte_flow_desc_data rte_flow_desc_action[] = {\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+\tMK_FLOW_ACTION(COPY_FIELD, sizeof(struct rte_flow_action_copy_field)),\n \t/**\n \t * Shared action represented as handle of type\n \t * (struct rte_flow_shared action *) stored in conf field (see\ndiff --git a/lib/librte_ethdev/rte_flow.h b/lib/librte_ethdev/rte_flow.h\nindex 0977a78270..8f1798487c 100644\n--- a/lib/librte_ethdev/rte_flow.h\n+++ b/lib/librte_ethdev/rte_flow.h\n@@ -2198,6 +2198,16 @@ enum rte_flow_action_type {\n \t * struct rte_flow_shared_action).\n \t */\n \tRTE_FLOW_ACTION_TYPE_SHARED,\n+\n+\t/**\n+\t * Copy a packet header field, tag, mark or metadata.\n+\t *\n+\t * Allow saving an arbitrary header field by copying its value\n+\t * to a tag/mark/metadata or copy it into another header field.\n+\t *\n+\t * See struct rte_flow_action_copy_field.\n+\t */\n+\tRTE_FLOW_ACTION_TYPE_COPY_FIELD,\n };\n \n /**\n@@ -2791,6 +2801,55 @@ struct rte_flow_action_set_dscp {\n  */\n struct rte_flow_shared_action;\n \n+enum rte_flow_field_id {\n+\tRTE_FLOW_FIELD_NONE = 0,\n+\tRTE_FLOW_FIELD_MAC_DST,\n+\tRTE_FLOW_FIELD_MAC_SRC,\n+\tRTE_FLOW_FIELD_VLAN_TYPE,\n+\tRTE_FLOW_FIELD_VLAN_ID,\n+\tRTE_FLOW_FIELD_MAC_TYPE,\n+\tRTE_FLOW_FIELD_IPV4_DSCP,\n+\tRTE_FLOW_FIELD_IPV4_TTL,\n+\tRTE_FLOW_FIELD_IPV4_SRC,\n+\tRTE_FLOW_FIELD_IPV4_DST,\n+\tRTE_FLOW_FIELD_IPV6_HOPLIMIT,\n+\tRTE_FLOW_FIELD_IPV6_SRC,\n+\tRTE_FLOW_FIELD_IPV6_DST,\n+\tRTE_FLOW_FIELD_TCP_PORT_SRC,\n+\tRTE_FLOW_FIELD_TCP_PORT_DST,\n+\tRTE_FLOW_FIELD_TCP_SEQ_NUM,\n+\tRTE_FLOW_FIELD_TCP_ACK_NUM,\n+\tRTE_FLOW_FIELD_TCP_FLAGS,\n+\tRTE_FLOW_FIELD_UDP_PORT_SRC,\n+\tRTE_FLOW_FIELD_UDP_PORT_DST,\n+\tRTE_FLOW_FIELD_VXLAN_VNI,\n+\tRTE_FLOW_FIELD_GENEVE_VNI,\n+\tRTE_FLOW_FIELD_GTP_TEID,\n+\tRTE_FLOW_FIELD_TAG,\n+\tRTE_FLOW_FIELD_MARK,\n+\tRTE_FLOW_FIELD_META,\n+};\n+\n+struct rte_flow_action_copy_data {\n+\tenum rte_flow_field_id field;\n+\tuint16_t index;\n+\tuint16_t offset;\n+};\n+\n+/**\n+ * RTE_FLOW_ACTION_TYPE_COPY_FIELD\n+ *\n+ * Copies a specified number of bits from a source header field\n+ * to a destination header field. Tag, mark or metadata can also\n+ * be used as a source/destination to allow saving/overwriting\n+ * an arbituary header field with a user-specified value.\n+ */\n+struct rte_flow_action_copy_field {\n+\tstruct rte_flow_action_copy_data dest;\n+\tstruct rte_flow_action_copy_data src;\n+\tuint16_t width;\n+};\n+\n /* Mbuf dynamic field offset for metadata. */\n extern int32_t rte_flow_dynf_metadata_offs;\n \n",
    "prefixes": [
        "RFC"
    ]
}