Show a patch.

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

{
    "id": 41385,
    "url": "http://patches.dpdk.org/api/patches/41385/",
    "web_url": "http://patches.dpdk.org/patch/41385/",
    "project": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/projects/1/",
        "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"
    },
    "msgid": "<f09bc4cab33aeac4d5d3cd8e478daa42e11b0e45.1529650435.git.rahul.lakkireddy@chelsio.com>",
    "date": "2018-06-22T09:56:03",
    "name": "[RFC,1/3] ethdev: add flow api actions to modify IP addresses",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "aef59cc5328088cc0482b8cc82182aa3cc15c40a",
    "submitter": {
        "id": 241,
        "url": "http://patches.dpdk.org/api/people/241/",
        "name": "Rahul Lakkireddy",
        "email": "rahul.lakkireddy@chelsio.com"
    },
    "delegate": {
        "id": 319,
        "url": "http://patches.dpdk.org/api/users/319/",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@intel.com"
    },
    "mbox": "http://patches.dpdk.org/patch/41385/mbox/",
    "series": [
        {
            "id": 204,
            "url": "http://patches.dpdk.org/api/series/204/",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=204",
            "date": "2018-06-22T09:56:02",
            "name": "ethdev: add IP address and TCP/UDP port rewrite actions to flow API",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/204/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/41385/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/41385/checks/",
    "tags": {},
    "headers": {
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "X-Original-To": "patchwork@dpdk.org",
        "List-Post": "<mailto:dev@dpdk.org>",
        "References": [
            "<cover.1529650435.git.rahul.lakkireddy@chelsio.com>",
            "<cover.1529650435.git.rahul.lakkireddy@chelsio.com>"
        ],
        "X-BeenThere": "dev@dpdk.org",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "Subject": "[dpdk-dev] [RFC 1/3] ethdev: add flow api actions to modify IP\n\taddresses",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>",
        "From": "Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id CB2F01BB35;\n\tFri, 22 Jun 2018 11:57:16 +0200 (CEST)",
            "from stargate.chelsio.com (stargate.chelsio.com [12.32.117.8])\n\tby dpdk.org (Postfix) with ESMTP id 887C31B8F6\n\tfor <dev@dpdk.org>; Fri, 22 Jun 2018 11:57:14 +0200 (CEST)",
            "from localhost (scalar.blr.asicdesigners.com [10.193.185.94])\n\tby stargate.chelsio.com (8.13.8/8.13.8) with ESMTP id w5M9v5rV000804; \n\tFri, 22 Jun 2018 02:57:10 -0700"
        ],
        "To": "dev@dpdk.org",
        "X-Mailer": "git-send-email 2.5.3",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "Date": "Fri, 22 Jun 2018 15:26:03 +0530",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "Delivered-To": "patchwork@dpdk.org",
        "In-Reply-To": [
            "<cover.1529650435.git.rahul.lakkireddy@chelsio.com>",
            "<cover.1529650435.git.rahul.lakkireddy@chelsio.com>"
        ],
        "Cc": "shaguna@chelsio.com, indranil@chelsio.com, nirranjan@chelsio.com",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Message-Id": "<f09bc4cab33aeac4d5d3cd8e478daa42e11b0e45.1529650435.git.rahul.lakkireddy@chelsio.com>",
        "Return-Path": "<dev-bounces@dpdk.org>"
    },
    "content": "From: Shagun Agrawal <shaguna@chelsio.com>\n\nAdd actions:\n- OF_SET_NW_IPV4_SRC - set a new IPv4 source address.\n- OF_SET_NW_IPV4_DST - set a new IPv4 destination address.\n- OF_SET_NW_IPV6_SRC - set a new IPv6 source address.\n- OF_SET_NW_IPV6_DST - set a new IPv6 destination address.\n\nBased on OFPAT_SET_NW_SRC and OFPAT_SET_NW_DST in OpenFlow\nSpecification.\n\nSigned-off-by: Shagun Agrawal <shaguna@chelsio.com>\nSigned-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>\n---\n app/test-pmd/cmdline_flow.c                 | 100 ++++++++++++++++++++++++++++\n app/test-pmd/config.c                       |   8 +++\n doc/guides/prog_guide/rte_flow.rst          |  68 +++++++++++++++++++\n doc/guides/testpmd_app_ug/testpmd_funcs.rst |  16 +++++\n lib/librte_ethdev/rte_flow.c                |   8 +++\n lib/librte_ethdev/rte_flow.h                |  62 +++++++++++++++++\n 6 files changed, 262 insertions(+)",
    "diff": "diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c\nindex 9918d7fda..4550491ec 100644\n--- a/app/test-pmd/cmdline_flow.c\n+++ b/app/test-pmd/cmdline_flow.c\n@@ -237,6 +237,14 @@ enum index {\n \tACTION_OF_POP_MPLS_ETHERTYPE,\n \tACTION_OF_PUSH_MPLS,\n \tACTION_OF_PUSH_MPLS_ETHERTYPE,\n+\tACTION_OF_SET_NW_IPV4_SRC,\n+\tACTION_OF_SET_NW_IPV4_SRC_NW_IPV4_SRC,\n+\tACTION_OF_SET_NW_IPV4_DST,\n+\tACTION_OF_SET_NW_IPV4_DST_NW_IPV4_DST,\n+\tACTION_OF_SET_NW_IPV6_SRC,\n+\tACTION_OF_SET_NW_IPV6_SRC_NW_IPV6_SRC,\n+\tACTION_OF_SET_NW_IPV6_DST,\n+\tACTION_OF_SET_NW_IPV6_DST_NW_IPV6_DST,\n };\n \n /** Maximum size for pattern in struct rte_flow_item_raw. */\n@@ -773,6 +781,10 @@ static const enum index next_action[] = {\n \tACTION_OF_SET_VLAN_PCP,\n \tACTION_OF_POP_MPLS,\n \tACTION_OF_PUSH_MPLS,\n+\tACTION_OF_SET_NW_IPV4_SRC,\n+\tACTION_OF_SET_NW_IPV4_DST,\n+\tACTION_OF_SET_NW_IPV6_SRC,\n+\tACTION_OF_SET_NW_IPV6_DST,\n \tZERO,\n };\n \n@@ -868,6 +880,30 @@ static const enum index action_of_push_mpls[] = {\n \tZERO,\n };\n \n+static const enum index action_of_set_nw_ipv4_src[] = {\n+\tACTION_OF_SET_NW_IPV4_SRC_NW_IPV4_SRC,\n+\tACTION_NEXT,\n+\tZERO,\n+};\n+\n+static const enum index action_of_set_nw_ipv4_dst[] = {\n+\tACTION_OF_SET_NW_IPV4_DST_NW_IPV4_DST,\n+\tACTION_NEXT,\n+\tZERO,\n+};\n+\n+static const enum index action_of_set_nw_ipv6_src[] = {\n+\tACTION_OF_SET_NW_IPV6_SRC_NW_IPV6_SRC,\n+\tACTION_NEXT,\n+\tZERO,\n+};\n+\n+static const enum index action_of_set_nw_ipv6_dst[] = {\n+\tACTION_OF_SET_NW_IPV6_DST_NW_IPV6_DST,\n+\tACTION_NEXT,\n+\tZERO,\n+};\n+\n static const enum index action_jump[] = {\n \tACTION_JUMP_GROUP,\n \tACTION_NEXT,\n@@ -2362,6 +2398,70 @@ static const struct token token_list[] = {\n \t\t\t      ethertype)),\n \t\t.call = parse_vc_conf,\n \t},\n+\t[ACTION_OF_SET_NW_IPV4_SRC] = {\n+\t\t.name = \"of_set_ipv4_src\",\n+\t\t.help = \"set ipv4 source address\",\n+\t\t.priv = PRIV_ACTION(OF_SET_NW_IPV4_SRC,\n+\t\t\tsizeof(struct rte_flow_action_of_set_nw_ipv4)),\n+\t\t.next = NEXT(action_of_set_nw_ipv4_src),\n+\t\t.call = parse_vc,\n+\t},\n+\t[ACTION_OF_SET_NW_IPV4_SRC_NW_IPV4_SRC] = {\n+\t\t.name = \"ipv4_addr\",\n+\t\t.help = \"new ipv4 source address to set\",\n+\t\t.next = NEXT(action_of_set_nw_ipv4_src, NEXT_ENTRY(IPV4_ADDR)),\n+\t\t.args = ARGS(ARGS_ENTRY_HTON\n+\t\t\t(struct rte_flow_action_of_set_nw_ipv4, ipv4_addr)),\n+\t\t.call = parse_vc_conf,\n+\t},\n+\t[ACTION_OF_SET_NW_IPV4_DST] = {\n+\t\t.name = \"of_set_ipv4_dst\",\n+\t\t.help = \"set ipv4 destination address\",\n+\t\t.priv = PRIV_ACTION(OF_SET_NW_IPV4_DST,\n+\t\t\tsizeof(struct rte_flow_action_of_set_nw_ipv4)),\n+\t\t.next = NEXT(action_of_set_nw_ipv4_dst),\n+\t\t.call = parse_vc,\n+\t},\n+\t[ACTION_OF_SET_NW_IPV4_DST_NW_IPV4_DST] = {\n+\t\t.name = \"ipv4_addr\",\n+\t\t.help = \"new ipv4 destination address to set\",\n+\t\t.next = NEXT(action_of_set_nw_ipv4_dst, NEXT_ENTRY(IPV4_ADDR)),\n+\t\t.args = ARGS(ARGS_ENTRY_HTON\n+\t\t\t(struct rte_flow_action_of_set_nw_ipv4, ipv4_addr)),\n+\t\t.call = parse_vc_conf,\n+\t},\n+\t[ACTION_OF_SET_NW_IPV6_SRC] = {\n+\t\t.name = \"of_set_ipv6_src\",\n+\t\t.help = \"set ipv6 source address\",\n+\t\t.priv = PRIV_ACTION(OF_SET_NW_IPV6_SRC,\n+\t\t\tsizeof(struct rte_flow_action_of_set_nw_ipv6)),\n+\t\t.next = NEXT(action_of_set_nw_ipv6_src),\n+\t\t.call = parse_vc,\n+\t},\n+\t[ACTION_OF_SET_NW_IPV6_SRC_NW_IPV6_SRC] = {\n+\t\t.name = \"ipv6_addr\",\n+\t\t.help = \"new ipv6 source address to set\",\n+\t\t.next = NEXT(action_of_set_nw_ipv6_src, NEXT_ENTRY(IPV6_ADDR)),\n+\t\t.args = ARGS(ARGS_ENTRY_HTON\n+\t\t\t(struct rte_flow_action_of_set_nw_ipv6, ipv6_addr)),\n+\t\t.call = parse_vc_conf,\n+\t},\n+\t[ACTION_OF_SET_NW_IPV6_DST] = {\n+\t\t.name = \"of_set_ipv6_dst\",\n+\t\t.help = \"set ipv6 destination address\",\n+\t\t.priv = PRIV_ACTION(OF_SET_NW_IPV6_DST,\n+\t\t\tsizeof(struct rte_flow_action_of_set_nw_ipv6)),\n+\t\t.next = NEXT(action_of_set_nw_ipv6_dst),\n+\t\t.call = parse_vc,\n+\t},\n+\t[ACTION_OF_SET_NW_IPV6_DST_NW_IPV6_DST] = {\n+\t\t.name = \"ipv6_addr\",\n+\t\t.help = \"new ipv6 destination address to set\",\n+\t\t.next = NEXT(action_of_set_nw_ipv6_dst, NEXT_ENTRY(IPV6_ADDR)),\n+\t\t.args = ARGS(ARGS_ENTRY_HTON\n+\t\t\t(struct rte_flow_action_of_set_nw_ipv6, ipv6_addr)),\n+\t\t.call = parse_vc_conf,\n+\t},\n };\n \n /** Remove and return last entry from argument stack. */\ndiff --git a/app/test-pmd/config.c b/app/test-pmd/config.c\nindex 97020fb3d..83cb0354d 100644\n--- a/app/test-pmd/config.c\n+++ b/app/test-pmd/config.c\n@@ -1153,6 +1153,14 @@ static const struct {\n \t\t       sizeof(struct rte_flow_action_of_pop_mpls)),\n \tMK_FLOW_ACTION(OF_PUSH_MPLS,\n \t\t       sizeof(struct rte_flow_action_of_push_mpls)),\n+\tMK_FLOW_ACTION(OF_SET_NW_IPV4_SRC,\n+\t\t       sizeof(struct rte_flow_action_of_set_nw_ipv4)),\n+\tMK_FLOW_ACTION(OF_SET_NW_IPV4_DST,\n+\t\t       sizeof(struct rte_flow_action_of_set_nw_ipv4)),\n+\tMK_FLOW_ACTION(OF_SET_NW_IPV6_SRC,\n+\t\t       sizeof(struct rte_flow_action_of_set_nw_ipv6)),\n+\tMK_FLOW_ACTION(OF_SET_NW_IPV6_DST,\n+\t\t       sizeof(struct rte_flow_action_of_set_nw_ipv6)),\n };\n \n /** Compute storage space needed by action configuration and copy it. */\ndiff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/rte_flow.rst\nindex b305a72a5..3f56cc2d1 100644\n--- a/doc/guides/prog_guide/rte_flow.rst\n+++ b/doc/guides/prog_guide/rte_flow.rst\n@@ -2076,6 +2076,74 @@ RTE_FLOW_ERROR_TYPE_ACTION error should be returned.\n \n This action modifies the payload of matched flows.\n \n+Action: ``OF_SET_NW_IPV4_SRC``\n+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n+\n+Set a new IPv4 source address. It is based on ``OFPAT_SET_NW_SRC``\n+(\"set the network source address\") as defined by the\n+`OpenFlow Switch Specification`_.\n+\n+.. _table_rte_flow_action_of_set_nw_ipv4_src:\n+\n+.. table:: OF_SET_NW_IPV4_SRC\n+\n+   +---------------+-------------------------+\n+   | Field         | Value                   |\n+   +===============+=========================+\n+   | ``ipv4_addr`` | new IPv4 source address |\n+   +---------------+-------------------------+\n+\n+Action: ``OF_SET_NW_IPV4_DST``\n+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n+\n+Set a new IPv4 destination address. It is based on ``OFPAT_SET_NW_DST``\n+(\"set the network destination address\") as defined by the\n+`OpenFlow Switch Specification`_.\n+\n+.. _table_rte_flow_action_of_set_nw_ipv4_dst:\n+\n+.. table:: OF_SET_NW_IPV4_DST\n+\n+   +---------------+------------------------------+\n+   | Field         | Value                        |\n+   +===============+==============================+\n+   | ``ipv4_addr`` | new IPv4 destination address |\n+   +---------------+------------------------------+\n+\n+Action: ``OF_SET_NW_IPV6_SRC``\n+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n+\n+Set a new IPv6 source address. It is based on ``OFPAT_SET_NW_SRC``\n+(\"set the network source address\") as defined by the\n+`OpenFlow Switch Specification`_.\n+\n+.. _table_rte_flow_action_of_set_nw_ipv6_src:\n+\n+.. table:: OF_SET_NW_IPV6_SRC\n+\n+   +---------------+-------------------------+\n+   | Field         | Value                   |\n+   +===============+=========================+\n+   | ``ipv6_addr`` | new IPv6 source address |\n+   +---------------+-------------------------+\n+\n+Action: ``OF_SET_NW_IPV6_DST``\n+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n+\n+Set a new IPv6 destination address. It is based on ``OFPAT_SET_NW_DST``\n+(\"set the network destination address\") as defined by the\n+`OpenFlow Switch Specification`_.\n+\n+.. _table_rte_flow_action_of_set_nw_ipv6_dst:\n+\n+.. table:: OF_SET_NW_IPV6_DST\n+\n+   +---------------+------------------------------+\n+   | Field         | Value                        |\n+   +===============+==============================+\n+   | ``ipv6_addr`` | new IPv6 destination address |\n+   +---------------+------------------------------+\n+\n Negative types\n ~~~~~~~~~~~~~~\n \ndiff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst\nindex 0d6fd50ca..56e3d6326 100644\n--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst\n+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst\n@@ -3650,6 +3650,22 @@ This section lists supported actions and their attributes, if any.\n \n   - ``ethertype``: Ethertype.\n \n+- ``of_set_ipv4_src``: Set a new IPv4 source address.\n+\n+  - ``ipv4_addr``: New IPv4 source address.\n+\n+- ``of_set_ipv4_dst``: Set a new IPv4 destination address.\n+\n+  - ``ipv4_addr``: New IPv4 destination address.\n+\n+- ``of_set_ipv6_src``: Set a new IPv6 source address.\n+\n+  - ``ipv6_addr``: New IPv6 source address.\n+\n+- ``of_set_ipv6_dst``: Set a new ipv6 destination address.\n+\n+  - ``ipv6_addr``: New IPv6 destination address.\n+\n Destroying flow rules\n ~~~~~~~~~~~~~~~~~~~~~\n \ndiff --git a/lib/librte_ethdev/rte_flow.c b/lib/librte_ethdev/rte_flow.c\nindex b2afba089..29f846783 100644\n--- a/lib/librte_ethdev/rte_flow.c\n+++ b/lib/librte_ethdev/rte_flow.c\n@@ -109,6 +109,14 @@ static const struct rte_flow_desc_data rte_flow_desc_action[] = {\n \t\t       sizeof(struct rte_flow_action_of_pop_mpls)),\n \tMK_FLOW_ACTION(OF_PUSH_MPLS,\n \t\t       sizeof(struct rte_flow_action_of_push_mpls)),\n+\tMK_FLOW_ACTION(OF_SET_NW_IPV4_SRC,\n+\t\t       sizeof(struct rte_flow_action_of_set_nw_ipv4)),\n+\tMK_FLOW_ACTION(OF_SET_NW_IPV4_DST,\n+\t\t       sizeof(struct rte_flow_action_of_set_nw_ipv4)),\n+\tMK_FLOW_ACTION(OF_SET_NW_IPV6_SRC,\n+\t\t       sizeof(struct rte_flow_action_of_set_nw_ipv6)),\n+\tMK_FLOW_ACTION(OF_SET_NW_IPV6_DST,\n+\t\t       sizeof(struct rte_flow_action_of_set_nw_ipv6)),\n };\n \n static int\ndiff --git a/lib/librte_ethdev/rte_flow.h b/lib/librte_ethdev/rte_flow.h\nindex f8ba71cdb..76cf652c5 100644\n--- a/lib/librte_ethdev/rte_flow.h\n+++ b/lib/librte_ethdev/rte_flow.h\n@@ -1505,6 +1505,38 @@ enum rte_flow_action_type {\n \t * error.\n \t */\n \tRTE_FLOW_ACTION_TYPE_NVGRE_DECAP,\n+\n+\t/**\n+\t * Implements OFPAT_SET_NW_SRC (set the network src addr) as defined\n+\t * by the OpenFlow Switch Specification for ipv4 address.\n+\t *\n+\t * See struct rte_flow_action_of_set_nw_ipv4.\n+\t */\n+\tRTE_FLOW_ACTION_TYPE_OF_SET_NW_IPV4_SRC,\n+\n+\t/**\n+\t * Implements OFPAT_SET_NW_DST (set the network dst addr) as defined\n+\t * by the OpenFlow Switch Specification for ipv4 address.\n+\t *\n+\t * See struct rte_flow_action_of_set_nw_ipv4.\n+\t */\n+\tRTE_FLOW_ACTION_TYPE_OF_SET_NW_IPV4_DST,\n+\n+\t/**\n+\t * Implements OFPAT_SET_NW_SRC (set the network src addr) as defined\n+\t * by the OpenFlow Switch Specification for ipv6 address.\n+\t *\n+\t * See struct rte_flow_action_of_set_nw_ipv6.\n+\t */\n+\tRTE_FLOW_ACTION_TYPE_OF_SET_NW_IPV6_SRC,\n+\n+\t/**\n+\t * Implements OFPAT_SET_NW_DST (set the network dst addr) as defined\n+\t * by the OpenFlow Switch Specification for ipv6 address.\n+\t *\n+\t * See struct rte_flow_action_of_set_nw_ipv6.\n+\t */\n+\tRTE_FLOW_ACTION_TYPE_OF_SET_NW_IPV6_DST,\n };\n \n /**\n@@ -1868,6 +1900,36 @@ struct rte_flow_action_nvgre_encap {\n \tstruct rte_flow_item *definition;\n };\n \n+/**\n+ * @warning\n+ * @b EXPERIMENTAL: this structure may change without prior notice\n+ *\n+ * RTE_FLOW_ACTION_TYPE_OF_SET_NW_IPV4_SRC\n+ * RTE_FLOW_ACTION_TYPE_OF_SET_NW_IPV4_DST\n+ *\n+ * Implements OFPAT_SET_NW_SRC & OFPAT_SET_NW_DST (set the network\n+ * src/dst addr) as defined by the OpenFlow Switch Specification\n+ * for ipv4 address.\n+ */\n+struct rte_flow_action_of_set_nw_ipv4 {\n+\tuint32_t ipv4_addr;\n+};\n+\n+/**\n+ * @warning\n+ * @b EXPERIMENTAL: this structure may change without prior notice\n+ *\n+ * RTE_FLOW_ACTION_TYPE_OF_SET_NW_IPV6_SRC\n+ * RTE_FLOW_ACTION_TYPE_OF_SET_NW_IPV6_DST\n+ *\n+ * Implements OFPAT_SET_NW_SRC & OFPAT_SET_NW_DST (set the network\n+ * src/dst addr) as defined by the OpenFlow Switch Specification\n+ * for ipv6 address.\n+ */\n+struct rte_flow_action_of_set_nw_ipv6 {\n+\tuint8_t ipv6_addr[16];\n+};\n+\n /*\n  * Definition of a single action.\n  *\n",
    "prefixes": [
        "RFC",
        "1/3"
    ]
}