get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 18201,
    "url": "http://patches.dpdk.org/api/patches/18201/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/3bbb1cac29fa37b713a7586a93291ddb9f91275a.1482168851.git.adrien.mazarguil@6wind.com/",
    "project": {
        "id": 1,
        "url": "http://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": "<3bbb1cac29fa37b713a7586a93291ddb9f91275a.1482168851.git.adrien.mazarguil@6wind.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/3bbb1cac29fa37b713a7586a93291ddb9f91275a.1482168851.git.adrien.mazarguil@6wind.com",
    "date": "2016-12-19T17:48:51",
    "name": "[dpdk-dev,v3,01/25] ethdev: introduce generic flow API",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "ddb01ad68ac27ac0e7bc83f669ee5ca481f3180e",
    "submitter": {
        "id": 165,
        "url": "http://patches.dpdk.org/api/people/165/?format=api",
        "name": "Adrien Mazarguil",
        "email": "adrien.mazarguil@6wind.com"
    },
    "delegate": null,
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/3bbb1cac29fa37b713a7586a93291ddb9f91275a.1482168851.git.adrien.mazarguil@6wind.com/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/18201/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/18201/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 D6A91FA3C;\n\tMon, 19 Dec 2016 18:49:55 +0100 (CET)",
            "from mail-wj0-f177.google.com (mail-wj0-f177.google.com\n\t[209.85.210.177]) by dpdk.org (Postfix) with ESMTP id 8E93AF95D\n\tfor <dev@dpdk.org>; Mon, 19 Dec 2016 18:49:31 +0100 (CET)",
            "by mail-wj0-f177.google.com with SMTP id tg4so157304914wjb.1\n\tfor <dev@dpdk.org>; Mon, 19 Dec 2016 09:49:31 -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\tr138sm18098787wme.9.2016.12.19.09.49.26\n\tfor <dev@dpdk.org> (version=TLS1_2 cipher=AES128-SHA bits=128/128);\n\tMon, 19 Dec 2016 09:49:28 -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:subject:date:message-id:in-reply-to:references;\n\tbh=5vB+mg/kLBih9u4vzWcUj/THoq78pETxCEob10B9yWk=;\n\tb=R27eXmB1NB70UXZIJfvHby+S7oMIMJDpv1YG7hFDGm9tslLBOaELMOsF4s+7cWdHAT\n\tUlb2R3u7RPdDIOlQQk+5OMrwFPOkk+JtBAaCcg+baejY5Xq9pMippTN2/5/6aJpysJFq\n\tg5/otrrJvNSBLzEh63G6SYQD82xxEW6DzdpcEcERC+Z3SY6/EE7C1JSBUrvctLJ0+p/M\n\tdRsCoTkkemXjKGsInvYZfvXI/UDcfWzoqI8/jGfKK8/3mJgEZaTHmtqUTJJToHO4S/5d\n\tSTqTOMNA/5qtKWJvGX+Cbf8J0+xp4uVJ1vFAbeb8B+RPtYOjrfuO/rqOkLt5zgbbf4aF\n\tiDCw==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:subject:date:message-id:in-reply-to\n\t:references;\n\tbh=5vB+mg/kLBih9u4vzWcUj/THoq78pETxCEob10B9yWk=;\n\tb=PkM0uDayWKg/cCJBEKf1rpwCDWnJ5orlqZZXnbLgzsaomC9QHcO+rh9sDnznc3nSUF\n\tec7rKbUaAUaDITd2dsTiXsNMHM00jCGdyPo3akhmoD21Yd/L5Z1z+qxU4NCP+pXBM3qB\n\tvMzQEntjLyAYt70iuUcAoj5CSVgpT207xUvx/mCqwzgL/eUIt0dTm9JVYUz8T1p9Z1iJ\n\tobkC2p1UYpxE6fr3EkF9fSOrTRvhqB8Im0E1WIhH7Z1+fcQewsZeXiTPOoUHpKGx+MIg\n\tK/rKkiWdxnogr5OgQSdvfqWiDFbXtPmiInywhjeaKNV96Rkg5jCulzEU3NNZ8IkORyH9\n\tfQkw==",
        "X-Gm-Message-State": "AIkVDXLf8tsWTMEnjqlsPbzsmtFiMSMNISKs6K58wg6esWp7X4i64VMtS/1wyNXC/1vVb/MY",
        "X-Received": "by 10.194.0.43 with SMTP id 11mr14849702wjb.218.1482169769591;\n\tMon, 19 Dec 2016 09:49:29 -0800 (PST)",
        "From": "Adrien Mazarguil <adrien.mazarguil@6wind.com>",
        "To": "dev@dpdk.org",
        "Date": "Mon, 19 Dec 2016 18:48:51 +0100",
        "Message-Id": "<3bbb1cac29fa37b713a7586a93291ddb9f91275a.1482168851.git.adrien.mazarguil@6wind.com>",
        "X-Mailer": "git-send-email 2.1.4",
        "In-Reply-To": "<cover.1482168851.git.adrien.mazarguil@6wind.com>",
        "References": "<cover.1481903839.git.adrien.mazarguil@6wind.com>\n\t<cover.1482168851.git.adrien.mazarguil@6wind.com>",
        "Subject": "[dpdk-dev] [PATCH v3 01/25] ethdev: introduce generic flow API",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <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>\nAcked-by: Olga Shern <olgas@mellanox.com>\n---\n MAINTAINERS                            |   4 +\n doc/api/doxy-api-index.md              |   2 +\n lib/librte_ether/Makefile              |   3 +\n lib/librte_ether/rte_eth_ctrl.h        |   1 +\n lib/librte_ether/rte_ether_version.map |  11 +\n lib/librte_ether/rte_flow.c            | 159 +++++\n lib/librte_ether/rte_flow.h            | 947 ++++++++++++++++++++++++++++\n lib/librte_ether/rte_flow_driver.h     | 182 ++++++\n 8 files changed, 1309 insertions(+)",
    "diff": "diff --git a/MAINTAINERS b/MAINTAINERS\nindex 26d9590..5975cff 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/doc/api/doxy-api-index.md b/doc/api/doxy-api-index.md\nindex de65b4c..4951552 100644\n--- a/doc/api/doxy-api-index.md\n+++ b/doc/api/doxy-api-index.md\n@@ -39,6 +39,8 @@ There are many libraries, so their headers may be grouped by topics:\n   [dev]                (@ref rte_dev.h),\n   [ethdev]             (@ref rte_ethdev.h),\n   [ethctrl]            (@ref rte_eth_ctrl.h),\n+  [rte_flow]           (@ref rte_flow.h),\n+  [rte_flow_driver]    (@ref rte_flow_driver.h),\n   [cryptodev]          (@ref rte_cryptodev.h),\n   [devargs]            (@ref rte_devargs.h),\n   [bond]               (@ref rte_eth_bond.h),\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..384cdee 100644\n--- a/lib/librte_ether/rte_ether_version.map\n+++ b/lib/librte_ether/rte_ether_version.map\n@@ -147,3 +147,14 @@ 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_flush;\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..d98fb1b\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 = ENOSYS;\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, ENOSYS, RTE_FLOW_ERROR_TYPE_UNSPECIFIED,\n+\t\t\t   NULL, rte_strerror(ENOSYS));\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, ENOSYS, RTE_FLOW_ERROR_TYPE_UNSPECIFIED,\n+\t\t\t   NULL, rte_strerror(ENOSYS));\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, ENOSYS, RTE_FLOW_ERROR_TYPE_UNSPECIFIED,\n+\t\t\t   NULL, rte_strerror(ENOSYS));\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, ENOSYS, RTE_FLOW_ERROR_TYPE_UNSPECIFIED,\n+\t\t\t   NULL, rte_strerror(ENOSYS));\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, ENOSYS, RTE_FLOW_ERROR_TYPE_UNSPECIFIED,\n+\t\t\t   NULL, rte_strerror(ENOSYS));\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..98084ac\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+ * At least one direction must be specified.\n+ *\n+ * Specifying both directions at once for a given rule is not recommended\n+ * but may be valid in a few cases (e.g. shared counter).\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+ * Pattern items fall in two categories:\n+ *\n+ * - Matching protocol headers and packet data (ANY, RAW, ETH, VLAN, IPV4,\n+ *   IPV6, ICMP, UDP, TCP, SCTP, VXLAN and so on), usually associated with a\n+ *   specification structure. These must be stacked in the same order as the\n+ *   protocol layers to match, starting from the lowest.\n+ *\n+ * - Matching meta-data or affecting pattern processing (END, VOID, INVERT,\n+ *   PF, VF, PORT and so on), often without a specification structure. Since\n+ *   they do not match packet contents, these can be specified anywhere\n+ *   within item lists without affecting others.\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 zeroed mask stands for any number of layers.\n+ */\n+struct rte_flow_item_any {\n+\tuint32_t num; /* Number of layers covered. */\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+ *   VF IDs.\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 ID.\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 support ranges (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+\tuint16_t 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 without affecting the meaning\n+ * of the resulting pattern.\n+ *\n+ * Patterns are terminated by END items.\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 0 or to the same value as the corresponding fields in spec.\n+ *\n+ * By default all fields present in spec are considered relevant (see note\n+ * below). This behavior can be altered by providing a mask structure of the\n+ * same type with applicable bits set to one. It can also be used to\n+ * partially filter out specific fields (e.g. as an alternate mean to match\n+ * ranges of IP addresses).\n+ *\n+ * Mask is a simple bit-mask applied before interpreting the contents of\n+ * 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 becomes 10.1.0.0 to 10.3.255.255.\n+ *\n+ * Note: 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).\n+ *\n+ * Only the last action of a given type is taken into account. PMDs still\n+ * perform error checking on the 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 num; /**< 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. PMDs initialize this\n+ *   structure in case of error only.\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. PMDs initialize this\n+ *   structure in case of error only.\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. PMDs initialize this\n+ *   structure in case of error only.\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. PMDs initialize this\n+ *   structure in case of error only.\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+ * \\see RTE_FLOW_ACTION_TYPE_COUNT\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. PMDs initialize this\n+ *   structure in case of error only.\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..274562c\n--- /dev/null\n+++ b/lib/librte_ether/rte_flow_driver.h\n@@ -0,0 +1,182 @@\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_ethdev.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+ * \\code\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+ * \\endcode\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   const 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",
        "v3",
        "01/25"
    ]
}