get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 45617,
    "url": "https://patches.dpdk.org/api/patches/45617/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20180928225410.7819-1-yskoh@mellanox.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": "<20180928225410.7819-1-yskoh@mellanox.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20180928225410.7819-1-yskoh@mellanox.com",
    "date": "2018-09-28T22:54:22",
    "name": "test original",
    "commit_ref": null,
    "pull_url": null,
    "state": "not-applicable",
    "archived": true,
    "hash": "c1caa033445a1b2d9c25f3b821383f367833283f",
    "submitter": {
        "id": 636,
        "url": "https://patches.dpdk.org/api/people/636/?format=api",
        "name": "Yongseok Koh",
        "email": "yskoh@mellanox.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20180928225410.7819-1-yskoh@mellanox.com/mbox/",
    "series": [
        {
            "id": 1586,
            "url": "https://patches.dpdk.org/api/series/1586/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=1586",
            "date": "2018-09-28T22:54:22",
            "name": "test original",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/1586/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/45617/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/45617/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 2A24D1B416;\n\tSat, 29 Sep 2018 00:54:26 +0200 (CEST)",
            "from EUR01-VE1-obe.outbound.protection.outlook.com\n\t(mail-ve1eur01on0055.outbound.protection.outlook.com [104.47.1.55])\n\tby dpdk.org (Postfix) with ESMTP id D07911B2B3\n\tfor <dev@dpdk.org>; Sat, 29 Sep 2018 00:54:24 +0200 (CEST)",
            "from DB3PR0502MB3980.eurprd05.prod.outlook.com (52.134.72.27) by\n\tDB3PR0502MB4027.eurprd05.prod.outlook.com (52.134.72.144) with\n\tMicrosoft SMTP Server (version=TLS1_2,\n\tcipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id\n\t15.20.1164.25; Fri, 28 Sep 2018 22:54:22 +0000",
            "from DB3PR0502MB3980.eurprd05.prod.outlook.com\n\t([fe80::1cb0:661b:ecab:6045]) by\n\tDB3PR0502MB3980.eurprd05.prod.outlook.com\n\t([fe80::1cb0:661b:ecab:6045%2]) with mapi id 15.20.1164.024;\n\tFri, 28 Sep 2018 22:54:22 +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=hhxC7K+OzdABgs36Cxcbfm1IDKk7rUm3y74tQK6O4gM=;\n\tb=XZDAX+vRSSCarCqxVjgLnNnIONqYhpBQRFIV3dlhnOfDG20/K2k7mzsbFeOzHo02cI6FTVSsEXWLTFcLHfcDG0GP8rBt/K3n44ZJ51rJNtWQE0dSoUUhXYeIZ9zi1CGlutCYi022WO4cREyYoW5xY9wED70XXylTig1rTwqpu+s=",
        "From": "Yongseok Koh <yskoh@mellanox.com>",
        "To": "Thomas Monjalon <thomas@monjalon.net>, Thomas Monjalon\n\t<thomasm@mellanox.com>",
        "CC": "\"dev@dpdk.org\" <dev@dpdk.org>, Yongseok Koh <yskoh@mellanox.com>",
        "Thread-Topic": "[PATCH] test original",
        "Thread-Index": "AQHUV34yVdcw1nC4r06YBsdfNha4JA==",
        "Date": "Fri, 28 Sep 2018 22:54:22 +0000",
        "Message-ID": "<20180928225410.7819-1-yskoh@mellanox.com>",
        "Accept-Language": "en-US",
        "Content-Language": "en-US",
        "X-MS-Has-Attach": "",
        "X-MS-TNEF-Correlator": "",
        "x-clientproxiedby": "DM5PR2001CA0012.namprd20.prod.outlook.com\n\t(2603:10b6:4:16::22) To DB3PR0502MB3980.eurprd05.prod.outlook.com\n\t(2603:10a6:8:10::27)",
        "authentication-results": "spf=none (sender IP is )\n\tsmtp.mailfrom=yskoh@mellanox.com; ",
        "x-ms-exchange-messagesentrepresentingtype": "1",
        "x-originating-ip": "[209.116.155.178]",
        "x-ms-publictraffictype": "Email",
        "x-microsoft-exchange-diagnostics": "1; DB3PR0502MB4027;\n\t6:FI0MlwKl+ULO1e3NHWnb7sYfpvwRhLjwWvmY6OUVFZiTDx2Uu02nsHN8PZ1RadMENoURYnuNBuLyh0CajAekkRABvTsH0QbdhFMqXjXg+sB1v7hvquNwgMdoZotzvv7Q7nwbR4Re9hwcGuOz3LymCAji6HyUGkzRbUdGmSXYHIaGIRjWPO/wZ23x/VgJkwxUnJ5cTXiTiCnJsMsg8DApcm+1SJHmzi8nD7j35CkjLgecBpP7N0CdVPZRval2u7zrhNIDDNMW7FJ4XZO6HQiBdjmtOgkxT3l/cWo7Eslf+I3i3GrFLsAh0h1545fMRY8FPmJg3ojVdTd9PDZ2Fm6UoErIAcJ3Hjyq96Ugt9bdE6kiHGzVPuW/Lm69FAkYVaIP7EEvcy4+59HOrnLIQpwJY/ThVb3XkXlPY3bucV7lP92uz6GXNSdUcqKW05ON10HHOGtMXZiGGwZYsF7Flqqmmw==;\n\t5:XjN/UiEuEc21IwEe/Lf8HirStXNE/PJTEdT+o/Fmai9pfN675OuRguBqa7e3BCMAGVt/7BFyyFGOT8H6IzWUXG49YXcbaCgLk73WeuurmhRoqUWlvOGFbQ/GU0nx0lcigf8CdAoT2yrJNSXFsjI2NqMindSN1OmRIa+Pcts5JC0=;\n\t7:e/uGufNZvVAK949LMptiaeqDVSzWvElfIM3VjXl4NPrXVYD0/BVKtbo+uB+HLBacqvQSkuxRu73ukcYs49AZOM2nNfOoWwsTi8xMsWhJAmsH4otWyEnxKAy1UQfD3PYnqBKZ+807EHXcLBfeJgK0gQKXRvteRLanHuH3cT1BfEZniKNV/5rQvXPRoZXOkA/baGck0xDSH2fD3Pp7pMEmOiYOShjNPvt4eAGjqReYMqeIPaeYbLEU5x7opIIZsSj/",
        "x-ms-office365-filtering-correlation-id": "d9b5ec7e-e282-4da3-8db2-08d6259554a6",
        "x-ms-office365-filtering-ht": "Tenant",
        "x-microsoft-antispam": "BCL:0; PCL:0;\n\tRULEID:(7020095)(4652040)(8989299)(4534165)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020);\n\tSRVR:DB3PR0502MB4027; ",
        "x-ms-traffictypediagnostic": "DB3PR0502MB4027:",
        "x-ld-processed": "a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr",
        "x-microsoft-antispam-prvs": "<DB3PR0502MB4027C6F002F44836ED63F023C3EC0@DB3PR0502MB4027.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)(5005006)(8121501046)(10201501046)(3231355)(944501410)(52105095)(93006095)(93001095)(3002001)(6055026)(149066)(150057)(6041310)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(20161123564045)(201708071742011)(7699051);\n\tSRVR:DB3PR0502MB4027; BCL:0; PCL:0; RULEID:; SRVR:DB3PR0502MB4027; ",
        "x-forefront-prvs": "0809C12563",
        "x-forefront-antispam-report": "SFV:NSPM;\n\tSFS:(10009020)(366004)(136003)(346002)(376002)(39860400002)(396003)(199004)(189003)(81156014)(6512007)(8676002)(2900100001)(5250100002)(14454004)(1076002)(106356001)(14444005)(256004)(4006002)(53936002)(6436002)(316002)(6116002)(8936002)(6486002)(105586002)(25786009)(3846002)(54906003)(81166006)(68736007)(110136005)(66066001)(52116002)(6636002)(5660300001)(86362001)(71190400001)(2616005)(486006)(107886003)(476003)(36756003)(102836004)(6506007)(7736002)(99286004)(2906002)(478600001)(26005)(4326008)(386003)(1857600001)(97736004)(186003)(34290500001)(71200400001)(305945005);\n\tDIR:OUT; SFP:1101; SCL:1; SRVR:DB3PR0502MB4027;\n\tH:DB3PR0502MB3980.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": "Dd8BXsybt2sBgtujOIDtCvk7yOiZR4Hz2E2/4mAvwcXhXNnLJ2E5/4Pso4bHXDOqzsPJcMcWUr0ob1CnoolFEGvNrnyuJfAmRf3U8QoGtVK6PM9eJY4p5NFQG4XhtQ036K7vN7nrwuAn9brQtpemcPPJ64TstU5T4ULtlKusvSZY0phqMPG4z3/ZunPBmXdg5pA9SnkH/s+k8DiFkaZ9CtHqk2RO7Q6/YoXAWccBORqrPfQImVmWrr7942sMyyo6fiT8tjeTwOLrioWEw6O2LlZoSo4iJSGDORIrYPzI8zSb/TKgLSgt6d1RijWJzLNp7Sd1VSevhxsLH6n8DJM+KgD2xbB7oZ8oezHNWrQM8Pw=",
        "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": "d9b5ec7e-e282-4da3-8db2-08d6259554a6",
        "X-MS-Exchange-CrossTenant-originalarrivaltime": "28 Sep 2018 22:54:22.7403\n\t(UTC)",
        "X-MS-Exchange-CrossTenant-fromentityheader": "Hosted",
        "X-MS-Exchange-CrossTenant-id": "a652971c-7d2e-4d9b-a6a4-d149256f461b",
        "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "DB3PR0502MB4027",
        "Subject": "[dpdk-dev] [PATCH] test original",
        "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": "rte_flow has 'group' attribute and 'jump' action in order to support\nmultiple groups. This feature is known as multi-table support ('chain' in\nlinux TC flower) in general because a group means a table of flows. Example\ncommands are:\n\n\tflow create 0 transfer priority 1 ingress\n\t     pattern eth / vlan vid is 100 / end\n\t     actions jump group 1 / end\n\n\tflow create 0 transfer priority 1 ingress\n\t     pattern eth / vlan vid is 200 / end\n\t     actions jump group 2 / end\n\n\tflow create 0 transfer group 1 priority 2 ingress\n\t     pattern eth / vlan vid is 100 /\n\t     \t     ipv4 dst spec 192.168.40.0 dst prefix 24 / end\n\t     actions drop / end\n\n\tflow create 0 transfer group 1 priority 2 ingress\n\t     pattern end\n\t     actions of_pop_vlan / port_id id 1 / end\n\n\tflow create 0 transfer group 2 priority 2 ingress\n\t     pattern eth / vlan vid is 200 /\n\t     \t     ipv4 dst spec 192.168.40.0 dst prefix 24 / end\n\t     actions of_pop_vlan / port_id id 2 / end\n\n\tflow create 0 transfer group 2 priority 2 ingress\n\t     pattern end\n\t     actions port_id id 2 / end\n\nWith theses flows, if a packet having vlan 200 and src_ip as 192.168.40.1,\nthis packet will firstly hit the 1st flow. Then it will hit the 5th flow\nbecause of the 'jump' action. As a result, the packet will be forwarded to\nport 2 (VF representor) with vlan tag being stripped off. If the packet had\nvlan 100 instead, it would be dropped by the 3rd flow.\n\nSigned-off-by: Yongseok Koh <yskoh@mellanox.com>\n---\n drivers/net/mlx5/Makefile        | 10 ++++++\n drivers/net/mlx5/meson.build     |  4 +++\n drivers/net/mlx5/mlx5_flow.h     |  5 +++\n drivers/net/mlx5/mlx5_flow_tcf.c | 78 +++++++++++++++++++++++++++++++++++-----\n 4 files changed, 88 insertions(+), 9 deletions(-)",
    "diff": "diff --git a/drivers/net/mlx5/Makefile b/drivers/net/mlx5/Makefile\nindex ca1de9f21..92bae9dfc 100644\n--- a/drivers/net/mlx5/Makefile\n+++ b/drivers/net/mlx5/Makefile\n@@ -347,6 +347,16 @@ mlx5_autoconf.h.new: $(RTE_SDK)/buildtools/auto-config-h.sh\n \t\tenum TCA_VLAN_PUSH_VLAN_PRIORITY \\\n \t\t$(AUTOCONF_OUTPUT)\n \t$Q sh -- '$<' '$@' \\\n+\t\tHAVE_TCA_CHAIN \\\n+\t\tlinux/rtnetlink.h \\\n+\t\tenum TCA_CHAIN \\\n+\t\t$(AUTOCONF_OUTPUT)\n+\t$Q sh -- '$<' '$@' \\\n+\t\tHAVE_TC_ACT_GOTO_CHAIN \\\n+\t\tlinux/pkt_cls.h \\\n+\t\tdefine TC_ACT_GOTO_CHAIN \\\n+\t\t$(AUTOCONF_OUTPUT)\n+\t$Q sh -- '$<' '$@' \\\n \t\tHAVE_SUPPORTED_40000baseKR4_Full \\\n \t\t/usr/include/linux/ethtool.h \\\n \t\tdefine SUPPORTED_40000baseKR4_Full \\\ndiff --git a/drivers/net/mlx5/meson.build b/drivers/net/mlx5/meson.build\nindex fd93ac162..696624838 100644\n--- a/drivers/net/mlx5/meson.build\n+++ b/drivers/net/mlx5/meson.build\n@@ -182,6 +182,10 @@ 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_TCA_CHAIN', 'linux/rtnetlink.h',\n+\t\t'TCA_CHAIN' ],\n+\t\t[ 'HAVE_TC_ACT_GOTO_CHAIN', 'linux/pkt_cls.h',\n+\t\t'TC_ACT_GOTO_CHAIN' ],\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 7117f1471..d4253110c 100644\n--- a/drivers/net/mlx5/mlx5_flow.h\n+++ b/drivers/net/mlx5/mlx5_flow.h\n@@ -78,6 +78,7 @@\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_JUMP (1u << 11)\n \n #define MLX5_FLOW_FATE_ACTIONS \\\n \t(MLX5_FLOW_ACTION_DROP | MLX5_FLOW_ACTION_QUEUE | MLX5_FLOW_ACTION_RSS)\n@@ -125,6 +126,10 @@\n /* Max number of actions per DV flow. */\n #define MLX5_DV_MAX_NUMBER_OF_ACTIONS 8\n \n+/* Due to a limitation on driver/FW. */\n+#define MLX5_FLOW_GROUP_ID_MAX 3\n+#define MLX5_FLOW_GROUP_PRIORITY_MAX 14\n+\n enum mlx5_flow_drv_type {\n \tMLX5_FLOW_TYPE_MIN,\n \tMLX5_FLOW_TYPE_DV,\ndiff --git a/drivers/net/mlx5/mlx5_flow_tcf.c b/drivers/net/mlx5/mlx5_flow_tcf.c\nindex 9ad66ac76..5d4a2e857 100644\n--- a/drivers/net/mlx5/mlx5_flow_tcf.c\n+++ b/drivers/net/mlx5/mlx5_flow_tcf.c\n@@ -148,6 +148,12 @@ struct tc_vlan {\n #ifndef HAVE_TCA_FLOWER_KEY_VLAN_ETH_TYPE\n #define TCA_FLOWER_KEY_VLAN_ETH_TYPE 25\n #endif\n+#ifndef HAVE_TCA_CHAIN\n+#define TCA_CHAIN 11\n+#endif\n+#ifndef HAVE_TC_ACT_GOTO_CHAIN\n+#define TC_ACT_GOTO_CHAIN 0x20000000\n+#endif\n \n #ifndef IPV6_ADDR_LEN\n #define IPV6_ADDR_LEN 16\n@@ -225,7 +231,9 @@ struct flow_tcf_ptoi {\n \tunsigned int ifindex; /**< Network interface index. */\n };\n \n-#define MLX5_TCF_FATE_ACTIONS (MLX5_FLOW_ACTION_DROP | MLX5_FLOW_ACTION_PORT_ID)\n+#define MLX5_TCF_FATE_ACTIONS \\\n+\t(MLX5_FLOW_ACTION_DROP | MLX5_FLOW_ACTION_PORT_ID | \\\n+\t MLX5_FLOW_ACTION_JUMP)\n #define MLX5_TCF_VLAN_ACTIONS \\\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@@ -370,14 +378,25 @@ flow_tcf_validate_attributes(const struct rte_flow_attr *attr,\n \t\t\t     struct rte_flow_error *error)\n {\n \t/*\n-\t * Supported attributes: no groups, some priorities and ingress only.\n-\t * Don't care about transfer as it is the caller's problem.\n+\t * Supported attributes: groups, some priorities and ingress only.\n+\t * group is supported only if kernel supports chain. Don't care about\n+\t * transfer as it is the caller's problem.\n \t */\n-\tif (attr->group)\n+\tif (attr->group > MLX5_FLOW_GROUP_ID_MAX)\n \t\treturn rte_flow_error_set(error, ENOTSUP,\n \t\t\t\t\t  RTE_FLOW_ERROR_TYPE_ATTR_GROUP, attr,\n-\t\t\t\t\t  \"groups are not supported\");\n-\tif (attr->priority > 0xfffe)\n+\t\t\t\t\t  \"group ID larger than \"\n+\t\t\t\t\t  RTE_STR(MLX5_FLOW_GROUP_ID_MAX)\n+\t\t\t\t\t  \" isn't supported\");\n+\telse if (attr->group > 0 &&\n+\t\t attr->priority > MLX5_FLOW_GROUP_PRIORITY_MAX)\n+\t\treturn rte_flow_error_set(error, ENOTSUP,\n+\t\t\t\t\t  RTE_FLOW_ERROR_TYPE_ATTR_PRIORITY,\n+\t\t\t\t\t  attr,\n+\t\t\t\t\t  \"lowest priority level is \"\n+\t\t\t\t\t  RTE_STR(MLX5_FLOW_GROUP_PRIORITY_MAX)\n+\t\t\t\t\t  \" when group is configured\");\n+\telse if (attr->priority > 0xfffe)\n \t\treturn rte_flow_error_set(error, ENOTSUP,\n \t\t\t\t\t  RTE_FLOW_ERROR_TYPE_ATTR_PRIORITY,\n \t\t\t\t\t  attr,\n@@ -428,6 +447,7 @@ flow_tcf_validate(struct rte_eth_dev *dev,\n \t} spec, mask;\n \tunion {\n \t\tconst struct rte_flow_action_port_id *port_id;\n+\t\tconst struct rte_flow_action_jump *jump;\n \t\tconst struct rte_flow_action_of_push_vlan *of_push_vlan;\n \t\tconst struct rte_flow_action_of_set_vlan_vid *\n \t\t\tof_set_vlan_vid;\n@@ -675,6 +695,16 @@ flow_tcf_validate(struct rte_eth_dev *dev,\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_JUMP:\n+\t\t\tconf.jump = actions->conf;\n+\t\t\tif (attr->group >= conf.jump->group)\n+\t\t\t\treturn rte_flow_error_set\n+\t\t\t\t\t(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 \"can't jump to a group backward\");\n+\t\t\taction_flags |= MLX5_FLOW_ACTION_JUMP;\n+\t\t\tbreak;\n \t\tcase RTE_FLOW_ACTION_TYPE_DROP:\n \t\t\tif (action_flags & MLX5_TCF_FATE_ACTIONS)\n \t\t\t\treturn rte_flow_error_set\n@@ -755,7 +785,8 @@ flow_tcf_validate(struct rte_eth_dev *dev,\n  *   Maximum size of memory for items.\n  */\n static int\n-flow_tcf_get_items_and_size(const struct rte_flow_item items[],\n+flow_tcf_get_items_and_size(const struct rte_flow_attr *attr,\n+\t\t\t    const struct rte_flow_item items[],\n \t\t\t    uint64_t *item_flags)\n {\n \tint size = 0;\n@@ -764,6 +795,8 @@ flow_tcf_get_items_and_size(const struct rte_flow_item items[],\n \tsize += SZ_NLATTR_STRZ_OF(\"flower\") +\n \t\tSZ_NLATTR_NEST + /* TCA_OPTIONS. */\n \t\tSZ_NLATTR_TYPE_OF(uint32_t); /* TCA_CLS_FLAGS_SKIP_SW. */\n+\tif (attr->group > 0)\n+\t\tsize += SZ_NLATTR_TYPE_OF(uint32_t); /* TCA_CHAIN. */\n \tfor (; items->type != RTE_FLOW_ITEM_TYPE_END; items++) {\n \t\tswitch (items->type) {\n \t\tcase RTE_FLOW_ITEM_TYPE_VOID:\n@@ -853,6 +886,13 @@ flow_tcf_get_actions_and_size(const struct rte_flow_action actions[],\n \t\t\t\tSZ_NLATTR_TYPE_OF(struct tc_mirred);\n \t\t\tflags |= MLX5_FLOW_ACTION_PORT_ID;\n \t\t\tbreak;\n+\t\tcase RTE_FLOW_ACTION_TYPE_JUMP:\n+\t\t\tsize += SZ_NLATTR_NEST + /* na_act_index. */\n+\t\t\t\tSZ_NLATTR_STRZ_OF(\"gact\") +\n+\t\t\t\tSZ_NLATTR_NEST + /* TCA_ACT_OPTIONS. */\n+\t\t\t\tSZ_NLATTR_TYPE_OF(struct tc_gact);\n+\t\t\tflags |= MLX5_FLOW_ACTION_JUMP;\n+\t\t\tbreak;\n \t\tcase RTE_FLOW_ACTION_TYPE_DROP:\n \t\t\tsize += SZ_NLATTR_NEST + /* na_act_index. */\n \t\t\t\tSZ_NLATTR_STRZ_OF(\"gact\") +\n@@ -938,7 +978,7 @@ flow_tcf_nl_brand(struct nlmsghdr *nlh, uint32_t handle)\n  *   otherwise NULL and rte_ernno is set.\n  */\n static struct mlx5_flow *\n-flow_tcf_prepare(const struct rte_flow_attr *attr __rte_unused,\n+flow_tcf_prepare(const struct rte_flow_attr *attr,\n \t\t const struct rte_flow_item items[],\n \t\t const struct rte_flow_action actions[],\n \t\t uint64_t *item_flags, uint64_t *action_flags,\n@@ -951,7 +991,7 @@ flow_tcf_prepare(const struct rte_flow_attr *attr __rte_unused,\n \tstruct nlmsghdr *nlh;\n \tstruct tcmsg *tcm;\n \n-\tsize += flow_tcf_get_items_and_size(items, item_flags);\n+\tsize += flow_tcf_get_items_and_size(attr, items, item_flags);\n \tsize += flow_tcf_get_actions_and_size(actions, action_flags);\n \tdev_flow = rte_zmalloc(__func__, size, MNL_ALIGNTO);\n \tif (!dev_flow) {\n@@ -1022,6 +1062,7 @@ flow_tcf_translate(struct rte_eth_dev *dev, struct mlx5_flow *dev_flow,\n \t} spec, mask;\n \tunion {\n \t\tconst struct rte_flow_action_port_id *port_id;\n+\t\tconst struct rte_flow_action_jump *jump;\n \t\tconst struct rte_flow_action_of_push_vlan *of_push_vlan;\n \t\tconst struct rte_flow_action_of_set_vlan_vid *\n \t\t\tof_set_vlan_vid;\n@@ -1056,6 +1097,8 @@ flow_tcf_translate(struct rte_eth_dev *dev, struct mlx5_flow *dev_flow,\n \t */\n \ttcm->tcm_info = TC_H_MAKE((attr->priority + 1) << 16,\n \t\t\t\t  RTE_BE16(ETH_P_ALL));\n+\tif (attr->group > 0)\n+\t\tmnl_attr_put_u32(nlh, TCA_CHAIN, attr->group);\n \tmnl_attr_put_strz(nlh, TCA_KIND, \"flower\");\n \tna_flower = mnl_attr_nest_start(nlh, TCA_OPTIONS);\n \tmnl_attr_put_u32(nlh, TCA_FLOWER_FLAGS, TCA_CLS_FLAGS_SKIP_SW);\n@@ -1330,6 +1373,23 @@ flow_tcf_translate(struct rte_eth_dev *dev, struct mlx5_flow *dev_flow,\n \t\t\tmnl_attr_nest_end(nlh, na_act);\n \t\t\tmnl_attr_nest_end(nlh, na_act_index);\n \t\t\tbreak;\n+\t\tcase RTE_FLOW_ACTION_TYPE_JUMP:\n+\t\t\tconf.jump = actions->conf;\n+\t\t\tna_act_index =\n+\t\t\t\tmnl_attr_nest_start(nlh, na_act_index_cur++);\n+\t\t\tassert(na_act_index);\n+\t\t\tmnl_attr_put_strz(nlh, TCA_ACT_KIND, \"gact\");\n+\t\t\tna_act = mnl_attr_nest_start(nlh, TCA_ACT_OPTIONS);\n+\t\t\tassert(na_act);\n+\t\t\tmnl_attr_put(nlh, TCA_GACT_PARMS,\n+\t\t\t\t     sizeof(struct tc_gact),\n+\t\t\t\t     &(struct tc_gact){\n+\t\t\t\t\t.action = TC_ACT_GOTO_CHAIN |\n+\t\t\t\t\t\t  conf.jump->group,\n+\t\t\t\t     });\n+\t\t\tmnl_attr_nest_end(nlh, na_act);\n+\t\t\tmnl_attr_nest_end(nlh, na_act_index);\n+\t\t\tbreak;\n \t\tcase RTE_FLOW_ACTION_TYPE_DROP:\n \t\t\tna_act_index =\n \t\t\t\tmnl_attr_nest_start(nlh, na_act_index_cur++);\n",
    "prefixes": []
}