get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 17026,
    "url": "https://patches.dpdk.org/api/patches/17026/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1c8a8e4fec73ed33836f1da9525b1b8b53048518.1479309720.git.adrien.mazarguil@6wind.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": "<1c8a8e4fec73ed33836f1da9525b1b8b53048518.1479309720.git.adrien.mazarguil@6wind.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1c8a8e4fec73ed33836f1da9525b1b8b53048518.1479309720.git.adrien.mazarguil@6wind.com",
    "date": "2016-11-16T16:23:27",
    "name": "[dpdk-dev,01/22] ethdev: introduce generic flow API",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "e4044078adbfccbfbe826474508e966d914acd53",
    "submitter": {
        "id": 165,
        "url": "https://patches.dpdk.org/api/people/165/?format=api",
        "name": "Adrien Mazarguil",
        "email": "adrien.mazarguil@6wind.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1c8a8e4fec73ed33836f1da9525b1b8b53048518.1479309720.git.adrien.mazarguil@6wind.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/17026/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/17026/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 [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id E1EAC568A;\n\tWed, 16 Nov 2016 17:24:49 +0100 (CET)",
            "from mail-wm0-f42.google.com (mail-wm0-f42.google.com\n\t[74.125.82.42]) by dpdk.org (Postfix) with ESMTP id AE6805681\n\tfor <dev@dpdk.org>; Wed, 16 Nov 2016 17:24:03 +0100 (CET)",
            "by mail-wm0-f42.google.com with SMTP id a197so249896092wmd.0\n\tfor <dev@dpdk.org>; Wed, 16 Nov 2016 08:24:03 -0800 (PST)",
            "from 6wind.com (guy78-3-82-239-227-177.fbx.proxad.net.\n\t[82.239.227.177]) by smtp.gmail.com with ESMTPSA id\n\ti132sm10936380wmf.14.2016.11.16.08.23.58\n\t(version=TLS1_2 cipher=AES128-SHA bits=128/128);\n\tWed, 16 Nov 2016 08:24:00 -0800 (PST)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=6wind-com.20150623.gappssmtp.com; s=20150623;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references;\n\tbh=b6nxwhTrRDzGt8ztVjByD71aq1cdt5nLT3BdmYQXlG4=;\n\tb=Lyr2IikdmM4sPfiarKcT0kaw/cT0wgx/Rdonp/hglUlw4fWAhx1kLX9J8rGV/HIuQp\n\t9Yv/qnfq8uQbH3gDlavIe6RwiINAY5yYpS2Q0m4xSxLa7W3Kh5KR3zNjSklDZQmJ9632\n\t8p+OIGiiaLnSDaLgfunrBpU6av2bEi7vpfVjo29IR+ZiCh9cWVxt5MdNqhvVovvgsBjP\n\tDUCzxOT/g16KR4Bg9nCAQpxNQyz3xuafo04JpLohxVswApdvssfAbKWm7rRq4yGyd4wP\n\taCE5cBtwxLG6kG9hgJ4jmDUqQf10n2w1jF1ZHtHdH7q84/Cb+1s/ArG9cQRouk/M9L+x\n\tlKOw==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20130820;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references;\n\tbh=b6nxwhTrRDzGt8ztVjByD71aq1cdt5nLT3BdmYQXlG4=;\n\tb=PH/13jdTDN59O12ZZBb1Yle60OqbbAXBVe7ttK5aCHNj4+JNsmlS3fvZbKHJo5tIKt\n\tBGw0KlYiOgcmhNNpQggWf5gM7Vh8ekpf/8VWnS30kteoox5BEh5eG4o8lnfaHoaZn1Q/\n\t6IUR3NoCR35daeJpnT52DYxzm4WohaimMIMYi/d3GqSiMfdaiCX9/9i/1rVX8NHAO84A\n\t69b/m1GPjjtV0Ta+1TPWhWIC7Tr4/RfAwCcBJiRaQPBQ+tHzzdq5ysm7RxohwC/Nf++o\n\tXqnDXrsN+KeJ1Oa/fGMCyYSPyxcGQ22b2CKo2bRweGBRW7I8jXTDacNjnhMqSG518QXe\n\txugw==",
        "X-Gm-Message-State": "ABUngvdfyO2KqC1x7jQK5rhTK0n98wjlK0fO44mZ6SZT/u0thyyQOr9DqIZ3l+vgiPmNq1qc",
        "X-Received": "by 10.194.0.229 with SMTP id 5mr3035768wjh.55.1479313442037;\n\tWed, 16 Nov 2016 08:24:02 -0800 (PST)",
        "From": "Adrien Mazarguil <adrien.mazarguil@6wind.com>",
        "To": "dev@dpdk.org",
        "Cc": "Thomas Monjalon <thomas.monjalon@6wind.com>,\n\tPablo de Lara <pablo.de.lara.guarch@intel.com>,\n\tOlivier Matz <olivier.matz@6wind.com>",
        "Date": "Wed, 16 Nov 2016 17:23:27 +0100",
        "Message-Id": "<1c8a8e4fec73ed33836f1da9525b1b8b53048518.1479309720.git.adrien.mazarguil@6wind.com>",
        "X-Mailer": "git-send-email 2.1.4",
        "In-Reply-To": "<cover.1479309719.git.adrien.mazarguil@6wind.com>",
        "References": "<cover.1471632644.git.adrien.mazarguil@6wind.com>\n\t<cover.1479309719.git.adrien.mazarguil@6wind.com>",
        "Subject": "[dpdk-dev] [PATCH 01/22] ethdev: introduce generic flow API",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "patches and discussions about DPDK <dev.dpdk.org>",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "This new API supersedes all the legacy filter types described in\nrte_eth_ctrl.h. It is slightly higher level and as a result relies more on\nPMDs to process and validate flow rules.\n\nBenefits:\n\n- A unified API is easier to program for, applications do not have to be\n  written for a specific filter type which may or may not be supported by\n  the underlying device.\n\n- The behavior of a flow rule is the same regardless of the underlying\n  device, applications do not need to be aware of hardware quirks.\n\n- Extensible by design, API/ABI breakage should rarely occur if at all.\n\n- Documentation is self-standing, no need to look up elsewhere.\n\nExisting filter types will be deprecated and removed in the near future.\n\nSigned-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>\n---\n MAINTAINERS                            |   4 +\n lib/librte_ether/Makefile              |   3 +\n lib/librte_ether/rte_eth_ctrl.h        |   1 +\n lib/librte_ether/rte_ether_version.map |  10 +\n lib/librte_ether/rte_flow.c            | 159 +++++\n lib/librte_ether/rte_flow.h            | 947 ++++++++++++++++++++++++++++\n lib/librte_ether/rte_flow_driver.h     | 177 ++++++\n 7 files changed, 1301 insertions(+)",
    "diff": "diff --git a/MAINTAINERS b/MAINTAINERS\nindex d6bb8f8..3b46630 100644\n--- a/MAINTAINERS\n+++ b/MAINTAINERS\n@@ -243,6 +243,10 @@ M: Thomas Monjalon <thomas.monjalon@6wind.com>\n F: lib/librte_ether/\n F: scripts/test-null.sh\n \n+Generic flow API\n+M: Adrien Mazarguil <adrien.mazarguil@6wind.com>\n+F: lib/librte_ether/rte_flow*\n+\n Crypto API\n M: Declan Doherty <declan.doherty@intel.com>\n F: lib/librte_cryptodev/\ndiff --git a/lib/librte_ether/Makefile b/lib/librte_ether/Makefile\nindex efe1e5f..9335361 100644\n--- a/lib/librte_ether/Makefile\n+++ b/lib/librte_ether/Makefile\n@@ -44,6 +44,7 @@ EXPORT_MAP := rte_ether_version.map\n LIBABIVER := 5\n \n SRCS-y += rte_ethdev.c\n+SRCS-y += rte_flow.c\n \n #\n # Export include files\n@@ -51,6 +52,8 @@ SRCS-y += rte_ethdev.c\n SYMLINK-y-include += rte_ethdev.h\n SYMLINK-y-include += rte_eth_ctrl.h\n SYMLINK-y-include += rte_dev_info.h\n+SYMLINK-y-include += rte_flow.h\n+SYMLINK-y-include += rte_flow_driver.h\n \n # this lib depends upon:\n DEPDIRS-y += lib/librte_net lib/librte_eal lib/librte_mempool lib/librte_ring lib/librte_mbuf\ndiff --git a/lib/librte_ether/rte_eth_ctrl.h b/lib/librte_ether/rte_eth_ctrl.h\nindex fe80eb0..8386904 100644\n--- a/lib/librte_ether/rte_eth_ctrl.h\n+++ b/lib/librte_ether/rte_eth_ctrl.h\n@@ -99,6 +99,7 @@ enum rte_filter_type {\n \tRTE_ETH_FILTER_FDIR,\n \tRTE_ETH_FILTER_HASH,\n \tRTE_ETH_FILTER_L2_TUNNEL,\n+\tRTE_ETH_FILTER_GENERIC,\n \tRTE_ETH_FILTER_MAX\n };\n \ndiff --git a/lib/librte_ether/rte_ether_version.map b/lib/librte_ether/rte_ether_version.map\nindex 72be66d..b5d2547 100644\n--- a/lib/librte_ether/rte_ether_version.map\n+++ b/lib/librte_ether/rte_ether_version.map\n@@ -147,3 +147,13 @@ DPDK_16.11 {\n \trte_eth_dev_pci_remove;\n \n } DPDK_16.07;\n+\n+DPDK_17.02 {\n+\tglobal:\n+\n+\trte_flow_validate;\n+\trte_flow_create;\n+\trte_flow_destroy;\n+\trte_flow_query;\n+\n+} DPDK_16.11;\ndiff --git a/lib/librte_ether/rte_flow.c b/lib/librte_ether/rte_flow.c\nnew file mode 100644\nindex 0000000..064963d\n--- /dev/null\n+++ b/lib/librte_ether/rte_flow.c\n@@ -0,0 +1,159 @@\n+/*-\n+ *   BSD LICENSE\n+ *\n+ *   Copyright 2016 6WIND S.A.\n+ *   Copyright 2016 Mellanox.\n+ *\n+ *   Redistribution and use in source and binary forms, with or without\n+ *   modification, are permitted provided that the following conditions\n+ *   are met:\n+ *\n+ *     * Redistributions of source code must retain the above copyright\n+ *       notice, this list of conditions and the following disclaimer.\n+ *     * Redistributions in binary form must reproduce the above copyright\n+ *       notice, this list of conditions and the following disclaimer in\n+ *       the documentation and/or other materials provided with the\n+ *       distribution.\n+ *     * Neither the name of 6WIND S.A. nor the names of its\n+ *       contributors may be used to endorse or promote products derived\n+ *       from this software without specific prior written permission.\n+ *\n+ *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n+ *   \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n+ *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n+ *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n+ *   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n+ *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n+ *   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n+ *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n+ *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n+ *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n+ *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n+ */\n+\n+#include <stdint.h>\n+\n+#include <rte_errno.h>\n+#include <rte_branch_prediction.h>\n+#include \"rte_ethdev.h\"\n+#include \"rte_flow_driver.h\"\n+#include \"rte_flow.h\"\n+\n+/* Get generic flow operations structure from a port. */\n+const struct rte_flow_ops *\n+rte_flow_ops_get(uint8_t port_id, struct rte_flow_error *error)\n+{\n+\tstruct rte_eth_dev *dev = &rte_eth_devices[port_id];\n+\tconst struct rte_flow_ops *ops;\n+\tint code;\n+\n+\tif (unlikely(!rte_eth_dev_is_valid_port(port_id)))\n+\t\tcode = ENODEV;\n+\telse if (unlikely(!dev->dev_ops->filter_ctrl ||\n+\t\t\t  dev->dev_ops->filter_ctrl(dev,\n+\t\t\t\t\t\t    RTE_ETH_FILTER_GENERIC,\n+\t\t\t\t\t\t    RTE_ETH_FILTER_GET,\n+\t\t\t\t\t\t    &ops) ||\n+\t\t\t  !ops))\n+\t\tcode = ENOTSUP;\n+\telse\n+\t\treturn ops;\n+\trte_flow_error_set(error, code, RTE_FLOW_ERROR_TYPE_UNSPECIFIED,\n+\t\t\t   NULL, rte_strerror(code));\n+\treturn NULL;\n+}\n+\n+/* Check whether a flow rule can be created on a given port. */\n+int\n+rte_flow_validate(uint8_t port_id,\n+\t\t  const struct rte_flow_attr *attr,\n+\t\t  const struct rte_flow_item pattern[],\n+\t\t  const struct rte_flow_action actions[],\n+\t\t  struct rte_flow_error *error)\n+{\n+\tconst struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error);\n+\tstruct rte_eth_dev *dev = &rte_eth_devices[port_id];\n+\n+\tif (unlikely(!ops))\n+\t\treturn -rte_errno;\n+\tif (likely(!!ops->validate))\n+\t\treturn ops->validate(dev, attr, pattern, actions, error);\n+\trte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_UNSPECIFIED,\n+\t\t\t   NULL, rte_strerror(ENOTSUP));\n+\treturn -rte_errno;\n+}\n+\n+/* Create a flow rule on a given port. */\n+struct rte_flow *\n+rte_flow_create(uint8_t port_id,\n+\t\tconst struct rte_flow_attr *attr,\n+\t\tconst struct rte_flow_item pattern[],\n+\t\tconst struct rte_flow_action actions[],\n+\t\tstruct rte_flow_error *error)\n+{\n+\tstruct rte_eth_dev *dev = &rte_eth_devices[port_id];\n+\tconst struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error);\n+\n+\tif (unlikely(!ops))\n+\t\treturn NULL;\n+\tif (likely(!!ops->create))\n+\t\treturn ops->create(dev, attr, pattern, actions, error);\n+\trte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_UNSPECIFIED,\n+\t\t\t   NULL, rte_strerror(ENOTSUP));\n+\treturn NULL;\n+}\n+\n+/* Destroy a flow rule on a given port. */\n+int\n+rte_flow_destroy(uint8_t port_id,\n+\t\t struct rte_flow *flow,\n+\t\t struct rte_flow_error *error)\n+{\n+\tstruct rte_eth_dev *dev = &rte_eth_devices[port_id];\n+\tconst struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error);\n+\n+\tif (unlikely(!ops))\n+\t\treturn -rte_errno;\n+\tif (likely(!!ops->destroy))\n+\t\treturn ops->destroy(dev, flow, error);\n+\trte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_UNSPECIFIED,\n+\t\t\t   NULL, rte_strerror(ENOTSUP));\n+\treturn -rte_errno;\n+}\n+\n+/* Destroy all flow rules associated with a port. */\n+int\n+rte_flow_flush(uint8_t port_id,\n+\t       struct rte_flow_error *error)\n+{\n+\tstruct rte_eth_dev *dev = &rte_eth_devices[port_id];\n+\tconst struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error);\n+\n+\tif (unlikely(!ops))\n+\t\treturn -rte_errno;\n+\tif (likely(!!ops->flush))\n+\t\treturn ops->flush(dev, error);\n+\trte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_UNSPECIFIED,\n+\t\t\t   NULL, rte_strerror(ENOTSUP));\n+\treturn -rte_errno;\n+}\n+\n+/* Query an existing flow rule. */\n+int\n+rte_flow_query(uint8_t port_id,\n+\t       struct rte_flow *flow,\n+\t       enum rte_flow_action_type action,\n+\t       void *data,\n+\t       struct rte_flow_error *error)\n+{\n+\tstruct rte_eth_dev *dev = &rte_eth_devices[port_id];\n+\tconst struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error);\n+\n+\tif (!ops)\n+\t\treturn -rte_errno;\n+\tif (likely(!!ops->query))\n+\t\treturn ops->query(dev, flow, action, data, error);\n+\trte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_UNSPECIFIED,\n+\t\t\t   NULL, rte_strerror(ENOTSUP));\n+\treturn -rte_errno;\n+}\ndiff --git a/lib/librte_ether/rte_flow.h b/lib/librte_ether/rte_flow.h\nnew file mode 100644\nindex 0000000..211f307\n--- /dev/null\n+++ b/lib/librte_ether/rte_flow.h\n@@ -0,0 +1,947 @@\n+/*-\n+ *   BSD LICENSE\n+ *\n+ *   Copyright 2016 6WIND S.A.\n+ *   Copyright 2016 Mellanox.\n+ *\n+ *   Redistribution and use in source and binary forms, with or without\n+ *   modification, are permitted provided that the following conditions\n+ *   are met:\n+ *\n+ *     * Redistributions of source code must retain the above copyright\n+ *       notice, this list of conditions and the following disclaimer.\n+ *     * Redistributions in binary form must reproduce the above copyright\n+ *       notice, this list of conditions and the following disclaimer in\n+ *       the documentation and/or other materials provided with the\n+ *       distribution.\n+ *     * Neither the name of 6WIND S.A. nor the names of its\n+ *       contributors may be used to endorse or promote products derived\n+ *       from this software without specific prior written permission.\n+ *\n+ *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n+ *   \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n+ *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n+ *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n+ *   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n+ *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n+ *   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n+ *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n+ *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n+ *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n+ *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n+ */\n+\n+#ifndef RTE_FLOW_H_\n+#define RTE_FLOW_H_\n+\n+/**\n+ * @file\n+ * RTE generic flow API\n+ *\n+ * This interface provides the ability to program packet matching and\n+ * associated actions in hardware through flow rules.\n+ */\n+\n+#include <rte_arp.h>\n+#include <rte_ether.h>\n+#include <rte_icmp.h>\n+#include <rte_ip.h>\n+#include <rte_sctp.h>\n+#include <rte_tcp.h>\n+#include <rte_udp.h>\n+\n+#ifdef __cplusplus\n+extern \"C\" {\n+#endif\n+\n+/**\n+ * Flow rule attributes.\n+ *\n+ * Priorities are set on two levels: per group and per rule within groups.\n+ *\n+ * Lower values denote higher priority, the highest priority for both levels\n+ * is 0, so that a rule with priority 0 in group 8 is always matched after a\n+ * rule with priority 8 in group 0.\n+ *\n+ * Although optional, applications are encouraged to group similar rules as\n+ * much as possible to fully take advantage of hardware capabilities\n+ * (e.g. optimized matching) and work around limitations (e.g. a single\n+ * pattern type possibly allowed in a given group).\n+ *\n+ * Group and priority levels are arbitrary and up to the application, they\n+ * do not need to be contiguous nor start from 0, however the maximum number\n+ * varies between devices and may be affected by existing flow rules.\n+ *\n+ * If a packet is matched by several rules of a given group for a given\n+ * priority level, the outcome is undefined. It can take any path, may be\n+ * duplicated or even cause unrecoverable errors.\n+ *\n+ * Note that support for more than a single group and priority level is not\n+ * guaranteed.\n+ *\n+ * Flow rules can apply to inbound and/or outbound traffic (ingress/egress).\n+ *\n+ * Several pattern items and actions are valid and can be used in both\n+ * directions. Those valid for only one direction are described as such.\n+ *\n+ * Specifying both directions at once is not recommended but may be valid in\n+ * some cases, such as incrementing the same counter twice.\n+ *\n+ * Not specifying any direction is currently an error.\n+ */\n+struct rte_flow_attr {\n+\tuint32_t group; /**< Priority group. */\n+\tuint32_t priority; /**< Priority level within group. */\n+\tuint32_t ingress:1; /**< Rule applies to ingress traffic. */\n+\tuint32_t egress:1; /**< Rule applies to egress traffic. */\n+\tuint32_t reserved:30; /**< Reserved, must be zero. */\n+};\n+\n+/**\n+ * Matching pattern item types.\n+ *\n+ * Items are arranged in a list to form a matching pattern for packets.\n+ * They fall in two categories:\n+ *\n+ * - Protocol matching (ANY, RAW, ETH, IPV4, IPV6, ICMP, UDP, TCP, SCTP,\n+ *   VXLAN and so on), usually associated with a specification\n+ *   structure. These must be stacked in the same order as the protocol\n+ *   layers to match, starting from L2.\n+ *\n+ * - Affecting how the pattern is processed (END, VOID, INVERT, PF, VF, PORT\n+ *   and so on), often without a specification structure. Since they are\n+ *   meta data that does not match packet contents, these can be specified\n+ *   anywhere within item lists without affecting the protocol matching\n+ *   items.\n+ *\n+ * See the description of individual types for more information. Those\n+ * marked with [META] fall into the second category.\n+ */\n+enum rte_flow_item_type {\n+\t/**\n+\t * [META]\n+\t *\n+\t * End marker for item lists. Prevents further processing of items,\n+\t * thereby ending the pattern.\n+\t *\n+\t * No associated specification structure.\n+\t */\n+\tRTE_FLOW_ITEM_TYPE_END,\n+\n+\t/**\n+\t * [META]\n+\t *\n+\t * Used as a placeholder for convenience. It is ignored and simply\n+\t * discarded by PMDs.\n+\t *\n+\t * No associated specification structure.\n+\t */\n+\tRTE_FLOW_ITEM_TYPE_VOID,\n+\n+\t/**\n+\t * [META]\n+\t *\n+\t * Inverted matching, i.e. process packets that do not match the\n+\t * pattern.\n+\t *\n+\t * No associated specification structure.\n+\t */\n+\tRTE_FLOW_ITEM_TYPE_INVERT,\n+\n+\t/**\n+\t * Matches any protocol in place of the current layer, a single ANY\n+\t * may also stand for several protocol layers.\n+\t *\n+\t * See struct rte_flow_item_any.\n+\t */\n+\tRTE_FLOW_ITEM_TYPE_ANY,\n+\n+\t/**\n+\t * [META]\n+\t *\n+\t * Matches packets addressed to the physical function of the device.\n+\t *\n+\t * If the underlying device function differs from the one that would\n+\t * normally receive the matched traffic, specifying this item\n+\t * prevents it from reaching that device unless the flow rule\n+\t * contains a PF action. Packets are not duplicated between device\n+\t * instances by default.\n+\t *\n+\t * No associated specification structure.\n+\t */\n+\tRTE_FLOW_ITEM_TYPE_PF,\n+\n+\t/**\n+\t * [META]\n+\t *\n+\t * Matches packets addressed to a virtual function ID of the device.\n+\t *\n+\t * If the underlying device function differs from the one that would\n+\t * normally receive the matched traffic, specifying this item\n+\t * prevents it from reaching that device unless the flow rule\n+\t * contains a VF action. Packets are not duplicated between device\n+\t * instances by default.\n+\t *\n+\t * See struct rte_flow_item_vf.\n+\t */\n+\tRTE_FLOW_ITEM_TYPE_VF,\n+\n+\t/**\n+\t * [META]\n+\t *\n+\t * Matches packets coming from the specified physical port of the\n+\t * underlying device.\n+\t *\n+\t * The first PORT item overrides the physical port normally\n+\t * associated with the specified DPDK input port (port_id). This\n+\t * item can be provided several times to match additional physical\n+\t * ports.\n+\t *\n+\t * See struct rte_flow_item_port.\n+\t */\n+\tRTE_FLOW_ITEM_TYPE_PORT,\n+\n+\t/**\n+\t * Matches a byte string of a given length at a given offset.\n+\t *\n+\t * See struct rte_flow_item_raw.\n+\t */\n+\tRTE_FLOW_ITEM_TYPE_RAW,\n+\n+\t/**\n+\t * Matches an Ethernet header.\n+\t *\n+\t * See struct rte_flow_item_eth.\n+\t */\n+\tRTE_FLOW_ITEM_TYPE_ETH,\n+\n+\t/**\n+\t * Matches an 802.1Q/ad VLAN tag.\n+\t *\n+\t * See struct rte_flow_item_vlan.\n+\t */\n+\tRTE_FLOW_ITEM_TYPE_VLAN,\n+\n+\t/**\n+\t * Matches an IPv4 header.\n+\t *\n+\t * See struct rte_flow_item_ipv4.\n+\t */\n+\tRTE_FLOW_ITEM_TYPE_IPV4,\n+\n+\t/**\n+\t * Matches an IPv6 header.\n+\t *\n+\t * See struct rte_flow_item_ipv6.\n+\t */\n+\tRTE_FLOW_ITEM_TYPE_IPV6,\n+\n+\t/**\n+\t * Matches an ICMP header.\n+\t *\n+\t * See struct rte_flow_item_icmp.\n+\t */\n+\tRTE_FLOW_ITEM_TYPE_ICMP,\n+\n+\t/**\n+\t * Matches a UDP header.\n+\t *\n+\t * See struct rte_flow_item_udp.\n+\t */\n+\tRTE_FLOW_ITEM_TYPE_UDP,\n+\n+\t/**\n+\t * Matches a TCP header.\n+\t *\n+\t * See struct rte_flow_item_tcp.\n+\t */\n+\tRTE_FLOW_ITEM_TYPE_TCP,\n+\n+\t/**\n+\t * Matches a SCTP header.\n+\t *\n+\t * See struct rte_flow_item_sctp.\n+\t */\n+\tRTE_FLOW_ITEM_TYPE_SCTP,\n+\n+\t/**\n+\t * Matches a VXLAN header.\n+\t *\n+\t * See struct rte_flow_item_vxlan.\n+\t */\n+\tRTE_FLOW_ITEM_TYPE_VXLAN,\n+};\n+\n+/**\n+ * RTE_FLOW_ITEM_TYPE_ANY\n+ *\n+ * Matches any protocol in place of the current layer, a single ANY may also\n+ * stand for several protocol layers.\n+ *\n+ * This is usually specified as the first pattern item when looking for a\n+ * protocol anywhere in a packet.\n+ *\n+ * A maximum value of 0 requests matching any number of protocol layers\n+ * above or equal to the minimum value, a maximum value lower than the\n+ * minimum one is otherwise invalid.\n+ *\n+ * This type does not work with a range (struct rte_flow_item.last).\n+ */\n+struct rte_flow_item_any {\n+\tuint16_t min; /**< Minimum number of layers covered. */\n+\tuint16_t max; /**< Maximum number of layers covered, 0 for infinity. */\n+};\n+\n+/**\n+ * RTE_FLOW_ITEM_TYPE_VF\n+ *\n+ * Matches packets addressed to a virtual function ID of the device.\n+ *\n+ * If the underlying device function differs from the one that would\n+ * normally receive the matched traffic, specifying this item prevents it\n+ * from reaching that device unless the flow rule contains a VF\n+ * action. Packets are not duplicated between device instances by default.\n+ *\n+ * - Likely to return an error or never match any traffic if this causes a\n+ *   VF device to match traffic addressed to a different VF.\n+ * - Can be specified multiple times to match traffic addressed to several\n+ *   specific VFs.\n+ * - Can be combined with a PF item to match both PF and VF traffic.\n+ *\n+ * A zeroed mask can be used to match any VF.\n+ */\n+struct rte_flow_item_vf {\n+\tuint32_t id; /**< Destination VF ID. */\n+};\n+\n+/**\n+ * RTE_FLOW_ITEM_TYPE_PORT\n+ *\n+ * Matches packets coming from the specified physical port of the underlying\n+ * device.\n+ *\n+ * The first PORT item overrides the physical port normally associated with\n+ * the specified DPDK input port (port_id). This item can be provided\n+ * several times to match additional physical ports.\n+ *\n+ * Note that physical ports are not necessarily tied to DPDK input ports\n+ * (port_id) when those are not under DPDK control. Possible values are\n+ * specific to each device, they are not necessarily indexed from zero and\n+ * may not be contiguous.\n+ *\n+ * As a device property, the list of allowed values as well as the value\n+ * associated with a port_id should be retrieved by other means.\n+ *\n+ * A zeroed mask can be used to match any port index.\n+ */\n+struct rte_flow_item_port {\n+\tuint32_t index; /**< Physical port index. */\n+};\n+\n+/**\n+ * RTE_FLOW_ITEM_TYPE_RAW\n+ *\n+ * Matches a byte string of a given length at a given offset.\n+ *\n+ * Offset is either absolute (using the start of the packet) or relative to\n+ * the end of the previous matched item in the stack, in which case negative\n+ * values are allowed.\n+ *\n+ * If search is enabled, offset is used as the starting point. The search\n+ * area can be delimited by setting limit to a nonzero value, which is the\n+ * maximum number of bytes after offset where the pattern may start.\n+ *\n+ * Matching a zero-length pattern is allowed, doing so resets the relative\n+ * offset for subsequent items.\n+ *\n+ * This type does not work with a range (struct rte_flow_item.last).\n+ */\n+struct rte_flow_item_raw {\n+\tuint32_t relative:1; /**< Look for pattern after the previous item. */\n+\tuint32_t search:1; /**< Search pattern from offset (see also limit). */\n+\tuint32_t reserved:30; /**< Reserved, must be set to zero. */\n+\tint32_t offset; /**< Absolute or relative offset for pattern. */\n+\tuint16_t limit; /**< Search area limit for start of pattern. */\n+\tuint16_t length; /**< Pattern length. */\n+\tuint8_t pattern[]; /**< Byte string to look for. */\n+};\n+\n+/**\n+ * RTE_FLOW_ITEM_TYPE_ETH\n+ *\n+ * Matches an Ethernet header.\n+ */\n+struct rte_flow_item_eth {\n+\tstruct ether_addr dst; /**< Destination MAC. */\n+\tstruct ether_addr src; /**< Source MAC. */\n+\tunsigned int type; /**< EtherType. */\n+};\n+\n+/**\n+ * RTE_FLOW_ITEM_TYPE_VLAN\n+ *\n+ * Matches an 802.1Q/ad VLAN tag.\n+ *\n+ * This type normally follows either RTE_FLOW_ITEM_TYPE_ETH or\n+ * RTE_FLOW_ITEM_TYPE_VLAN.\n+ */\n+struct rte_flow_item_vlan {\n+\tuint16_t tpid; /**< Tag protocol identifier. */\n+\tuint16_t tci; /**< Tag control information. */\n+};\n+\n+/**\n+ * RTE_FLOW_ITEM_TYPE_IPV4\n+ *\n+ * Matches an IPv4 header.\n+ *\n+ * Note: IPv4 options are handled by dedicated pattern items.\n+ */\n+struct rte_flow_item_ipv4 {\n+\tstruct ipv4_hdr hdr; /**< IPv4 header definition. */\n+};\n+\n+/**\n+ * RTE_FLOW_ITEM_TYPE_IPV6.\n+ *\n+ * Matches an IPv6 header.\n+ *\n+ * Note: IPv6 options are handled by dedicated pattern items.\n+ */\n+struct rte_flow_item_ipv6 {\n+\tstruct ipv6_hdr hdr; /**< IPv6 header definition. */\n+};\n+\n+/**\n+ * RTE_FLOW_ITEM_TYPE_ICMP.\n+ *\n+ * Matches an ICMP header.\n+ */\n+struct rte_flow_item_icmp {\n+\tstruct icmp_hdr hdr; /**< ICMP header definition. */\n+};\n+\n+/**\n+ * RTE_FLOW_ITEM_TYPE_UDP.\n+ *\n+ * Matches a UDP header.\n+ */\n+struct rte_flow_item_udp {\n+\tstruct udp_hdr hdr; /**< UDP header definition. */\n+};\n+\n+/**\n+ * RTE_FLOW_ITEM_TYPE_TCP.\n+ *\n+ * Matches a TCP header.\n+ */\n+struct rte_flow_item_tcp {\n+\tstruct tcp_hdr hdr; /**< TCP header definition. */\n+};\n+\n+/**\n+ * RTE_FLOW_ITEM_TYPE_SCTP.\n+ *\n+ * Matches a SCTP header.\n+ */\n+struct rte_flow_item_sctp {\n+\tstruct sctp_hdr hdr; /**< SCTP header definition. */\n+};\n+\n+/**\n+ * RTE_FLOW_ITEM_TYPE_VXLAN.\n+ *\n+ * Matches a VXLAN header (RFC 7348).\n+ */\n+struct rte_flow_item_vxlan {\n+\tuint8_t flags; /**< Normally 0x08 (I flag). */\n+\tuint8_t rsvd0[3]; /**< Reserved, normally 0x000000. */\n+\tuint8_t vni[3]; /**< VXLAN identifier. */\n+\tuint8_t rsvd1; /**< Reserved, normally 0x00. */\n+};\n+\n+/**\n+ * Matching pattern item definition.\n+ *\n+ * A pattern is formed by stacking items starting from the lowest protocol\n+ * layer to match. This stacking restriction does not apply to meta items\n+ * which can be placed anywhere in the stack with no effect on the meaning\n+ * of the resulting pattern.\n+ *\n+ * A stack is terminated by a END item.\n+ *\n+ * The spec field should be a valid pointer to a structure of the related\n+ * item type. It may be set to NULL in many cases to use default values.\n+ *\n+ * Optionally, last can point to a structure of the same type to define an\n+ * inclusive range. This is mostly supported by integer and address fields,\n+ * may cause errors otherwise. Fields that do not support ranges must be set\n+ * to the same value as their spec counterparts.\n+ *\n+ * By default all fields present in spec are considered relevant.* This\n+ * behavior can be altered by providing a mask structure of the same type\n+ * with applicable bits set to one. It can also be used to partially filter\n+ * out specific fields (e.g. as an alternate mean to match ranges of IP\n+ * addresses).\n+ *\n+ * Note this is a simple bit-mask applied before interpreting the contents\n+ * of spec and last, which may yield unexpected results if not used\n+ * carefully. For example, if for an IPv4 address field, spec provides\n+ * 10.1.2.3, last provides 10.3.4.5 and mask provides 255.255.0.0, the\n+ * effective range is 10.1.0.0 to 10.3.255.255.\n+ *\n+ * * The defaults for data-matching items such as IPv4 when mask is not\n+ *   specified actually depend on the underlying implementation since only\n+ *   recognized fields can be taken into account.\n+ */\n+struct rte_flow_item {\n+\tenum rte_flow_item_type type; /**< Item type. */\n+\tconst void *spec; /**< Pointer to item specification structure. */\n+\tconst void *last; /**< Defines an inclusive range (spec to last). */\n+\tconst void *mask; /**< Bit-mask applied to spec and last. */\n+};\n+\n+/**\n+ * Action types.\n+ *\n+ * Each possible action is represented by a type. Some have associated\n+ * configuration structures. Several actions combined in a list can be\n+ * affected to a flow rule. That list is not ordered.\n+ *\n+ * They fall in three categories:\n+ *\n+ * - Terminating actions (such as QUEUE, DROP, RSS, PF, VF) that prevent\n+ *   processing matched packets by subsequent flow rules, unless overridden\n+ *   with PASSTHRU.\n+ *\n+ * - Non terminating actions (PASSTHRU, DUP) that leave matched packets up\n+ *   for additional processing by subsequent flow rules.\n+ *\n+ * - Other non terminating meta actions that do not affect the fate of\n+ *   packets (END, VOID, MARK, FLAG, COUNT).\n+ *\n+ * When several actions are combined in a flow rule, they should all have\n+ * different types (e.g. dropping a packet twice is not possible). The\n+ * defined behavior is for PMDs to only take into account the last action of\n+ * a given type found in the list. PMDs still perform error checking on the\n+ * entire list.\n+ *\n+ * Note that PASSTHRU is the only action able to override a terminating\n+ * rule.\n+ */\n+enum rte_flow_action_type {\n+\t/**\n+\t * [META]\n+\t *\n+\t * End marker for action lists. Prevents further processing of\n+\t * actions, thereby ending the list.\n+\t *\n+\t * No associated configuration structure.\n+\t */\n+\tRTE_FLOW_ACTION_TYPE_END,\n+\n+\t/**\n+\t * [META]\n+\t *\n+\t * Used as a placeholder for convenience. It is ignored and simply\n+\t * discarded by PMDs.\n+\t *\n+\t * No associated configuration structure.\n+\t */\n+\tRTE_FLOW_ACTION_TYPE_VOID,\n+\n+\t/**\n+\t * Leaves packets up for additional processing by subsequent flow\n+\t * rules. This is the default when a rule does not contain a\n+\t * terminating action, but can be specified to force a rule to\n+\t * become non-terminating.\n+\t *\n+\t * No associated configuration structure.\n+\t */\n+\tRTE_FLOW_ACTION_TYPE_PASSTHRU,\n+\n+\t/**\n+\t * [META]\n+\t *\n+\t * Attaches a 32 bit value to packets.\n+\t *\n+\t * See struct rte_flow_action_mark.\n+\t */\n+\tRTE_FLOW_ACTION_TYPE_MARK,\n+\n+\t/**\n+\t * [META]\n+\t *\n+\t * Flag packets. Similar to MARK but only affects ol_flags.\n+\t *\n+\t * Note: a distinctive flag must be defined for it.\n+\t *\n+\t * No associated configuration structure.\n+\t */\n+\tRTE_FLOW_ACTION_TYPE_FLAG,\n+\n+\t/**\n+\t * Assigns packets to a given queue index.\n+\t *\n+\t * See struct rte_flow_action_queue.\n+\t */\n+\tRTE_FLOW_ACTION_TYPE_QUEUE,\n+\n+\t/**\n+\t * Drops packets.\n+\t *\n+\t * PASSTHRU overrides this action if both are specified.\n+\t *\n+\t * No associated configuration structure.\n+\t */\n+\tRTE_FLOW_ACTION_TYPE_DROP,\n+\n+\t/**\n+\t * [META]\n+\t *\n+\t * Enables counters for this rule.\n+\t *\n+\t * These counters can be retrieved and reset through rte_flow_query(),\n+\t * see struct rte_flow_query_count.\n+\t *\n+\t * No associated configuration structure.\n+\t */\n+\tRTE_FLOW_ACTION_TYPE_COUNT,\n+\n+\t/**\n+\t * Duplicates packets to a given queue index.\n+\t *\n+\t * This is normally combined with QUEUE, however when used alone, it\n+\t * is actually similar to QUEUE + PASSTHRU.\n+\t *\n+\t * See struct rte_flow_action_dup.\n+\t */\n+\tRTE_FLOW_ACTION_TYPE_DUP,\n+\n+\t/**\n+\t * Similar to QUEUE, except RSS is additionally performed on packets\n+\t * to spread them among several queues according to the provided\n+\t * parameters.\n+\t *\n+\t * See struct rte_flow_action_rss.\n+\t */\n+\tRTE_FLOW_ACTION_TYPE_RSS,\n+\n+\t/**\n+\t * Redirects packets to the physical function (PF) of the current\n+\t * device.\n+\t *\n+\t * No associated configuration structure.\n+\t */\n+\tRTE_FLOW_ACTION_TYPE_PF,\n+\n+\t/**\n+\t * Redirects packets to the virtual function (VF) of the current\n+\t * device with the specified ID.\n+\t *\n+\t * See struct rte_flow_action_vf.\n+\t */\n+\tRTE_FLOW_ACTION_TYPE_VF,\n+};\n+\n+/**\n+ * RTE_FLOW_ACTION_TYPE_MARK\n+ *\n+ * Attaches a 32 bit value to packets.\n+ *\n+ * This value is arbitrary and application-defined. For compatibility with\n+ * FDIR it is returned in the hash.fdir.hi mbuf field. PKT_RX_FDIR_ID is\n+ * also set in ol_flags.\n+ */\n+struct rte_flow_action_mark {\n+\tuint32_t id; /**< 32 bit value to return with packets. */\n+};\n+\n+/**\n+ * RTE_FLOW_ACTION_TYPE_QUEUE\n+ *\n+ * Assign packets to a given queue index.\n+ *\n+ * Terminating by default.\n+ */\n+struct rte_flow_action_queue {\n+\tuint16_t index; /**< Queue index to use. */\n+};\n+\n+/**\n+ * RTE_FLOW_ACTION_TYPE_COUNT (query)\n+ *\n+ * Query structure to retrieve and reset flow rule counters.\n+ */\n+struct rte_flow_query_count {\n+\tuint32_t reset:1; /**< Reset counters after query [in]. */\n+\tuint32_t hits_set:1; /**< hits field is set [out]. */\n+\tuint32_t bytes_set:1; /**< bytes field is set [out]. */\n+\tuint32_t reserved:29; /**< Reserved, must be zero [in, out]. */\n+\tuint64_t hits; /**< Number of hits for this rule [out]. */\n+\tuint64_t bytes; /**< Number of bytes through this rule [out]. */\n+};\n+\n+/**\n+ * RTE_FLOW_ACTION_TYPE_DUP\n+ *\n+ * Duplicates packets to a given queue index.\n+ *\n+ * This is normally combined with QUEUE, however when used alone, it is\n+ * actually similar to QUEUE + PASSTHRU.\n+ *\n+ * Non-terminating by default.\n+ */\n+struct rte_flow_action_dup {\n+\tuint16_t index; /**< Queue index to duplicate packets to. */\n+};\n+\n+/**\n+ * RTE_FLOW_ACTION_TYPE_RSS\n+ *\n+ * Similar to QUEUE, except RSS is additionally performed on packets to\n+ * spread them among several queues according to the provided parameters.\n+ *\n+ * Note: RSS hash result is normally stored in the hash.rss mbuf field,\n+ * however it conflicts with the MARK action as they share the same\n+ * space. When both actions are specified, the RSS hash is discarded and\n+ * PKT_RX_RSS_HASH is not set in ol_flags. MARK has priority. The mbuf\n+ * structure should eventually evolve to store both.\n+ *\n+ * Terminating by default.\n+ */\n+struct rte_flow_action_rss {\n+\tconst struct rte_eth_rss_conf *rss_conf; /**< RSS parameters. */\n+\tuint16_t queues; /**< Number of entries in queue[]. */\n+\tuint16_t queue[]; /**< Queues indices to use. */\n+};\n+\n+/**\n+ * RTE_FLOW_ACTION_TYPE_VF\n+ *\n+ * Redirects packets to a virtual function (VF) of the current device.\n+ *\n+ * Packets matched by a VF pattern item can be redirected to their original\n+ * VF ID instead of the specified one. This parameter may not be available\n+ * and is not guaranteed to work properly if the VF part is matched by a\n+ * prior flow rule or if packets are not addressed to a VF in the first\n+ * place.\n+ *\n+ * Terminating by default.\n+ */\n+struct rte_flow_action_vf {\n+\tuint32_t original:1; /**< Use original VF ID if possible. */\n+\tuint32_t reserved:31; /**< Reserved, must be zero. */\n+\tuint32_t id; /**< VF ID to redirect packets to. */\n+};\n+\n+/**\n+ * Definition of a single action.\n+ *\n+ * A list of actions is terminated by a END action.\n+ *\n+ * For simple actions without a configuration structure, conf remains NULL.\n+ */\n+struct rte_flow_action {\n+\tenum rte_flow_action_type type; /**< Action type. */\n+\tconst void *conf; /**< Pointer to action configuration structure. */\n+};\n+\n+/**\n+ * Opaque type returned after successfully creating a flow.\n+ *\n+ * This handle can be used to manage and query the related flow (e.g. to\n+ * destroy it or retrieve counters).\n+ */\n+struct rte_flow;\n+\n+/**\n+ * Verbose error types.\n+ *\n+ * Most of them provide the type of the object referenced by struct\n+ * rte_flow_error.cause.\n+ */\n+enum rte_flow_error_type {\n+\tRTE_FLOW_ERROR_TYPE_NONE, /**< No error. */\n+\tRTE_FLOW_ERROR_TYPE_UNSPECIFIED, /**< Cause unspecified. */\n+\tRTE_FLOW_ERROR_TYPE_HANDLE, /**< Flow rule (handle). */\n+\tRTE_FLOW_ERROR_TYPE_ATTR_GROUP, /**< Group field. */\n+\tRTE_FLOW_ERROR_TYPE_ATTR_PRIORITY, /**< Priority field. */\n+\tRTE_FLOW_ERROR_TYPE_ATTR_INGRESS, /**< Ingress field. */\n+\tRTE_FLOW_ERROR_TYPE_ATTR_EGRESS, /**< Egress field. */\n+\tRTE_FLOW_ERROR_TYPE_ATTR, /**< Attributes structure. */\n+\tRTE_FLOW_ERROR_TYPE_ITEM_NUM, /**< Pattern length. */\n+\tRTE_FLOW_ERROR_TYPE_ITEM, /**< Specific pattern item. */\n+\tRTE_FLOW_ERROR_TYPE_ACTION_NUM, /**< Number of actions. */\n+\tRTE_FLOW_ERROR_TYPE_ACTION, /**< Specific action. */\n+};\n+\n+/**\n+ * Verbose error structure definition.\n+ *\n+ * This object is normally allocated by applications and set by PMDs, the\n+ * message points to a constant string which does not need to be freed by\n+ * the application, however its pointer can be considered valid only as long\n+ * as its associated DPDK port remains configured. Closing the underlying\n+ * device or unloading the PMD invalidates it.\n+ *\n+ * Both cause and message may be NULL regardless of the error type.\n+ */\n+struct rte_flow_error {\n+\tenum rte_flow_error_type type; /**< Cause field and error types. */\n+\tconst void *cause; /**< Object responsible for the error. */\n+\tconst char *message; /**< Human-readable error message. */\n+};\n+\n+/**\n+ * Check whether a flow rule can be created on a given port.\n+ *\n+ * While this function has no effect on the target device, the flow rule is\n+ * validated against its current configuration state and the returned value\n+ * should be considered valid by the caller for that state only.\n+ *\n+ * The returned value is guaranteed to remain valid only as long as no\n+ * successful calls to rte_flow_create() or rte_flow_destroy() are made in\n+ * the meantime and no device parameter affecting flow rules in any way are\n+ * modified, due to possible collisions or resource limitations (although in\n+ * such cases EINVAL should not be returned).\n+ *\n+ * @param port_id\n+ *   Port identifier of Ethernet device.\n+ * @param[in] attr\n+ *   Flow rule attributes.\n+ * @param[in] pattern\n+ *   Pattern specification (list terminated by the END pattern item).\n+ * @param[in] actions\n+ *   Associated actions (list terminated by the END action).\n+ * @param[out] error\n+ *   Perform verbose error reporting if not NULL.\n+ *\n+ * @return\n+ *   0 if flow rule is valid and can be created. A negative errno value\n+ *   otherwise (rte_errno is also set), the following errors are defined:\n+ *\n+ *   -ENOSYS: underlying device does not support this functionality.\n+ *\n+ *   -EINVAL: unknown or invalid rule specification.\n+ *\n+ *   -ENOTSUP: valid but unsupported rule specification (e.g. partial\n+ *   bit-masks are unsupported).\n+ *\n+ *   -EEXIST: collision with an existing rule.\n+ *\n+ *   -ENOMEM: not enough resources.\n+ *\n+ *   -EBUSY: action cannot be performed due to busy device resources, may\n+ *   succeed if the affected queues or even the entire port are in a stopped\n+ *   state (see rte_eth_dev_rx_queue_stop() and rte_eth_dev_stop()).\n+ */\n+int\n+rte_flow_validate(uint8_t port_id,\n+\t\t  const struct rte_flow_attr *attr,\n+\t\t  const struct rte_flow_item pattern[],\n+\t\t  const struct rte_flow_action actions[],\n+\t\t  struct rte_flow_error *error);\n+\n+/**\n+ * Create a flow rule on a given port.\n+ *\n+ * @param port_id\n+ *   Port identifier of Ethernet device.\n+ * @param[in] attr\n+ *   Flow rule attributes.\n+ * @param[in] pattern\n+ *   Pattern specification (list terminated by the END pattern item).\n+ * @param[in] actions\n+ *   Associated actions (list terminated by the END action).\n+ * @param[out] error\n+ *   Perform verbose error reporting if not NULL.\n+ *\n+ * @return\n+ *   A valid handle in case of success, NULL otherwise and rte_errno is set\n+ *   to the positive version of one of the error codes defined for\n+ *   rte_flow_validate().\n+ */\n+struct rte_flow *\n+rte_flow_create(uint8_t port_id,\n+\t\tconst struct rte_flow_attr *attr,\n+\t\tconst struct rte_flow_item pattern[],\n+\t\tconst struct rte_flow_action actions[],\n+\t\tstruct rte_flow_error *error);\n+\n+/**\n+ * Destroy a flow rule on a given port.\n+ *\n+ * Failure to destroy a flow rule handle may occur when other flow rules\n+ * depend on it, and destroying it would result in an inconsistent state.\n+ *\n+ * This function is only guaranteed to succeed if handles are destroyed in\n+ * reverse order of their creation.\n+ *\n+ * @param port_id\n+ *   Port identifier of Ethernet device.\n+ * @param flow\n+ *   Flow rule handle to destroy.\n+ * @param[out] error\n+ *   Perform verbose error reporting if not NULL.\n+ *\n+ * @return\n+ *   0 on success, a negative errno value otherwise and rte_errno is set.\n+ */\n+int\n+rte_flow_destroy(uint8_t port_id,\n+\t\t struct rte_flow *flow,\n+\t\t struct rte_flow_error *error);\n+\n+/**\n+ * Destroy all flow rules associated with a port.\n+ *\n+ * In the unlikely event of failure, handles are still considered destroyed\n+ * and no longer valid but the port must be assumed to be in an inconsistent\n+ * state.\n+ *\n+ * @param port_id\n+ *   Port identifier of Ethernet device.\n+ * @param[out] error\n+ *   Perform verbose error reporting if not NULL.\n+ *\n+ * @return\n+ *   0 on success, a negative errno value otherwise and rte_errno is set.\n+ */\n+int\n+rte_flow_flush(uint8_t port_id,\n+\t       struct rte_flow_error *error);\n+\n+/**\n+ * Query an existing flow rule.\n+ *\n+ * This function allows retrieving flow-specific data such as counters.\n+ * Data is gathered by special actions which must be present in the flow\n+ * rule definition.\n+ *\n+ * @param port_id\n+ *   Port identifier of Ethernet device.\n+ * @param flow\n+ *   Flow rule handle to query.\n+ * @param action\n+ *   Action type to query.\n+ * @param[in, out] data\n+ *   Pointer to storage for the associated query data type.\n+ * @param[out] error\n+ *   Perform verbose error reporting if not NULL.\n+ *\n+ * @return\n+ *   0 on success, a negative errno value otherwise and rte_errno is set.\n+ */\n+int\n+rte_flow_query(uint8_t port_id,\n+\t       struct rte_flow *flow,\n+\t       enum rte_flow_action_type action,\n+\t       void *data,\n+\t       struct rte_flow_error *error);\n+\n+#ifdef __cplusplus\n+}\n+#endif\n+\n+#endif /* RTE_FLOW_H_ */\ndiff --git a/lib/librte_ether/rte_flow_driver.h b/lib/librte_ether/rte_flow_driver.h\nnew file mode 100644\nindex 0000000..a88c621\n--- /dev/null\n+++ b/lib/librte_ether/rte_flow_driver.h\n@@ -0,0 +1,177 @@\n+/*-\n+ *   BSD LICENSE\n+ *\n+ *   Copyright 2016 6WIND S.A.\n+ *   Copyright 2016 Mellanox.\n+ *\n+ *   Redistribution and use in source and binary forms, with or without\n+ *   modification, are permitted provided that the following conditions\n+ *   are met:\n+ *\n+ *     * Redistributions of source code must retain the above copyright\n+ *       notice, this list of conditions and the following disclaimer.\n+ *     * Redistributions in binary form must reproduce the above copyright\n+ *       notice, this list of conditions and the following disclaimer in\n+ *       the documentation and/or other materials provided with the\n+ *       distribution.\n+ *     * Neither the name of 6WIND S.A. nor the names of its\n+ *       contributors may be used to endorse or promote products derived\n+ *       from this software without specific prior written permission.\n+ *\n+ *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n+ *   \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n+ *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n+ *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n+ *   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n+ *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n+ *   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n+ *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n+ *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n+ *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n+ *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n+ */\n+\n+#ifndef RTE_FLOW_DRIVER_H_\n+#define RTE_FLOW_DRIVER_H_\n+\n+/**\n+ * @file\n+ * RTE generic flow API (driver side)\n+ *\n+ * This file provides implementation helpers for internal use by PMDs, they\n+ * are not intended to be exposed to applications and are not subject to ABI\n+ * versioning.\n+ */\n+\n+#include <stdint.h>\n+\n+#include <rte_errno.h>\n+#include \"rte_flow.h\"\n+\n+#ifdef __cplusplus\n+extern \"C\" {\n+#endif\n+\n+/**\n+ * Generic flow operations structure implemented and returned by PMDs.\n+ *\n+ * To implement this API, PMDs must handle the RTE_ETH_FILTER_GENERIC filter\n+ * type in their .filter_ctrl callback function (struct eth_dev_ops) as well\n+ * as the RTE_ETH_FILTER_GET filter operation.\n+ *\n+ * If successful, this operation must result in a pointer to a PMD-specific\n+ * struct rte_flow_ops written to the argument address as described below:\n+ *\n+ *  // PMD filter_ctrl callback\n+ *\n+ *  static const struct rte_flow_ops pmd_flow_ops = { ... };\n+ *\n+ *  switch (filter_type) {\n+ *  case RTE_ETH_FILTER_GENERIC:\n+ *      if (filter_op != RTE_ETH_FILTER_GET)\n+ *          return -EINVAL;\n+ *      *(const void **)arg = &pmd_flow_ops;\n+ *      return 0;\n+ *  }\n+ *\n+ * See also rte_flow_ops_get().\n+ *\n+ * These callback functions are not supposed to be used by applications\n+ * directly, which must rely on the API defined in rte_flow.h.\n+ *\n+ * Public-facing wrapper functions perform a few consistency checks so that\n+ * unimplemented (i.e. NULL) callbacks simply return -ENOTSUP. These\n+ * callbacks otherwise only differ by their first argument (with port ID\n+ * already resolved to a pointer to struct rte_eth_dev).\n+ */\n+struct rte_flow_ops {\n+\t/** See rte_flow_validate(). */\n+\tint (*validate)\n+\t\t(struct rte_eth_dev *,\n+\t\t const struct rte_flow_attr *,\n+\t\t const struct rte_flow_item [],\n+\t\t const struct rte_flow_action [],\n+\t\t struct rte_flow_error *);\n+\t/** See rte_flow_create(). */\n+\tstruct rte_flow *(*create)\n+\t\t(struct rte_eth_dev *,\n+\t\t const struct rte_flow_attr *,\n+\t\t const struct rte_flow_item [],\n+\t\t const struct rte_flow_action [],\n+\t\t struct rte_flow_error *);\n+\t/** See rte_flow_destroy(). */\n+\tint (*destroy)\n+\t\t(struct rte_eth_dev *,\n+\t\t struct rte_flow *,\n+\t\t struct rte_flow_error *);\n+\t/** See rte_flow_flush(). */\n+\tint (*flush)\n+\t\t(struct rte_eth_dev *,\n+\t\t struct rte_flow_error *);\n+\t/** See rte_flow_query(). */\n+\tint (*query)\n+\t\t(struct rte_eth_dev *,\n+\t\t struct rte_flow *,\n+\t\t enum rte_flow_action_type,\n+\t\t void *,\n+\t\t struct rte_flow_error *);\n+};\n+\n+/**\n+ * Initialize generic flow error structure.\n+ *\n+ * This function also sets rte_errno to a given value.\n+ *\n+ * @param[out] error\n+ *   Pointer to flow error structure (may be NULL).\n+ * @param code\n+ *   Related error code (rte_errno).\n+ * @param type\n+ *   Cause field and error types.\n+ * @param cause\n+ *   Object responsible for the error.\n+ * @param message\n+ *   Human-readable error message.\n+ *\n+ * @return\n+ *   Pointer to flow error structure.\n+ */\n+static inline struct rte_flow_error *\n+rte_flow_error_set(struct rte_flow_error *error,\n+\t\t   int code,\n+\t\t   enum rte_flow_error_type type,\n+\t\t   void *cause,\n+\t\t   const char *message)\n+{\n+\tif (error) {\n+\t\t*error = (struct rte_flow_error){\n+\t\t\t.type = type,\n+\t\t\t.cause = cause,\n+\t\t\t.message = message,\n+\t\t};\n+\t}\n+\trte_errno = code;\n+\treturn error;\n+}\n+\n+/**\n+ * Get generic flow operations structure from a port.\n+ *\n+ * @param port_id\n+ *   Port identifier to query.\n+ * @param[out] error\n+ *   Pointer to flow error structure.\n+ *\n+ * @return\n+ *   The flow operations structure associated with port_id, NULL in case of\n+ *   error, in which case rte_errno is set and the error structure contains\n+ *   additional details.\n+ */\n+const struct rte_flow_ops *\n+rte_flow_ops_get(uint8_t port_id, struct rte_flow_error *error);\n+\n+#ifdef __cplusplus\n+}\n+#endif\n+\n+#endif /* RTE_FLOW_DRIVER_H_ */\n",
    "prefixes": [
        "dpdk-dev",
        "01/22"
    ]
}