Show a patch.

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

{
    "id": 45252,
    "url": "http://patches.dpdk.org/api/patches/45252/",
    "web_url": "http://patches.dpdk.org/patch/45252/",
    "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": "<20180924231721.15799-6-yskoh@mellanox.com>",
    "date": "2018-09-24T23:17:43",
    "name": "[v3,05/11] net/mlx5: add Direct Verbs validation function",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "37ee7c9611bdd27a0524f6bcb2677d3412aeb1ab",
    "submitter": {
        "id": 636,
        "url": "http://patches.dpdk.org/api/people/636/",
        "name": "Yongseok Koh",
        "email": "yskoh@mellanox.com"
    },
    "delegate": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/users/1/",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patches.dpdk.org/patch/45252/mbox/",
    "series": [
        {
            "id": 1476,
            "url": "http://patches.dpdk.org/api/series/1476/",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=1476",
            "date": "2018-09-24T23:17:33",
            "name": "net/mlx5: add Direct Verbs flow driver support",
            "version": 3,
            "mbox": "http://patches.dpdk.org/series/1476/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/45252/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/45252/checks/",
    "tags": {},
    "headers": {
        "x-forefront-antispam-report": "SFV:NSPM;\n\tSFS:(10009020)(1496009)(396003)(376002)(346002)(366004)(39860400002)(136003)(199004)(189003)(51234002)(66066001)(2616005)(476003)(446003)(486006)(11346002)(6436002)(305945005)(7736002)(575784001)(386003)(6506007)(6486002)(6512007)(186003)(102836004)(5250100002)(76176011)(25786009)(26005)(68736007)(6116002)(54906003)(110136005)(99286004)(1076002)(3846002)(71200400001)(52116002)(86362001)(53936002)(71190400001)(97736004)(8936002)(107886003)(45954006)(14444005)(256004)(4326008)(316002)(2900100001)(19627235002)(81156014)(8676002)(36756003)(81166006)(105586002)(2906002)(106356001)(6636002)(478600001)(5660300001)(14454004);\n\tDIR:OUT; SFP:1101; SCL:1; SRVR:DB3PR0502MB3996;\n\tH:DB3PR0502MB3980.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; \n\tPTR:InfoNoRecords; A:1; MX:1; ",
        "X-Mailman-Version": "2.1.15",
        "In-Reply-To": "<20180924231721.15799-1-yskoh@mellanox.com>",
        "Errors-To": "dev-bounces@dpdk.org",
        "X-MS-Exchange-CrossTenant-originalarrivaltime": "24 Sep 2018 23:17:43.9514\n\t(UTC)",
        "x-ms-office365-filtering-correlation-id": "7e3f04bd-a218-40b9-0100-08d62273ee4c",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 25D8B1B11E;\n\tTue, 25 Sep 2018 01:17:51 +0200 (CEST)",
            "from EUR02-HE1-obe.outbound.protection.outlook.com\n\t(mail-eopbgr10043.outbound.protection.outlook.com [40.107.1.43])\n\tby dpdk.org (Postfix) with ESMTP id 749941B117\n\tfor <dev@dpdk.org>; Tue, 25 Sep 2018 01:17:45 +0200 (CEST)",
            "from DB3PR0502MB3980.eurprd05.prod.outlook.com (52.134.72.27) by\n\tDB3PR0502MB3996.eurprd05.prod.outlook.com (52.134.65.142) with\n\tMicrosoft SMTP Server (version=TLS1_2,\n\tcipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id\n\t15.20.1164.25; Mon, 24 Sep 2018 23:17:44 +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.017;\n\tMon, 24 Sep 2018 23:17:44 +0000"
        ],
        "References": "<20180919072143.23211-1-yskoh@mellanox.com>\n\t<20180924231721.15799-1-yskoh@mellanox.com>",
        "spamdiagnosticmetadata": "NSPM",
        "x-ms-exchange-senderadcheck": "1",
        "MIME-Version": "1.0",
        "Accept-Language": "en-US",
        "Thread-Index": "AQHUVFzMtkiYsv4sJkqP0xVE4RK48w==",
        "x-microsoft-antispam": "BCL:0; PCL:0;\n\tRULEID:(7020095)(4652040)(8989299)(5600074)(711020)(4618075)(4534165)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020);\n\tSRVR:DB3PR0502MB3996; ",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "x-ms-traffictypediagnostic": "DB3PR0502MB3996:",
        "X-Original-To": "patchwork@dpdk.org",
        "Content-Type": "text/plain; charset=\"iso-8859-1\"",
        "x-ms-publictraffictype": "Email",
        "x-microsoft-antispam-prvs": "<DB3PR0502MB399654D7F1F31285833EB193C3170@DB3PR0502MB3996.eurprd05.prod.outlook.com>",
        "x-clientproxiedby": "BN6PR03CA0021.namprd03.prod.outlook.com\n\t(2603:10b6:404:23::31) To DB3PR0502MB3980.eurprd05.prod.outlook.com\n\t(2603:10a6:8:10::27)",
        "CC": "\"dev@dpdk.org\" <dev@dpdk.org>, Ori Kam <orika@mellanox.com>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "received-spf": "None (protection.outlook.com: mellanox.com does not designate\n\tpermitted sender hosts)",
        "List-Post": "<mailto:dev@dpdk.org>",
        "To": "Thomas Monjalon <thomas@monjalon.net>,\n\tShahaf Shuler <shahafs@mellanox.com>",
        "x-exchange-antispam-report-cfa-test": "BCL:0; PCL:0;\n\tRULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(10201501046)(3002001)(93006095)(93001095)(3231355)(944501410)(52105095)(6055026)(149066)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123560045)(20161123562045)(20161123564045)(201708071742011)(7699051);\n\tSRVR:DB3PR0502MB3996; BCL:0; PCL:0; RULEID:; SRVR:DB3PR0502MB3996; ",
        "Delivered-To": "patchwork@dpdk.org",
        "X-MS-Exchange-CrossTenant-id": "a652971c-7d2e-4d9b-a6a4-d149256f461b",
        "x-forefront-prvs": "0805EC9467",
        "Precedence": "list",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "Date": "Mon, 24 Sep 2018 23:17:43 +0000",
        "x-ld-processed": "a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr",
        "From": "Yongseok Koh <yskoh@mellanox.com>",
        "Thread-Topic": "[PATCH v3 05/11] net/mlx5: add Direct Verbs validation function",
        "X-MS-Exchange-CrossTenant-Network-Message-Id": "7e3f04bd-a218-40b9-0100-08d62273ee4c",
        "x-originating-ip": "[209.116.155.178]",
        "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=FX8Be3uQ+44DQ5LhLK8blJSPsL8lDwK3a2BFmotg5u4=;\n\tb=mB5jsbXysFTkR552CLZQuqNIKPKkdENFdFcFCXBpHRKz34Ez/H8kzqn0x7O/cM3StFqoIPc7IImaiBKwYDAUvOtizjYiaZzE7ulFV05CVp5Myq3ZU4GOZPu2rvUDZeVsphXpIOFqIpou+Uy+J6Q7sWm3XhE2qH+X/JfN6zdkukw=",
        "Message-ID": "<20180924231721.15799-6-yskoh@mellanox.com>",
        "spamdiagnosticoutput": "1:99",
        "x-ms-office365-filtering-ht": "Tenant",
        "Content-Language": "en-US",
        "Content-Transfer-Encoding": "quoted-printable",
        "X-MS-TNEF-Correlator": "",
        "x-exchange-antispam-report-test": "UriScan:;",
        "X-OriginatorOrg": "Mellanox.com",
        "Return-Path": "<dev-bounces@dpdk.org>",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>",
        "x-microsoft-exchange-diagnostics": "1; DB3PR0502MB3996;\n\t6:H0eKRUk55BkGLkJn5KpqonmS+E6Dsu9HetfNpr8/eoFQkabrH3l+11LESUO/jlKE+DBeuyjAYiQn44/FKha2VJGhC5Z1oTRrFYt8i+AE7+XJvjE54kn2Wq5veMyXBO9gqT25asMNBC+yS4M8E02KHo/oVp52ksEI8l7+o5bf1m3gaPLxaxFzCFpD1M1knr93LuPCqxeHISP/QvL7DDusCYqckApDhGoFqmFD2r9N+uGNmi8EoBLpYNaiUHgIwXFiuiKHQZaZLTGRo0qVT39BKBLKBGJwLU0TOelsCvxcdfPXv988ihYRWHcqwz8y7PYxYUsRBnTSQTPCgk0wK9yuaSqH8ic8DBv2Fc/NBAe8e+ouE/MUYi+Qrsii36AHN7xt8NKkrru+Sb6lu5/vx54ZUTRXzqbvD2ZEZEZw4sWv7zDHwD8yAO+g0pNDav19UU6HglljmgJanH/y119JzXiXcw==;\n\t5:ct+OBgNtENf34RGjX8/YtXp+T/JMfDmlDkLXKkwC/3DjlwwYglGO7503SCQiSe0WAmmJGMe8o3tVaCcisJl11ysNpBPHNdk9ou98DrFeEv/89T6iygqhpZa7K/lkermqLEVEs1PpCwhAFBopuM0reROBshiRw5MLfejBota8zsE=;\n\t7:7tf4mFoRQmNwQr/MjMJADNYZsHsFE/3KPvSJ6vd5qVxmGJ+3oxVV7pJtX9qYH5jDa5tXENP/m3fj7FHj5oyWK+1qGBVUkr+VEwv7t6Vs7QQ0+be+6O5NSsl6Gl++jGytiLLu8j2pdiX6x8tl6Qm1fxubnJOiJ3/zch0qyqr2VgmDDImb7owHUYCM2oPDaagoKjnthxaLTTpqbn/nFV1mk2zrcducs+Cu7dhZmDlLCJ7Fgs8WPUfs+3lZgDCZETKA",
        "X-MS-Exchange-CrossTenant-fromentityheader": "Hosted",
        "X-MS-Has-Attach": "",
        "authentication-results": "spf=none (sender IP is )\n\tsmtp.mailfrom=yskoh@mellanox.com; ",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "x-ms-exchange-messagesentrepresentingtype": "1",
        "X-BeenThere": "dev@dpdk.org",
        "x-microsoft-antispam-message-info": "EVz5t8WCRv15UdrL8x+dqC/bxoZHBvQIbu+wKk5TFZM4Nvo2+i1YZSO8Rz8FbTtsnXBdXYOIOUYJ6xmpIkvwspWWYzBnFpAZC9269Gr3AeeDPfbPGiS86KvPa/oMFdb3J9sAcFKdWke9vj5sRQtYgNSRPreQga6WVarGm78XfjTaXwBcvOujFa9ZCm7VVtvCRbei1xuTCFMkNy/4OagrnZC0qL0loItCng/S7T8NQ3E0a4vOCsLXD+RPAFzfnjWYKl5/35/ghQbvJ+snAQE45TsEsqjg2esEdYl0wTpn+abq76Y/ctJPHi7gK7B6U96oclcEEqxKgEac0UopzvG21mMkQTgFgr+2g9wTe4iPIeY=",
        "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "DB3PR0502MB3996",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Subject": "[dpdk-dev] [PATCH v3 05/11] net/mlx5: add Direct Verbs validation\n\tfunction"
    },
    "content": "From: Ori Kam <orika@mellanox.com>\n\nThis is commit introduce the Direct Verbs driver API.\nThe Direct Verbs is an API adds new features like encapsulation, match\non metatdata.\nIn this commit the validation function was added, most of the validation\nis done with functions that are also in use for the Verbs API.\n\nSigned-off-by: Ori Kam <orika@mellanox.com>\nAcked-by: Yongseok Koh <yskoh@mellanox.com>\n---\n drivers/net/mlx5/Makefile       |   6 +\n drivers/net/mlx5/meson.build    |   3 +\n drivers/net/mlx5/mlx5_flow.h    |   6 +\n drivers/net/mlx5/mlx5_flow_dv.c | 312 ++++++++++++++++++++++++++++++++++++++++\n 4 files changed, 327 insertions(+)\n create mode 100644 drivers/net/mlx5/mlx5_flow_dv.c",
    "diff": "diff --git a/drivers/net/mlx5/Makefile b/drivers/net/mlx5/Makefile\nindex 9bd6bfb82..d510a4275 100644\n--- a/drivers/net/mlx5/Makefile\n+++ b/drivers/net/mlx5/Makefile\n@@ -31,6 +31,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_MLX5_PMD) += mlx5_stats.c\n SRCS-$(CONFIG_RTE_LIBRTE_MLX5_PMD) += mlx5_rss.c\n SRCS-$(CONFIG_RTE_LIBRTE_MLX5_PMD) += mlx5_mr.c\n SRCS-$(CONFIG_RTE_LIBRTE_MLX5_PMD) += mlx5_flow.c\n+SRCS-$(CONFIG_RTE_LIBRTE_MLX5_PMD) += mlx5_flow_dv.c\n SRCS-$(CONFIG_RTE_LIBRTE_MLX5_PMD) += mlx5_flow_verbs.c\n SRCS-$(CONFIG_RTE_LIBRTE_MLX5_PMD) += mlx5_socket.c\n SRCS-$(CONFIG_RTE_LIBRTE_MLX5_PMD) += mlx5_nl.c\n@@ -136,6 +137,11 @@ mlx5_autoconf.h.new: $(RTE_SDK)/buildtools/auto-config-h.sh\n \t\tenum MLX5DV_CONTEXT_FLAGS_CQE_128B_COMP \\\n \t\t$(AUTOCONF_OUTPUT)\n \t$Q sh -- '$<' '$@' \\\n+\t\tHAVE_IBV_FLOW_DV_SUPPORT \\\n+\t\tinfiniband/mlx5dv.h \\\n+\t\tenum MLX5DV_FLOW_ACTION_TAG \\\n+\t\t$(AUTOCONF_OUTPUT)\n+\t$Q sh -- '$<' '$@' \\\n \t\tHAVE_ETHTOOL_LINK_MODE_25G \\\n \t\t/usr/include/linux/ethtool.h \\\n \t\tenum ETHTOOL_LINK_MODE_25000baseCR_Full_BIT \\\ndiff --git a/drivers/net/mlx5/meson.build b/drivers/net/mlx5/meson.build\nindex 40cc95038..8075496f7 100644\n--- a/drivers/net/mlx5/meson.build\n+++ b/drivers/net/mlx5/meson.build\n@@ -31,6 +31,7 @@ if build\n \t\t'mlx5.c',\n \t\t'mlx5_ethdev.c',\n \t\t'mlx5_flow.c',\n+\t\t'mlx5_flow_dv.c',\n \t\t'mlx5_flow_verbs.c',\n \t\t'mlx5_mac.c',\n \t\t'mlx5_mr.c',\n@@ -93,6 +94,8 @@ if build\n \t\t'MLX5DV_CONTEXT_FLAGS_MPW_ALLOWED' ],\n \t\t[ 'HAVE_IBV_MLX5_MOD_CQE_128B_COMP', 'infiniband/mlx5dv.h',\n \t\t'MLX5DV_CONTEXT_FLAGS_CQE_128B_COMP' ],\n+\t\t[ 'HAVE_IBV_FLOW_DV_SUPPORT', 'infiniband/mlx5dv.h',\n+\t\t'MLX5DV_FLOW_ACTION_TAG' ],\n \t\t[ 'HAVE_IBV_DEVICE_MPLS_SUPPORT', 'infiniband/verbs.h',\n \t\t'IBV_FLOW_SPEC_MPLS' ],\n \t\t[ 'HAVE_IBV_WQ_FLAG_RX_END_PADDING', 'infiniband/verbs.h',\ndiff --git a/drivers/net/mlx5/mlx5_flow.h b/drivers/net/mlx5/mlx5_flow.h\nindex 4df60db92..9b0cd28ae 100644\n--- a/drivers/net/mlx5/mlx5_flow.h\n+++ b/drivers/net/mlx5/mlx5_flow.h\n@@ -103,6 +103,9 @@\n #define MLX5_PRIORITY_MAP_L4 0\n #define MLX5_PRIORITY_MAP_MAX 3\n \n+/* Max number of actions per DV flow. */\n+#define MLX5_DV_MAX_NUMBER_OF_ACTIONS 8\n+\n /* Verbs specification header. */\n struct ibv_spec_header {\n \tenum ibv_flow_spec_type type;\n@@ -250,6 +253,9 @@ int mlx5_flow_validate_item_vxlan_gpe(const struct rte_flow_item *item,\n \t\t\t\t      struct rte_flow_error *error);\n void mlx5_flow_init_driver_ops(struct rte_eth_dev *dev);\n \n+/* mlx5_flow_dv.c */\n+void mlx5_flow_dv_get_driver_ops(struct mlx5_flow_driver_ops *flow_ops);\n+\n /* mlx5_flow_verbs.c */\n \n void mlx5_flow_verbs_get_driver_ops(struct mlx5_flow_driver_ops *flow_ops);\ndiff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c\nnew file mode 100644\nindex 000000000..86a8b3cd0\n--- /dev/null\n+++ b/drivers/net/mlx5/mlx5_flow_dv.c\n@@ -0,0 +1,312 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright 2018 Mellanox Technologies, Ltd\n+ */\n+\n+#include <sys/queue.h>\n+#include <stdalign.h>\n+#include <stdint.h>\n+#include <string.h>\n+\n+/* Verbs header. */\n+/* ISO C doesn't support unnamed structs/unions, disabling -pedantic. */\n+#ifdef PEDANTIC\n+#pragma GCC diagnostic ignored \"-Wpedantic\"\n+#endif\n+#include <infiniband/verbs.h>\n+#ifdef PEDANTIC\n+#pragma GCC diagnostic error \"-Wpedantic\"\n+#endif\n+\n+#include <rte_common.h>\n+#include <rte_ether.h>\n+#include <rte_eth_ctrl.h>\n+#include <rte_ethdev_driver.h>\n+#include <rte_flow.h>\n+#include <rte_flow_driver.h>\n+#include <rte_malloc.h>\n+#include <rte_ip.h>\n+\n+#include \"mlx5.h\"\n+#include \"mlx5_defs.h\"\n+#include \"mlx5_prm.h\"\n+#include \"mlx5_glue.h\"\n+#include \"mlx5_flow.h\"\n+\n+#ifdef HAVE_IBV_FLOW_DV_SUPPORT\n+\n+/**\n+ * Verify the @p attributes will be correctly understood by the NIC and store\n+ * them in the @p flow if everything is correct.\n+ *\n+ * @param[in] dev\n+ *   Pointer to dev struct.\n+ * @param[in] attributes\n+ *   Pointer to flow attributes\n+ * @param[out] error\n+ *   Pointer to error structure.\n+ *\n+ * @return\n+ *   0 on success, a negative errno value otherwise and rte_errno is set.\n+ */\n+static int\n+flow_dv_validate_attributes(struct rte_eth_dev *dev,\n+\t\t\t    const struct rte_flow_attr *attributes,\n+\t\t\t    struct rte_flow_error *error)\n+{\n+\tstruct priv *priv = dev->data->dev_private;\n+\tuint32_t priority_max = priv->config.flow_prio - 1;\n+\n+\tif (attributes->group)\n+\t\treturn rte_flow_error_set(error, ENOTSUP,\n+\t\t\t\t\t  RTE_FLOW_ERROR_TYPE_ATTR_GROUP,\n+\t\t\t\t\t  NULL,\n+\t\t\t\t\t  \"groups is not supported\");\n+\tif (attributes->priority != MLX5_FLOW_PRIO_RSVD &&\n+\t    attributes->priority >= 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  NULL,\n+\t\t\t\t\t  \"priority out of range\");\n+\tif (attributes->egress)\n+\t\treturn rte_flow_error_set(error, ENOTSUP,\n+\t\t\t\t\t  RTE_FLOW_ERROR_TYPE_ATTR_EGRESS,\n+\t\t\t\t\t  NULL,\n+\t\t\t\t\t  \"egress is not supported\");\n+\tif (attributes->transfer)\n+\t\treturn rte_flow_error_set(error, ENOTSUP,\n+\t\t\t\t\t  RTE_FLOW_ERROR_TYPE_ATTR_TRANSFER,\n+\t\t\t\t\t  NULL,\n+\t\t\t\t\t  \"transfer is not supported\");\n+\tif (!attributes->ingress)\n+\t\treturn rte_flow_error_set(error, ENOTSUP,\n+\t\t\t\t\t  RTE_FLOW_ERROR_TYPE_ATTR_INGRESS,\n+\t\t\t\t\t  NULL,\n+\t\t\t\t\t  \"ingress attribute is mandatory\");\n+\treturn 0;\n+}\n+\n+/**\n+ * Internal validation function. For validating both actions and items.\n+ *\n+ * @param[in] dev\n+ *   Pointer to the rte_eth_dev structure.\n+ * @param[in] attr\n+ *   Pointer to the flow attributes.\n+ * @param[in] items\n+ *   Pointer to the list of items.\n+ * @param[in] actions\n+ *   Pointer to the list of actions.\n+ * @param[out] error\n+ *   Pointer to the error structure.\n+ *\n+ * @return\n+ *   0 on success, a negative errno value otherwise and rte_ernno is set.\n+ */\n+static int\n+flow_dv_validate(struct rte_eth_dev *dev, 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 struct rte_flow_error *error)\n+{\n+\tint ret;\n+\tuint32_t action_flags = 0;\n+\tuint32_t item_flags = 0;\n+\tint tunnel = 0;\n+\tuint8_t next_protocol = 0xff;\n+\tint actions_n = 0;\n+\n+\tif (items == NULL)\n+\t\treturn -1;\n+\tret = flow_dv_validate_attributes(dev, attr, error);\n+\tif (ret < 0)\n+\t\treturn ret;\n+\tfor (; items->type != RTE_FLOW_ITEM_TYPE_END; items++) {\n+\t\tswitch (items->type) {\n+\t\tcase RTE_FLOW_ITEM_TYPE_VOID:\n+\t\t\tbreak;\n+\t\tcase RTE_FLOW_ITEM_TYPE_ETH:\n+\t\t\tret = mlx5_flow_validate_item_eth(items, item_flags,\n+\t\t\t\t\t\t\t  error);\n+\t\t\tif (ret < 0)\n+\t\t\t\treturn ret;\n+\t\t\titem_flags |= tunnel ? MLX5_FLOW_LAYER_INNER_L2 :\n+\t\t\t\t\t       MLX5_FLOW_LAYER_OUTER_L2;\n+\t\t\tbreak;\n+\t\tcase RTE_FLOW_ITEM_TYPE_VLAN:\n+\t\t\tret = mlx5_flow_validate_item_vlan(items, item_flags,\n+\t\t\t\t\t\t\t   error);\n+\t\t\tif (ret < 0)\n+\t\t\t\treturn ret;\n+\t\t\titem_flags |= tunnel ? MLX5_FLOW_LAYER_INNER_VLAN :\n+\t\t\t\t\t       MLX5_FLOW_LAYER_OUTER_VLAN;\n+\t\t\tbreak;\n+\t\tcase RTE_FLOW_ITEM_TYPE_IPV4:\n+\t\t\tret = mlx5_flow_validate_item_ipv4(items, item_flags,\n+\t\t\t\t\t\t\t   error);\n+\t\t\tif (ret < 0)\n+\t\t\t\treturn ret;\n+\t\t\titem_flags |= tunnel ? MLX5_FLOW_LAYER_INNER_L3_IPV4 :\n+\t\t\t\t\t       MLX5_FLOW_LAYER_OUTER_L3_IPV4;\n+\t\t\tif (items->mask != NULL &&\n+\t\t\t    ((const struct rte_flow_item_ipv4 *)\n+\t\t\t     items->mask)->hdr.next_proto_id)\n+\t\t\t\tnext_protocol =\n+\t\t\t\t\t((const struct rte_flow_item_ipv4 *)\n+\t\t\t\t\t (items->spec))->hdr.next_proto_id;\n+\t\t\tbreak;\n+\t\tcase RTE_FLOW_ITEM_TYPE_IPV6:\n+\t\t\tret = mlx5_flow_validate_item_ipv6(items, item_flags,\n+\t\t\t\t\t\t\t   error);\n+\t\t\tif (ret < 0)\n+\t\t\t\treturn ret;\n+\t\t\titem_flags |= tunnel ? MLX5_FLOW_LAYER_INNER_L3_IPV6 :\n+\t\t\t\t\t       MLX5_FLOW_LAYER_OUTER_L3_IPV6;\n+\t\t\tif (items->mask != NULL &&\n+\t\t\t    ((const struct rte_flow_item_ipv6 *)\n+\t\t\t     items->mask)->hdr.proto)\n+\t\t\t\tnext_protocol =\n+\t\t\t\t\t((const struct rte_flow_item_ipv6 *)\n+\t\t\t\t\t items->spec)->hdr.proto;\n+\t\t\tbreak;\n+\t\tcase RTE_FLOW_ITEM_TYPE_UDP:\n+\t\t\tret = mlx5_flow_validate_item_udp(items, item_flags,\n+\t\t\t\t\t\t\t  next_protocol,\n+\t\t\t\t\t\t\t  error);\n+\t\t\tif (ret < 0)\n+\t\t\t\treturn ret;\n+\t\t\titem_flags |= tunnel ? MLX5_FLOW_LAYER_INNER_L4_UDP :\n+\t\t\t\t\t       MLX5_FLOW_LAYER_OUTER_L4_UDP;\n+\t\t\tbreak;\n+\t\tcase RTE_FLOW_ITEM_TYPE_TCP:\n+\t\t\tret = mlx5_flow_validate_item_tcp(items, item_flags,\n+\t\t\t\t\t\t\t  next_protocol, error);\n+\t\t\tif (ret < 0)\n+\t\t\t\treturn ret;\n+\t\t\titem_flags |= tunnel ? MLX5_FLOW_LAYER_INNER_L4_TCP :\n+\t\t\t\t\t       MLX5_FLOW_LAYER_OUTER_L4_TCP;\n+\t\t\tbreak;\n+\t\tcase RTE_FLOW_ITEM_TYPE_VXLAN:\n+\t\t\tret = mlx5_flow_validate_item_vxlan(items, item_flags,\n+\t\t\t\t\t\t\t    error);\n+\t\t\tif (ret < 0)\n+\t\t\t\treturn ret;\n+\t\t\titem_flags |= MLX5_FLOW_LAYER_VXLAN;\n+\t\t\tbreak;\n+\t\tcase RTE_FLOW_ITEM_TYPE_VXLAN_GPE:\n+\t\t\tret = mlx5_flow_validate_item_vxlan_gpe(items,\n+\t\t\t\t\t\t\t\titem_flags, dev,\n+\t\t\t\t\t\t\t\terror);\n+\t\t\tif (ret < 0)\n+\t\t\t\treturn ret;\n+\t\t\titem_flags |= MLX5_FLOW_LAYER_VXLAN_GPE;\n+\t\t\tbreak;\n+\t\tcase RTE_FLOW_ITEM_TYPE_GRE:\n+\t\t\tret = mlx5_flow_validate_item_gre(items, item_flags,\n+\t\t\t\t\t\t\t  next_protocol, error);\n+\t\t\tif (ret < 0)\n+\t\t\t\treturn ret;\n+\t\t\titem_flags |= MLX5_FLOW_LAYER_GRE;\n+\t\t\tbreak;\n+\t\tcase RTE_FLOW_ITEM_TYPE_MPLS:\n+\t\t\tret = mlx5_flow_validate_item_mpls(items, item_flags,\n+\t\t\t\t\t\t\t   next_protocol,\n+\t\t\t\t\t\t\t   error);\n+\t\t\tif (ret < 0)\n+\t\t\t\treturn ret;\n+\t\t\titem_flags |= MLX5_FLOW_LAYER_MPLS;\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_ITEM,\n+\t\t\t\t\t\t  NULL, \"item not supported\");\n+\t\t}\n+\t}\n+\tfor (; actions->type != RTE_FLOW_ACTION_TYPE_END; actions++) {\n+\t\tif (actions_n == MLX5_DV_MAX_NUMBER_OF_ACTIONS)\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, \"too many actions\");\n+\t\ttunnel = !!(item_flags & MLX5_FLOW_LAYER_TUNNEL);\n+\t\tswitch (actions->type) {\n+\t\tcase RTE_FLOW_ACTION_TYPE_VOID:\n+\t\t\tbreak;\n+\t\tcase RTE_FLOW_ACTION_TYPE_FLAG:\n+\t\t\tret = mlx5_flow_validate_action_flag(action_flags,\n+\t\t\t\t\t\t\t     error);\n+\t\t\tif (ret < 0)\n+\t\t\t\treturn ret;\n+\t\t\taction_flags |= MLX5_ACTION_FLAG;\n+\t\t\t++actions_n;\n+\t\t\tbreak;\n+\t\tcase RTE_FLOW_ACTION_TYPE_MARK:\n+\t\t\tret = mlx5_flow_validate_action_mark(actions,\n+\t\t\t\t\t\t\t     action_flags,\n+\t\t\t\t\t\t\t     error);\n+\t\t\tif (ret < 0)\n+\t\t\t\treturn ret;\n+\t\t\taction_flags |= MLX5_ACTION_MARK;\n+\t\t\t++actions_n;\n+\t\t\tbreak;\n+\t\tcase RTE_FLOW_ACTION_TYPE_DROP:\n+\t\t\tret = mlx5_flow_validate_action_drop(action_flags,\n+\t\t\t\t\t\t\t     error);\n+\t\t\tif (ret < 0)\n+\t\t\t\treturn ret;\n+\t\t\taction_flags |= MLX5_ACTION_DROP;\n+\t\t\t++actions_n;\n+\t\t\tbreak;\n+\t\tcase RTE_FLOW_ACTION_TYPE_QUEUE:\n+\t\t\tret = mlx5_flow_validate_action_queue(actions,\n+\t\t\t\t\t\t\t      action_flags, dev,\n+\t\t\t\t\t\t\t      error);\n+\t\t\tif (ret < 0)\n+\t\t\t\treturn ret;\n+\t\t\taction_flags |= MLX5_ACTION_QUEUE;\n+\t\t\t++actions_n;\n+\t\t\tbreak;\n+\t\tcase RTE_FLOW_ACTION_TYPE_RSS:\n+\t\t\tret = mlx5_flow_validate_action_rss(actions,\n+\t\t\t\t\t\t\t    action_flags, dev,\n+\t\t\t\t\t\t\t    error);\n+\t\t\tif (ret < 0)\n+\t\t\t\treturn ret;\n+\t\t\taction_flags |= MLX5_ACTION_RSS;\n+\t\t\t++actions_n;\n+\t\t\tbreak;\n+\t\tcase RTE_FLOW_ACTION_TYPE_COUNT:\n+\t\t\tret = mlx5_flow_validate_action_count(dev, error);\n+\t\t\tif (ret < 0)\n+\t\t\t\treturn ret;\n+\t\t\taction_flags |= MLX5_ACTION_COUNT;\n+\t\t\t++actions_n;\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+\t\t\t\t\t\t  actions,\n+\t\t\t\t\t\t  \"action not supported\");\n+\t\t}\n+\t}\n+\treturn 0;\n+}\n+\n+/**\n+ * Fills the flow_ops with the function pointers.\n+ *\n+ * @param[out] flow_ops\n+ *   Pointer to driver_ops structure.\n+ */\n+void\n+mlx5_flow_dv_get_driver_ops(struct mlx5_flow_driver_ops *flow_ops)\n+{\n+\t*flow_ops = (struct mlx5_flow_driver_ops) {\n+\t\t.validate = flow_dv_validate,\n+\t\t.prepare = NULL,\n+\t\t.translate = NULL,\n+\t\t.apply = NULL,\n+\t\t.remove = NULL,\n+\t\t.destroy = NULL,\n+\t};\n+}\n+\n+#endif /* HAVE_IBV_FLOW_DV_SUPPORT */\n",
    "prefixes": [
        "v3",
        "05/11"
    ]
}