get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 46562,
    "url": "http://patchwork.dpdk.org/api/patches/46562/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20181011092616.12448-1-jackmin@mellanox.com/",
    "project": {
        "id": 1,
        "url": "http://patchwork.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": "<20181011092616.12448-1-jackmin@mellanox.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20181011092616.12448-1-jackmin@mellanox.com",
    "date": "2018-10-11T09:26:42",
    "name": "[v3] net/mlx5: rewrite IP address UDP/TCP port by E-Switch",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "094e0d996a47396ba72f303d6710099cacde3438",
    "submitter": {
        "id": 1065,
        "url": "http://patchwork.dpdk.org/api/people/1065/?format=api",
        "name": "Xiaoyu Min",
        "email": "jackmin@mellanox.com"
    },
    "delegate": {
        "id": 6624,
        "url": "http://patchwork.dpdk.org/api/users/6624/?format=api",
        "username": "shahafs",
        "first_name": "Shahaf",
        "last_name": "Shuler",
        "email": "shahafs@mellanox.com"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20181011092616.12448-1-jackmin@mellanox.com/mbox/",
    "series": [
        {
            "id": 1826,
            "url": "http://patchwork.dpdk.org/api/series/1826/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=1826",
            "date": "2018-10-11T09:26:42",
            "name": "[v3] net/mlx5: rewrite IP address UDP/TCP port by E-Switch",
            "version": 3,
            "mbox": "http://patchwork.dpdk.org/series/1826/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/46562/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/46562/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 95EEA1B274;\n\tThu, 11 Oct 2018 11:26:45 +0200 (CEST)",
            "from EUR03-VE1-obe.outbound.protection.outlook.com\n\t(mail-eopbgr50069.outbound.protection.outlook.com [40.107.5.69])\n\tby dpdk.org (Postfix) with ESMTP id DBB481B3AF\n\tfor <dev@dpdk.org>; Thu, 11 Oct 2018 11:26:43 +0200 (CEST)",
            "from DB6PR0501MB2023.eurprd05.prod.outlook.com (10.168.9.17) by\n\tDB6PR0501MB1992.eurprd05.prod.outlook.com (10.168.9.10) with\n\tMicrosoft SMTP Server (version=TLS1_2,\n\tcipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id\n\t15.20.1228.21; Thu, 11 Oct 2018 09:26:42 +0000",
            "from DB6PR0501MB2023.eurprd05.prod.outlook.com\n\t([fe80::b1fb:bad3:b5b1:f913]) by\n\tDB6PR0501MB2023.eurprd05.prod.outlook.com\n\t([fe80::b1fb:bad3:b5b1:f913%3]) with mapi id 15.20.1228.020;\n\tThu, 11 Oct 2018 09:26:42 +0000"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com;\n\ts=selector1;\n\th=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;\n\tbh=mtBAu9j1QRktBUKTalop3DQvG+zPXnzV1INHsLbhopQ=;\n\tb=h+6AYuqbbuH5WmxgYTz7GqmuhU85726MAqnWw3ieJXcTDFdCpsPGSMxAGA4Q91JS6caKvYKP9Va+sDGDCj4Ec/xVz3yx0pWYS4s22ndXCdaxywlagLjdjmnevF7TCe3Nj4rUkKhTYjNDZ5Q5486OO64wJwMPuuhiU8yIsv717jI=",
        "From": "Jack Min <jackmin@mellanox.com>",
        "To": "Shahaf Shuler <shahafs@mellanox.com>, Yongseok Koh <yskoh@mellanox.com>",
        "CC": "\"dev@dpdk.org\" <dev@dpdk.org>",
        "Thread-Topic": "[PATCH v3] net/mlx5: rewrite IP address UDP/TCP port by\n\tE-Switch",
        "Thread-Index": "AQHUYUSFIJh/P360wEyVFCi+XTVGwg==",
        "Date": "Thu, 11 Oct 2018 09:26:42 +0000",
        "Message-ID": "<20181011092616.12448-1-jackmin@mellanox.com>",
        "References": "<20181010125536.23035-1-jackmin@mellanox.com>",
        "In-Reply-To": "<20181010125536.23035-1-jackmin@mellanox.com>",
        "Accept-Language": "en-US",
        "Content-Language": "en-US",
        "X-MS-Has-Attach": "",
        "X-MS-TNEF-Correlator": "",
        "x-clientproxiedby": "SG2PR0302CA0008.apcprd03.prod.outlook.com\n\t(2603:1096:3:2::18) To DB6PR0501MB2023.eurprd05.prod.outlook.com\n\t(2603:10a6:4:6::17)",
        "authentication-results": "spf=none (sender IP is )\n\tsmtp.mailfrom=jackmin@mellanox.com; ",
        "x-ms-exchange-messagesentrepresentingtype": "1",
        "x-originating-ip": "[118.201.220.138]",
        "x-ms-publictraffictype": "Email",
        "x-microsoft-exchange-diagnostics": "1; DB6PR0501MB1992;\n\t6:zSxY0CDbntLn8e0GFuMhcqXZBpJj0aPUVcGuWSO+jxGhoRZavi6Crz3w5/N1rmGGcHzptWISGPMrm6Pay7vCh5O52ejJMjv4uQsDQIYYaB8tpYSWhZQGgZ+VqPs5gEIQ2Wt9NQ2AOF1Jz/u5oBxhPHXoA2uGZnC3YOSzV4GzQnXoTOV3NoujuPkgyan/ponCX7UVxyGF4dTdIxo3pjK+lu+IiFZBjT65lnznwRhOGLKK9zfav0fjYp0WODrxGMNcZQlr9c3UqequUDy81HHqFuYXfrR/GaiFuQscgA7if5TZYl54zBR91YHt+jTy/d7ToAYJOpT00tIzXP1BLK5mBTgeoqHzwg7t7T3UiQga0824J0ElvKv1xOOn9a04VUe2mwejWKlFrAHcYpBkMkX2+okjJaJBA/x+dXOj6jf65Qx/hAbcVVdIeHhq2w3kEZVYGcD4ORpAfCPXRaT2NPFFpw==;\n\t5:2QEDTfDLPEE8dSnW+AO0kbaaPGU2wCvPhgQWYtozDxyF2At6HxH1e75CbdvwtaSzULmkDePraXSgTcBwBkr4nkQAXyBmN7KglPeVqU1I0sKVoZo2hSJmtTravbLhbUP2JTnKZDE6bjJYQVx2UhnLvMSLQCjI795Em7BYEyuOR5o=;\n\t7:LcRu/65BOt4MGNJU8EzyjxYTGqnTz2o76hn+fsm4IiGgkZ3epJM/gVkbvaxwIwk5YVtb4S8upZAOW2uBXPcdU4Hoyovn7oXxHJcAQoi+dldgxxFTdtfohcr9aYJ6H6w4ncziT+4WDYEvWQpei1q44VomUVquLfxjJW0XoRYKhZ/F/FyIHAFQp07S2JQ9ibhbR3LA2Sk4mNy5PlZlbVatxnrr8IwUN4ACW/Bx3Xrtx8P2YgFXSHASuvMQP3v2M4jB",
        "x-ms-office365-filtering-correlation-id": "97d986fb-98bb-46f4-7764-08d62f5ba731",
        "x-ms-office365-filtering-ht": "Tenant",
        "x-microsoft-antispam": "BCL:0; PCL:0;\n\tRULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020);\n\tSRVR:DB6PR0501MB1992; ",
        "x-ms-traffictypediagnostic": "DB6PR0501MB1992:",
        "x-microsoft-antispam-prvs": "<DB6PR0501MB199287A8BC68A0F9A7D796C5CCE10@DB6PR0501MB1992.eurprd05.prod.outlook.com>",
        "x-exchange-antispam-report-test": "UriScan:;",
        "x-ms-exchange-senderadcheck": "1",
        "x-exchange-antispam-report-cfa-test": "BCL:0; PCL:0;\n\tRULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3231355)(944501410)(52105095)(3002001)(10201501046)(93006095)(93001095)(6055026)(149066)(150057)(6041310)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(201708071742011)(7699051);\n\tSRVR:DB6PR0501MB1992; BCL:0; PCL:0; RULEID:; SRVR:DB6PR0501MB1992; ",
        "x-forefront-prvs": "08220FA8D6",
        "x-forefront-antispam-report": "SFV:NSPM;\n\tSFS:(10009020)(376002)(366004)(346002)(396003)(136003)(39860400002)(199004)(189003)(5660300001)(476003)(11346002)(8936002)(81156014)(2906002)(2616005)(7736002)(446003)(81166006)(25786009)(8676002)(305945005)(2900100001)(85306007)(66066001)(1076002)(110136005)(316002)(4744004)(6116002)(105586002)(97736004)(6486002)(71190400001)(14444005)(256004)(68736007)(3846002)(36756003)(102836004)(106356001)(6636002)(486006)(478600001)(6436002)(6506007)(386003)(71200400001)(5250100002)(99286004)(52116002)(76176011)(53936002)(575784001)(86362001)(53946003)(4326008)(14454004)(26005)(6512007)(186003)(579004);\n\tDIR:OUT; SFP:1101; SCL:1; SRVR:DB6PR0501MB1992;\n\tH:DB6PR0501MB2023.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; \n\tPTR:InfoNoRecords; A:1; MX:1; ",
        "received-spf": "None (protection.outlook.com: mellanox.com does not designate\n\tpermitted sender hosts)",
        "x-microsoft-antispam-message-info": "b9LGdFMrFtSrCuFABfAmGCKGaIe18MTWlXyHPO+3gXr6jE9y1nLjDDjbclMMNPcbgQ1YM4edF4nMgSg6BUmcSTirNcZ7dJ69lJtGPoOwvLTCRTrPkaS3IZCdtLVrS8H7nm6DmYTK1u6W1YRJIqg/+rNO3AzT8axX7Cy3CIGIwCHM0ZQEJaQ6M+aHoC28rO8p1Hrt9nXKzV55cqpw1AdWMuQMrwVVv+5agHoiK9C6KKzUJqiuqwJKFRgYyJfbgIKzolluZoE8DR/gGaqn/EzssB189pT1FV48gPjsuXHxIzon05uJTs8KY5hkvI5MLAI/n/r7JfNC/8JUKYrfoHiAkBA87ZMp4a6J8cR4abQttiY=",
        "spamdiagnosticoutput": "1:99",
        "spamdiagnosticmetadata": "NSPM",
        "Content-Type": "text/plain; charset=\"iso-8859-1\"",
        "Content-Transfer-Encoding": "quoted-printable",
        "MIME-Version": "1.0",
        "X-OriginatorOrg": "Mellanox.com",
        "X-MS-Exchange-CrossTenant-Network-Message-Id": "97d986fb-98bb-46f4-7764-08d62f5ba731",
        "X-MS-Exchange-CrossTenant-originalarrivaltime": "11 Oct 2018 09:26:42.0726\n\t(UTC)",
        "X-MS-Exchange-CrossTenant-fromentityheader": "Hosted",
        "X-MS-Exchange-CrossTenant-id": "a652971c-7d2e-4d9b-a6a4-d149256f461b",
        "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "DB6PR0501MB1992",
        "Subject": "[dpdk-dev] [PATCH v3] net/mlx5: rewrite IP address UDP/TCP port by\n\tE-Switch",
        "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\t<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\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Offload the following rte_flow actions by inserting accordingly\nE-Switch rules via TC Flower driver\n\n - RTE_FLOW_ACTION_TYPE_SET_IPV4_SRC\n - RTE_FLOW_ACTION_TYPE_SET_IPV4_DST\n - RTE_FLOW_ACTION_TYPE_SET_IPV6_SRC\n - RTE_FLOW_ACTION_TYPE_SET_IPV6_DST\n - RTE_FLOW_ACTION_TYPE_SET_TP_SRC\n - RTE_FLOW_ACTION_TYPE_SET_TP_DST\n\nThe example testpmd command is:\n\n    flow create 0 transfer ingress\n         pattern eth / ipv4 / udp dst is 7000 / end\n\t actions set_ipv4_src ipv4_addr 172.168.0.1 /\n\t set_ipv4_dst ipv4_addr 172.168.10.1 /\n\t set_tp_dst port 9000 /\n\t set_tp_src port 700 /\n\t port_id id 1 / end\n\nSigned-off-by: Xiaoyu Min <jackmin@mellanox.com>\nAcked-by: Yongseok Koh <yskoh@mellanox.com>\n---\nv2:\n * rebased\n * validate pedit actions with drop action\n * validate successive pedit actions\n * a more generic way of validation\n * added testpmd commands in commit log\n * added comments of new added functions\n * fix some coding style issue\nv3:\n * fix some coding style issue\n * calc pedit keys become macro\n\n drivers/net/mlx5/Makefile        |   5 +\n drivers/net/mlx5/meson.build     |   2 +\n drivers/net/mlx5/mlx5_flow.h     |   6 +\n drivers/net/mlx5/mlx5_flow_tcf.c | 452 ++++++++++++++++++++++++++++++-\n 4 files changed, 459 insertions(+), 6 deletions(-)",
    "diff": "diff --git a/drivers/net/mlx5/Makefile b/drivers/net/mlx5/Makefile\nindex ca1de9f21..49b95e78e 100644\n--- a/drivers/net/mlx5/Makefile\n+++ b/drivers/net/mlx5/Makefile\n@@ -346,6 +346,11 @@ mlx5_autoconf.h.new: $(RTE_SDK)/buildtools/auto-config-h.sh\n \t\tlinux/tc_act/tc_vlan.h \\\n \t\tenum TCA_VLAN_PUSH_VLAN_PRIORITY \\\n \t\t$(AUTOCONF_OUTPUT)\n+\t$Q sh -- '$<' '$@' \\\n+\t\tHAVE_TC_ACT_PEDIT \\\n+\t\tlinux/tc_act/tc_pedit.h \\\n+\t\tenum TCA_PEDIT_KEY_EX_HDR_TYPE_UDP \\\n+\t\t$(AUTOCONF_OUTPUT)\n \t$Q sh -- '$<' '$@' \\\n \t\tHAVE_SUPPORTED_40000baseKR4_Full \\\n \t\t/usr/include/linux/ethtool.h \\\ndiff --git a/drivers/net/mlx5/meson.build b/drivers/net/mlx5/meson.build\nindex fd93ac162..ef6a85101 100644\n--- a/drivers/net/mlx5/meson.build\n+++ b/drivers/net/mlx5/meson.build\n@@ -182,6 +182,8 @@ if build\n \t\t'TCA_FLOWER_KEY_VLAN_ETH_TYPE' ],\n \t\t[ 'HAVE_TC_ACT_VLAN', 'linux/tc_act/tc_vlan.h',\n \t\t'TCA_VLAN_PUSH_VLAN_PRIORITY' ],\n+\t\t[ 'HAVE_TC_ACT_PEDIT', 'linux/tc_act/tc_pedit.h',\n+\t\t'TCA_PEDIT_KEY_EX_HDR_TYPE_UDP' ],\n \t\t[ 'HAVE_RDMA_NL_NLDEV', 'rdma/rdma_netlink.h',\n \t\t'RDMA_NL_NLDEV' ],\n \t\t[ 'HAVE_RDMA_NLDEV_CMD_GET', 'rdma/rdma_netlink.h',\ndiff --git a/drivers/net/mlx5/mlx5_flow.h b/drivers/net/mlx5/mlx5_flow.h\nindex 12de841e8..cbb8c56c8 100644\n--- a/drivers/net/mlx5/mlx5_flow.h\n+++ b/drivers/net/mlx5/mlx5_flow.h\n@@ -78,6 +78,12 @@\n #define MLX5_FLOW_ACTION_OF_PUSH_VLAN (1u << 8)\n #define MLX5_FLOW_ACTION_OF_SET_VLAN_VID (1u << 9)\n #define MLX5_FLOW_ACTION_OF_SET_VLAN_PCP (1u << 10)\n+#define MLX5_FLOW_ACTION_SET_IPV4_SRC (1u << 11)\n+#define MLX5_FLOW_ACTION_SET_IPV4_DST (1u << 12)\n+#define MLX5_FLOW_ACTION_SET_IPV6_SRC (1u << 13)\n+#define MLX5_FLOW_ACTION_SET_IPV6_DST (1u << 14)\n+#define MLX5_FLOW_ACTION_SET_TP_SRC (1u << 15)\n+#define MLX5_FLOW_ACTION_SET_TP_DST (1u << 16)\n \n #define MLX5_FLOW_FATE_ACTIONS \\\n \t(MLX5_FLOW_ACTION_DROP | MLX5_FLOW_ACTION_QUEUE | MLX5_FLOW_ACTION_RSS)\ndiff --git a/drivers/net/mlx5/mlx5_flow_tcf.c b/drivers/net/mlx5/mlx5_flow_tcf.c\nindex 91f6ef678..c9214583a 100644\n--- a/drivers/net/mlx5/mlx5_flow_tcf.c\n+++ b/drivers/net/mlx5/mlx5_flow_tcf.c\n@@ -53,6 +53,63 @@ struct tc_vlan {\n \n #endif /* HAVE_TC_ACT_VLAN */\n \n+#ifdef HAVE_TC_ACT_PEDIT\n+\n+#include <linux/tc_act/tc_pedit.h>\n+\n+#else /* HAVE_TC_ACT_VLAN */\n+\n+enum {\n+\tTCA_PEDIT_UNSPEC,\n+\tTCA_PEDIT_TM,\n+\tTCA_PEDIT_PARMS,\n+\tTCA_PEDIT_PAD,\n+\tTCA_PEDIT_PARMS_EX,\n+\tTCA_PEDIT_KEYS_EX,\n+\tTCA_PEDIT_KEY_EX,\n+\t__TCA_PEDIT_MAX\n+};\n+\n+enum {\n+\tTCA_PEDIT_KEY_EX_HTYPE = 1,\n+\tTCA_PEDIT_KEY_EX_CMD = 2,\n+\t__TCA_PEDIT_KEY_EX_MAX\n+};\n+\n+enum pedit_header_type {\n+\tTCA_PEDIT_KEY_EX_HDR_TYPE_NETWORK = 0,\n+\tTCA_PEDIT_KEY_EX_HDR_TYPE_ETH = 1,\n+\tTCA_PEDIT_KEY_EX_HDR_TYPE_IP4 = 2,\n+\tTCA_PEDIT_KEY_EX_HDR_TYPE_IP6 = 3,\n+\tTCA_PEDIT_KEY_EX_HDR_TYPE_TCP = 4,\n+\tTCA_PEDIT_KEY_EX_HDR_TYPE_UDP = 5,\n+\t__PEDIT_HDR_TYPE_MAX,\n+};\n+\n+enum pedit_cmd {\n+\tTCA_PEDIT_KEY_EX_CMD_SET = 0,\n+\tTCA_PEDIT_KEY_EX_CMD_ADD = 1,\n+\t__PEDIT_CMD_MAX,\n+};\n+\n+struct tc_pedit_key {\n+\t__u32           mask;  /* AND */\n+\t__u32           val;   /*XOR */\n+\t__u32           off;  /*offset */\n+\t__u32           at;\n+\t__u32           offmask;\n+\t__u32           shift;\n+};\n+\n+struct tc_pedit_sel {\n+\ttc_gen;\n+\tunsigned char           nkeys;\n+\tunsigned char           flags;\n+\tstruct tc_pedit_key     keys[0];\n+};\n+\n+#endif /* HAVE_TC_ACT_VLAN */\n+\n /* Normally found in linux/netlink.h. */\n #ifndef NETLINK_CAP_ACK\n #define NETLINK_CAP_ACK 10\n@@ -153,6 +210,14 @@ struct tc_vlan {\n #define IPV6_ADDR_LEN 16\n #endif\n \n+#ifndef IPV4_ADDR_LEN\n+#define IPV4_ADDR_LEN 4\n+#endif\n+\n+#ifndef TP_PORT_LEN\n+#define TP_PORT_LEN 2 /* Transport Port (UDP/TCP) Length */\n+#endif\n+\n /** Empty masks for known item types. */\n static const union {\n \tstruct rte_flow_item_port_id port_id;\n@@ -230,6 +295,268 @@ struct flow_tcf_ptoi {\n \t(MLX5_FLOW_ACTION_OF_POP_VLAN | MLX5_FLOW_ACTION_OF_PUSH_VLAN | \\\n \t MLX5_FLOW_ACTION_OF_SET_VLAN_VID | MLX5_FLOW_ACTION_OF_SET_VLAN_PCP)\n \n+#define MLX5_TCF_PEDIT_ACTIONS \\\n+\t(MLX5_FLOW_ACTION_SET_IPV4_SRC | MLX5_FLOW_ACTION_SET_IPV4_DST | \\\n+\t MLX5_FLOW_ACTION_SET_IPV6_SRC | MLX5_FLOW_ACTION_SET_IPV6_DST | \\\n+\t MLX5_FLOW_ACTION_SET_TP_SRC | MLX5_FLOW_ACTION_SET_TP_DST)\n+\n+#define MLX5_TCF_CONFIG_ACTIONS \\\n+\t(MLX5_FLOW_ACTION_PORT_ID | MLX5_FLOW_ACTION_OF_PUSH_VLAN | \\\n+\t MLX5_FLOW_ACTION_OF_SET_VLAN_VID | MLX5_FLOW_ACTION_OF_SET_VLAN_PCP | \\\n+\t MLX5_TCF_PEDIT_ACTIONS)\n+\n+#define MAX_PEDIT_KEYS 128\n+#define SZ_PEDIT_KEY_VAL 4\n+\n+#define NUM_OF_PEDIT_KEYS(sz) \\\n+\t(((sz) / SZ_PEDIT_KEY_VAL) + (((sz) % SZ_PEDIT_KEY_VAL) ? 1 : 0))\n+\n+struct pedit_key_ex {\n+\tenum pedit_header_type htype;\n+\tenum pedit_cmd cmd;\n+};\n+\n+struct pedit_parser {\n+\tstruct tc_pedit_sel sel;\n+\tstruct tc_pedit_key keys[MAX_PEDIT_KEYS];\n+\tstruct pedit_key_ex keys_ex[MAX_PEDIT_KEYS];\n+};\n+\n+\n+/**\n+ * Set pedit key of transport (TCP/UDP) port value\n+ *\n+ * @param[in] actions\n+ *   pointer to action specification\n+ * @param[in,out] p_parser\n+ *   pointer to pedit_parser\n+ * @param[in] item_flags\n+ *   flags of all items presented\n+ */\n+static void\n+flow_tcf_pedit_key_set_tp_port(const struct rte_flow_action *actions,\n+\t\t\t\tstruct pedit_parser *p_parser,\n+\t\t\t\tuint64_t item_flags)\n+{\n+\tint idx = p_parser->sel.nkeys;\n+\n+\tif (item_flags & MLX5_FLOW_LAYER_OUTER_L4_UDP)\n+\t\tp_parser->keys_ex[idx].htype = TCA_PEDIT_KEY_EX_HDR_TYPE_UDP;\n+\tif (item_flags & MLX5_FLOW_LAYER_OUTER_L4_TCP)\n+\t\tp_parser->keys_ex[idx].htype = TCA_PEDIT_KEY_EX_HDR_TYPE_TCP;\n+\tp_parser->keys_ex[idx].cmd = TCA_PEDIT_KEY_EX_CMD_SET;\n+\t/* offset of src/dst port is same for TCP and UDP */\n+\tp_parser->keys[idx].off =\n+\t\tactions->type == RTE_FLOW_ACTION_TYPE_SET_TP_SRC ?\n+\t\toffsetof(struct tcp_hdr, src_port) :\n+\t\toffsetof(struct tcp_hdr, dst_port);\n+\tp_parser->keys[idx].mask = 0xFFFF0000;\n+\tp_parser->keys[idx].val =\n+\t\t(__u32)((const struct rte_flow_action_set_tp *)\n+\t\t\t\tactions->conf)->port;\n+\tp_parser->sel.nkeys = (++idx);\n+}\n+\n+/**\n+ * Set pedit key of ipv6 address\n+ *\n+ * @param[in] actions\n+ *   pointer to action specification\n+ * @param[in,out] p_parser\n+ *   pointer to pedit_parser\n+ */\n+static void\n+flow_tcf_pedit_key_set_ipv6_addr(const struct rte_flow_action *actions,\n+\t\t\t\t struct pedit_parser *p_parser)\n+{\n+\tint idx = p_parser->sel.nkeys;\n+\tint keys = NUM_OF_PEDIT_KEYS(IPV6_ADDR_LEN);\n+\tint off_base =\n+\t\tactions->type == RTE_FLOW_ACTION_TYPE_SET_IPV6_SRC ?\n+\t\toffsetof(struct ipv6_hdr, src_addr) :\n+\t\toffsetof(struct ipv6_hdr, dst_addr);\n+\tconst struct rte_flow_action_set_ipv6 *conf =\n+\t\t(const struct rte_flow_action_set_ipv6 *)actions->conf;\n+\n+\tfor (int i = 0; i < keys; i++, idx++) {\n+\t\tp_parser->keys_ex[idx].htype = TCA_PEDIT_KEY_EX_HDR_TYPE_IP6;\n+\t\tp_parser->keys_ex[idx].cmd = TCA_PEDIT_KEY_EX_CMD_SET;\n+\t\tp_parser->keys[idx].off = off_base + i * SZ_PEDIT_KEY_VAL;\n+\t\tp_parser->keys[idx].mask = ~UINT32_MAX;\n+\t\tmemcpy(&p_parser->keys[idx].val,\n+\t\t\tconf->ipv6_addr + i *  SZ_PEDIT_KEY_VAL,\n+\t\t\tSZ_PEDIT_KEY_VAL);\n+\t}\n+\tp_parser->sel.nkeys += keys;\n+}\n+\n+/**\n+ * Set pedit key of ipv4 address\n+ *\n+ * @param[in] actions\n+ *   pointer to action specification\n+ * @param[in,out] p_parser\n+ *   pointer to pedit_parser\n+ */\n+static void\n+flow_tcf_pedit_key_set_ipv4_addr(const struct rte_flow_action *actions,\n+\t\t\t\t struct pedit_parser *p_parser)\n+{\n+\tint idx = p_parser->sel.nkeys;\n+\n+\tp_parser->keys_ex[idx].htype = TCA_PEDIT_KEY_EX_HDR_TYPE_IP4;\n+\tp_parser->keys_ex[idx].cmd = TCA_PEDIT_KEY_EX_CMD_SET;\n+\tp_parser->keys[idx].off =\n+\t\tactions->type == RTE_FLOW_ACTION_TYPE_SET_IPV4_SRC ?\n+\t\toffsetof(struct ipv4_hdr, src_addr) :\n+\t\toffsetof(struct ipv4_hdr, dst_addr);\n+\tp_parser->keys[idx].mask = ~UINT32_MAX;\n+\tp_parser->keys[idx].val =\n+\t\t((const struct rte_flow_action_set_ipv4 *)\n+\t\t actions->conf)->ipv4_addr;\n+\tp_parser->sel.nkeys = (++idx);\n+}\n+\n+/**\n+ * Create the pedit's na attribute in netlink message\n+ * on pre-allocate message buffer\n+ *\n+ * @param[in,out] nl\n+ *   pointer to pre-allocated netlink message buffer\n+ * @param[in,out] actions\n+ *   pointer to pointer of actions specification.\n+ * @param[in,out] action_flags\n+ *   pointer to actions flags\n+ * @param[in] item_flags\n+ *   flags of all item presented\n+ */\n+static void\n+flow_tcf_create_pedit_mnl_msg(struct nlmsghdr *nl,\n+\t\t\t      const struct rte_flow_action **actions,\n+\t\t\t      uint64_t item_flags)\n+{\n+\tstruct pedit_parser p_parser;\n+\tstruct nlattr *na_act_options =\n+\t\tmnl_attr_nest_start(nl, TCA_ACT_OPTIONS);\n+\tstruct nlattr *na_pedit_keys;\n+\n+\tmemset(&p_parser, 0, sizeof(p_parser));\n+\tmnl_attr_put_strz(nl, TCA_ACT_KIND, \"pedit\");\n+\t/* all modify header actions should be in one tc-pedit action */\n+\tfor (; (*actions)->type != RTE_FLOW_ACTION_TYPE_END; (*actions)++) {\n+\t\tswitch ((*actions)->type) {\n+\t\tcase RTE_FLOW_ACTION_TYPE_SET_IPV4_SRC:\n+\t\tcase RTE_FLOW_ACTION_TYPE_SET_IPV4_DST:\n+\t\t\tflow_tcf_pedit_key_set_ipv4_addr(*actions, &p_parser);\n+\t\t\tbreak;\n+\t\tcase RTE_FLOW_ACTION_TYPE_SET_IPV6_SRC:\n+\t\tcase RTE_FLOW_ACTION_TYPE_SET_IPV6_DST:\n+\t\t\tflow_tcf_pedit_key_set_ipv6_addr(*actions, &p_parser);\n+\t\t\tbreak;\n+\t\tcase RTE_FLOW_ACTION_TYPE_SET_TP_SRC:\n+\t\tcase RTE_FLOW_ACTION_TYPE_SET_TP_DST:\n+\t\t\tflow_tcf_pedit_key_set_tp_port(*actions,\n+\t\t\t\t\t\t\t&p_parser, item_flags);\n+\t\t\tbreak;\n+\t\tdefault:\n+\t\t\tgoto pedit_mnl_msg_done;\n+\t\t}\n+\t}\n+pedit_mnl_msg_done:\n+\tp_parser.sel.action = TC_ACT_PIPE;\n+\tmnl_attr_put(nl, TCA_PEDIT_PARMS_EX,\n+\t\t     sizeof(p_parser.sel) +\n+\t\t     p_parser.sel.nkeys * sizeof(struct tc_pedit_key),\n+\t\t     &p_parser);\n+\tna_pedit_keys =\n+\t\tmnl_attr_nest_start(nl, TCA_PEDIT_KEYS_EX | NLA_F_NESTED);\n+\tfor (int i = 0; i < p_parser.sel.nkeys; i++) {\n+\t\tstruct nlattr *na_pedit_key =\n+\t\t\tmnl_attr_nest_start(nl,\n+\t\t\t\t\t    TCA_PEDIT_KEY_EX | NLA_F_NESTED);\n+\t\tmnl_attr_put_u16(nl, TCA_PEDIT_KEY_EX_HTYPE,\n+\t\t\t\t p_parser.keys_ex[i].htype);\n+\t\tmnl_attr_put_u16(nl, TCA_PEDIT_KEY_EX_CMD,\n+\t\t\t\t p_parser.keys_ex[i].cmd);\n+\t\tmnl_attr_nest_end(nl, na_pedit_key);\n+\t}\n+\tmnl_attr_nest_end(nl, na_pedit_keys);\n+\tmnl_attr_nest_end(nl, na_act_options);\n+\t(*actions)--;\n+}\n+\n+/**\n+ * Calculate max memory size of one TC-pedit actions.\n+ * One TC-pedit action can contain set of keys each defining\n+ * a rewrite element (rte_flow action)\n+ *\n+ * @param[in,out] actions\n+ *   actions specification.\n+ * @param[in,out] action_flags\n+ *   actions flags\n+ * @param[in,out] size\n+ *   accumulated size\n+ * @return\n+ *   Max memory size of one TC-pedit action\n+ */\n+static int\n+flow_tcf_get_pedit_actions_size(const struct rte_flow_action **actions,\n+\t\t\t\tuint64_t *action_flags)\n+{\n+\tint pedit_size = 0;\n+\tint keys = 0;\n+\tuint64_t flags = 0;\n+\n+\tpedit_size += SZ_NLATTR_NEST + /* na_act_index. */\n+\t\t      SZ_NLATTR_STRZ_OF(\"pedit\") +\n+\t\t      SZ_NLATTR_NEST; /* TCA_ACT_OPTIONS. */\n+\tfor (; (*actions)->type != RTE_FLOW_ACTION_TYPE_END; (*actions)++) {\n+\t\tswitch ((*actions)->type) {\n+\t\tcase RTE_FLOW_ACTION_TYPE_SET_IPV4_SRC:\n+\t\t\tkeys += NUM_OF_PEDIT_KEYS(IPV4_ADDR_LEN);\n+\t\t\tflags |= MLX5_FLOW_ACTION_SET_IPV4_SRC;\n+\t\t\tbreak;\n+\t\tcase RTE_FLOW_ACTION_TYPE_SET_IPV4_DST:\n+\t\t\tkeys += NUM_OF_PEDIT_KEYS(IPV4_ADDR_LEN);\n+\t\t\tflags |= MLX5_FLOW_ACTION_SET_IPV4_DST;\n+\t\t\tbreak;\n+\t\tcase RTE_FLOW_ACTION_TYPE_SET_IPV6_SRC:\n+\t\t\tkeys += NUM_OF_PEDIT_KEYS(IPV6_ADDR_LEN);\n+\t\t\tflags |= MLX5_FLOW_ACTION_SET_IPV6_SRC;\n+\t\t\tbreak;\n+\t\tcase RTE_FLOW_ACTION_TYPE_SET_IPV6_DST:\n+\t\t\tkeys += NUM_OF_PEDIT_KEYS(IPV6_ADDR_LEN);\n+\t\t\tflags |= MLX5_FLOW_ACTION_SET_IPV6_DST;\n+\t\t\tbreak;\n+\t\tcase RTE_FLOW_ACTION_TYPE_SET_TP_SRC:\n+\t\t\t/* TCP is as same as UDP */\n+\t\t\tkeys += NUM_OF_PEDIT_KEYS(TP_PORT_LEN);\n+\t\t\tflags |= MLX5_FLOW_ACTION_SET_TP_SRC;\n+\t\t\tbreak;\n+\t\tcase RTE_FLOW_ACTION_TYPE_SET_TP_DST:\n+\t\t\t/* TCP is as same as UDP */\n+\t\t\tkeys += NUM_OF_PEDIT_KEYS(TP_PORT_LEN);\n+\t\t\tflags |= MLX5_FLOW_ACTION_SET_TP_DST;\n+\t\t\tbreak;\n+\t\tdefault:\n+\t\t\tgoto get_pedit_action_size_done;\n+\t\t}\n+\t}\n+get_pedit_action_size_done:\n+\t/* TCA_PEDIT_PARAMS_EX */\n+\tpedit_size +=\n+\t\tSZ_NLATTR_DATA_OF(sizeof(struct tc_pedit_sel) +\n+\t\t\t\t  keys * sizeof(struct tc_pedit_key));\n+\tpedit_size += SZ_NLATTR_NEST; /* TCA_PEDIT_KEYS */\n+\tpedit_size += keys *\n+\t\t      /* TCA_PEDIT_KEY_EX + HTYPE + CMD */\n+\t\t      (SZ_NLATTR_NEST + SZ_NLATTR_DATA_OF(2) +\n+\t\t       SZ_NLATTR_DATA_OF(2));\n+\t(*action_flags) |= flags;\n+\t(*actions)--;\n+\treturn pedit_size;\n+}\n+\n /**\n  * Retrieve mask for pattern item.\n  *\n@@ -433,11 +760,14 @@ flow_tcf_validate(struct rte_eth_dev *dev,\n \t\t\tof_set_vlan_vid;\n \t\tconst struct rte_flow_action_of_set_vlan_pcp *\n \t\t\tof_set_vlan_pcp;\n+\t\tconst struct rte_flow_action_set_ipv4 *set_ipv4;\n+\t\tconst struct rte_flow_action_set_ipv6 *set_ipv6;\n \t} conf;\n \tuint32_t item_flags = 0;\n \tuint32_t action_flags = 0;\n \tuint8_t next_protocol = -1;\n \tunsigned int tcm_ifindex = 0;\n+\tuint8_t pedit_validated = 0;\n \tstruct flow_tcf_ptoi ptoi[PTOI_TABLE_SZ_MAX(dev)];\n \tstruct rte_eth_dev *port_id_dev = NULL;\n \tbool in_port_id_set;\n@@ -648,16 +978,20 @@ flow_tcf_validate(struct rte_eth_dev *dev,\n \t}\n \tfor (; actions->type != RTE_FLOW_ACTION_TYPE_END; actions++) {\n \t\tunsigned int i;\n+\t\tuint32_t current_action_flag = 0;\n \n \t\tswitch (actions->type) {\n \t\tcase RTE_FLOW_ACTION_TYPE_VOID:\n \t\t\tbreak;\n \t\tcase RTE_FLOW_ACTION_TYPE_PORT_ID:\n+\t\t\tcurrent_action_flag = MLX5_FLOW_ACTION_PORT_ID;\n \t\t\tif (action_flags & MLX5_TCF_FATE_ACTIONS)\n \t\t\t\treturn rte_flow_error_set\n \t\t\t\t\t(error, EINVAL,\n \t\t\t\t\t RTE_FLOW_ERROR_TYPE_ACTION, actions,\n \t\t\t\t\t \"can't have multiple fate actions\");\n+\t\t\tif (!actions->conf)\n+\t\t\t\tbreak;\n \t\t\tconf.port_id = actions->conf;\n \t\t\tif (conf.port_id->original)\n \t\t\t\ti = 0;\n@@ -672,7 +1006,6 @@ flow_tcf_validate(struct rte_eth_dev *dev,\n \t\t\t\t\t conf.port_id,\n \t\t\t\t\t \"missing data to convert port ID to\"\n \t\t\t\t\t \" ifindex\");\n-\t\t\taction_flags |= MLX5_FLOW_ACTION_PORT_ID;\n \t\t\tport_id_dev = &rte_eth_devices[conf.port_id->id];\n \t\t\tbreak;\n \t\tcase RTE_FLOW_ACTION_TYPE_DROP:\n@@ -681,13 +1014,13 @@ flow_tcf_validate(struct rte_eth_dev *dev,\n \t\t\t\t\t(error, EINVAL,\n \t\t\t\t\t RTE_FLOW_ERROR_TYPE_ACTION, actions,\n \t\t\t\t\t \"can't have multiple fate actions\");\n-\t\t\taction_flags |= MLX5_FLOW_ACTION_DROP;\n+\t\t\tcurrent_action_flag = MLX5_FLOW_ACTION_DROP;\n \t\t\tbreak;\n \t\tcase RTE_FLOW_ACTION_TYPE_OF_POP_VLAN:\n-\t\t\taction_flags |= MLX5_FLOW_ACTION_OF_POP_VLAN;\n+\t\t\tcurrent_action_flag = MLX5_FLOW_ACTION_OF_POP_VLAN;\n \t\t\tbreak;\n \t\tcase RTE_FLOW_ACTION_TYPE_OF_PUSH_VLAN:\n-\t\t\taction_flags |= MLX5_FLOW_ACTION_OF_PUSH_VLAN;\n+\t\t\tcurrent_action_flag = MLX5_FLOW_ACTION_OF_PUSH_VLAN;\n \t\t\tbreak;\n \t\tcase RTE_FLOW_ACTION_TYPE_OF_SET_VLAN_VID:\n \t\t\tif (!(action_flags & MLX5_FLOW_ACTION_OF_PUSH_VLAN))\n@@ -696,7 +1029,7 @@ flow_tcf_validate(struct rte_eth_dev *dev,\n \t\t\t\t\t RTE_FLOW_ERROR_TYPE_ACTION, actions,\n \t\t\t\t\t \"vlan modify is not supported,\"\n \t\t\t\t\t \" set action must follow push action\");\n-\t\t\taction_flags |= MLX5_FLOW_ACTION_OF_SET_VLAN_VID;\n+\t\t\tcurrent_action_flag = MLX5_FLOW_ACTION_OF_SET_VLAN_VID;\n \t\t\tbreak;\n \t\tcase RTE_FLOW_ACTION_TYPE_OF_SET_VLAN_PCP:\n \t\t\tif (!(action_flags & MLX5_FLOW_ACTION_OF_PUSH_VLAN))\n@@ -705,7 +1038,25 @@ flow_tcf_validate(struct rte_eth_dev *dev,\n \t\t\t\t\t RTE_FLOW_ERROR_TYPE_ACTION, actions,\n \t\t\t\t\t \"vlan modify is not supported,\"\n \t\t\t\t\t \" set action must follow push action\");\n-\t\t\taction_flags |= MLX5_FLOW_ACTION_OF_SET_VLAN_PCP;\n+\t\t\tcurrent_action_flag = MLX5_FLOW_ACTION_OF_SET_VLAN_PCP;\n+\t\t\tbreak;\n+\t\tcase RTE_FLOW_ACTION_TYPE_SET_IPV4_SRC:\n+\t\t\tcurrent_action_flag = MLX5_FLOW_ACTION_SET_IPV4_SRC;\n+\t\t\tbreak;\n+\t\tcase RTE_FLOW_ACTION_TYPE_SET_IPV4_DST:\n+\t\t\tcurrent_action_flag = MLX5_FLOW_ACTION_SET_IPV4_DST;\n+\t\t\tbreak;\n+\t\tcase RTE_FLOW_ACTION_TYPE_SET_IPV6_SRC:\n+\t\t\tcurrent_action_flag = MLX5_FLOW_ACTION_SET_IPV6_SRC;\n+\t\t\tbreak;\n+\t\tcase RTE_FLOW_ACTION_TYPE_SET_IPV6_DST:\n+\t\t\tcurrent_action_flag = MLX5_FLOW_ACTION_SET_IPV6_DST;\n+\t\t\tbreak;\n+\t\tcase RTE_FLOW_ACTION_TYPE_SET_TP_SRC:\n+\t\t\tcurrent_action_flag = MLX5_FLOW_ACTION_SET_TP_SRC;\n+\t\t\tbreak;\n+\t\tcase RTE_FLOW_ACTION_TYPE_SET_TP_DST:\n+\t\t\tcurrent_action_flag = MLX5_FLOW_ACTION_SET_TP_DST;\n \t\t\tbreak;\n \t\tdefault:\n \t\t\treturn rte_flow_error_set(error, ENOTSUP,\n@@ -713,6 +1064,67 @@ flow_tcf_validate(struct rte_eth_dev *dev,\n \t\t\t\t\t\t  actions,\n \t\t\t\t\t\t  \"action not supported\");\n \t\t}\n+\t\tif (current_action_flag & MLX5_TCF_CONFIG_ACTIONS) {\n+\t\t\tif (!actions->conf)\n+\t\t\t\treturn rte_flow_error_set(error, EINVAL,\n+\t\t\t\t\t\tRTE_FLOW_ERROR_TYPE_ACTION_CONF,\n+\t\t\t\t\t\tactions,\n+\t\t\t\t\t\t\"action configuration not set\");\n+\t\t}\n+\t\tif ((current_action_flag & MLX5_TCF_PEDIT_ACTIONS) &&\n+\t\t\t\tpedit_validated)\n+\t\t\treturn rte_flow_error_set(error, ENOTSUP,\n+\t\t\t\t\t\t  RTE_FLOW_ERROR_TYPE_ACTION,\n+\t\t\t\t\t\t  actions,\n+\t\t\t\t\t\t  \"set actions should be \"\n+\t\t\t\t\t\t  \"listed successively\");\n+\t\tif ((current_action_flag & ~MLX5_TCF_PEDIT_ACTIONS) &&\n+\t\t    (action_flags & MLX5_TCF_PEDIT_ACTIONS))\n+\t\t\tpedit_validated = 1;\n+\t\taction_flags |= current_action_flag;\n+\t}\n+\tif ((action_flags & MLX5_TCF_PEDIT_ACTIONS) &&\n+\t    (action_flags & MLX5_FLOW_ACTION_DROP))\n+\t\treturn rte_flow_error_set(error, ENOTSUP,\n+\t\t\t\t\t  RTE_FLOW_ERROR_TYPE_ACTION,\n+\t\t\t\t\t  actions,\n+\t\t\t\t\t  \"set action is not compatible with \"\n+\t\t\t\t\t  \"drop action\");\n+\tif ((action_flags & MLX5_TCF_PEDIT_ACTIONS) &&\n+\t    !(action_flags & MLX5_FLOW_ACTION_PORT_ID))\n+\t\treturn rte_flow_error_set(error, ENOTSUP,\n+\t\t\t\t\t  RTE_FLOW_ERROR_TYPE_ACTION,\n+\t\t\t\t\t  actions,\n+\t\t\t\t\t  \"set action must be followed by \"\n+\t\t\t\t\t  \"port_id action\");\n+\tif (action_flags &\n+\t   (MLX5_FLOW_ACTION_SET_IPV4_SRC | MLX5_FLOW_ACTION_SET_IPV4_DST)) {\n+\t\tif (!(item_flags & MLX5_FLOW_LAYER_OUTER_L3_IPV4))\n+\t\t\treturn rte_flow_error_set(error, EINVAL,\n+\t\t\t\t\t\t  RTE_FLOW_ERROR_TYPE_ACTION,\n+\t\t\t\t\t\t  actions,\n+\t\t\t\t\t\t  \"no ipv4 item found in\"\n+\t\t\t\t\t\t  \" pattern\");\n+\t}\n+\tif (action_flags &\n+\t   (MLX5_FLOW_ACTION_SET_IPV6_SRC | MLX5_FLOW_ACTION_SET_IPV6_DST)) {\n+\t\tif (!(item_flags & MLX5_FLOW_LAYER_OUTER_L3_IPV6))\n+\t\t\treturn rte_flow_error_set(error, EINVAL,\n+\t\t\t\t\t\t  RTE_FLOW_ERROR_TYPE_ACTION,\n+\t\t\t\t\t\t  actions,\n+\t\t\t\t\t\t  \"no ipv6 item found in\"\n+\t\t\t\t\t\t  \" pattern\");\n+\t}\n+\tif (action_flags &\n+\t   (MLX5_FLOW_ACTION_SET_TP_SRC | MLX5_FLOW_ACTION_SET_TP_DST)) {\n+\t\tif (!(item_flags &\n+\t\t     (MLX5_FLOW_LAYER_OUTER_L4_UDP |\n+\t\t      MLX5_FLOW_LAYER_OUTER_L4_TCP)))\n+\t\t\treturn rte_flow_error_set(error, EINVAL,\n+\t\t\t\t\t\t  RTE_FLOW_ERROR_TYPE_ACTION,\n+\t\t\t\t\t\t  actions,\n+\t\t\t\t\t\t  \"no TCP/UDP item found in\"\n+\t\t\t\t\t\t  \" pattern\");\n \t}\n \t/*\n \t * FW syndrome (0xA9C090):\n@@ -884,6 +1296,15 @@ flow_tcf_get_actions_and_size(const struct rte_flow_action actions[],\n \t\t\t\tSZ_NLATTR_TYPE_OF(uint16_t) + /* VLAN ID. */\n \t\t\t\tSZ_NLATTR_TYPE_OF(uint8_t); /* VLAN prio. */\n \t\t\tbreak;\n+\t\tcase RTE_FLOW_ACTION_TYPE_SET_IPV4_SRC:\n+\t\tcase RTE_FLOW_ACTION_TYPE_SET_IPV4_DST:\n+\t\tcase RTE_FLOW_ACTION_TYPE_SET_IPV6_SRC:\n+\t\tcase RTE_FLOW_ACTION_TYPE_SET_IPV6_DST:\n+\t\tcase RTE_FLOW_ACTION_TYPE_SET_TP_SRC:\n+\t\tcase RTE_FLOW_ACTION_TYPE_SET_TP_DST:\n+\t\t\tsize += flow_tcf_get_pedit_actions_size(&actions,\n+\t\t\t\t\t\t\t\t&flags);\n+\t\t\tbreak;\n \t\tdefault:\n \t\t\tDRV_LOG(WARNING,\n \t\t\t\t\"unsupported action %p type %d,\"\n@@ -1042,6 +1463,7 @@ flow_tcf_translate(struct rte_eth_dev *dev, struct mlx5_flow *dev_flow,\n \tstruct nlattr *na_flower_act;\n \tstruct nlattr *na_vlan_id = NULL;\n \tstruct nlattr *na_vlan_priority = NULL;\n+\tuint64_t item_flags = 0;\n \n \tclaim_nonzero(flow_tcf_build_ptoi_table(dev, ptoi,\n \t\t\t\t\t\tPTOI_TABLE_SZ_MAX(dev)));\n@@ -1088,6 +1510,7 @@ flow_tcf_translate(struct rte_eth_dev *dev, struct mlx5_flow *dev_flow,\n \t\t\ttcm->tcm_ifindex = ptoi[i].ifindex;\n \t\t\tbreak;\n \t\tcase RTE_FLOW_ITEM_TYPE_ETH:\n+\t\t\titem_flags |= MLX5_FLOW_LAYER_OUTER_L2;\n \t\t\tmask.eth = flow_tcf_item_mask\n \t\t\t\t(items, &rte_flow_item_eth_mask,\n \t\t\t\t &flow_tcf_mask_supported.eth,\n@@ -1121,6 +1544,7 @@ flow_tcf_translate(struct rte_eth_dev *dev, struct mlx5_flow *dev_flow,\n \t\t\t}\n \t\t\tbreak;\n \t\tcase RTE_FLOW_ITEM_TYPE_VLAN:\n+\t\t\titem_flags |= MLX5_FLOW_LAYER_OUTER_VLAN;\n \t\t\tmask.vlan = flow_tcf_item_mask\n \t\t\t\t(items, &rte_flow_item_vlan_mask,\n \t\t\t\t &flow_tcf_mask_supported.vlan,\n@@ -1153,6 +1577,7 @@ flow_tcf_translate(struct rte_eth_dev *dev, struct mlx5_flow *dev_flow,\n \t\t\t\t\t\t  RTE_BE16(0x0fff)));\n \t\t\tbreak;\n \t\tcase RTE_FLOW_ITEM_TYPE_IPV4:\n+\t\t\titem_flags |= MLX5_FLOW_LAYER_OUTER_L3_IPV4;\n \t\t\tmask.ipv4 = flow_tcf_item_mask\n \t\t\t\t(items, &rte_flow_item_ipv4_mask,\n \t\t\t\t &flow_tcf_mask_supported.ipv4,\n@@ -1192,6 +1617,7 @@ flow_tcf_translate(struct rte_eth_dev *dev, struct mlx5_flow *dev_flow,\n \t\t\t}\n \t\t\tbreak;\n \t\tcase RTE_FLOW_ITEM_TYPE_IPV6:\n+\t\t\titem_flags |= MLX5_FLOW_LAYER_OUTER_L3_IPV6;\n \t\t\tmask.ipv6 = flow_tcf_item_mask\n \t\t\t\t(items, &rte_flow_item_ipv6_mask,\n \t\t\t\t &flow_tcf_mask_supported.ipv6,\n@@ -1233,6 +1659,7 @@ flow_tcf_translate(struct rte_eth_dev *dev, struct mlx5_flow *dev_flow,\n \t\t\t}\n \t\t\tbreak;\n \t\tcase RTE_FLOW_ITEM_TYPE_UDP:\n+\t\t\titem_flags |= MLX5_FLOW_LAYER_OUTER_L4_UDP;\n \t\t\tmask.udp = flow_tcf_item_mask\n \t\t\t\t(items, &rte_flow_item_udp_mask,\n \t\t\t\t &flow_tcf_mask_supported.udp,\n@@ -1262,6 +1689,7 @@ flow_tcf_translate(struct rte_eth_dev *dev, struct mlx5_flow *dev_flow,\n \t\t\t}\n \t\t\tbreak;\n \t\tcase RTE_FLOW_ITEM_TYPE_TCP:\n+\t\t\titem_flags |= MLX5_FLOW_LAYER_OUTER_L4_TCP;\n \t\t\tmask.tcp = flow_tcf_item_mask\n \t\t\t\t(items, &rte_flow_item_tcp_mask,\n \t\t\t\t &flow_tcf_mask_supported.tcp,\n@@ -1412,6 +1840,18 @@ flow_tcf_translate(struct rte_eth_dev *dev, struct mlx5_flow *dev_flow,\n \t\t\t\t\tconf.of_set_vlan_pcp->vlan_pcp;\n \t\t\t}\n \t\t\tbreak;\n+\t\tcase RTE_FLOW_ACTION_TYPE_SET_IPV4_SRC:\n+\t\tcase RTE_FLOW_ACTION_TYPE_SET_IPV4_DST:\n+\t\tcase RTE_FLOW_ACTION_TYPE_SET_IPV6_SRC:\n+\t\tcase RTE_FLOW_ACTION_TYPE_SET_IPV6_DST:\n+\t\tcase RTE_FLOW_ACTION_TYPE_SET_TP_SRC:\n+\t\tcase RTE_FLOW_ACTION_TYPE_SET_TP_DST:\n+\t\t\tna_act_index =\n+\t\t\t\tmnl_attr_nest_start(nlh, na_act_index_cur++);\n+\t\t\tflow_tcf_create_pedit_mnl_msg(nlh,\n+\t\t\t\t\t\t      &actions, item_flags);\n+\t\t\tmnl_attr_nest_end(nlh, na_act_index);\n+\t\t\tbreak;\n \t\tdefault:\n \t\t\treturn rte_flow_error_set(error, ENOTSUP,\n \t\t\t\t\t\t  RTE_FLOW_ERROR_TYPE_ACTION,\n",
    "prefixes": [
        "v3"
    ]
}