get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 77087,
    "url": "http://patches.dpdk.org/api/patches/77087/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20200909203008.25563-4-andreyv@nvidia.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": "<20200909203008.25563-4-andreyv@nvidia.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200909203008.25563-4-andreyv@nvidia.com",
    "date": "2020-09-09T20:30:11",
    "name": "[RFC,3/3] sft: introduce API",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "2f8176a939a181f7b22da80a3100201a6ac9170e",
    "submitter": {
        "id": 1969,
        "url": "http://patches.dpdk.org/api/people/1969/?format=api",
        "name": "Andrey Vesnovaty",
        "email": "andreyv@nvidia.com"
    },
    "delegate": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20200909203008.25563-4-andreyv@nvidia.com/mbox/",
    "series": [
        {
            "id": 12067,
            "url": "http://patches.dpdk.org/api/series/12067/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=12067",
            "date": "2020-09-09T20:30:05",
            "name": "introduce Stateful Flow Table",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/12067/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/77087/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/77087/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id E64EAA04B5;\n\tWed,  9 Sep 2020 22:32:15 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id C79891BE0C;\n\tWed,  9 Sep 2020 22:32:15 +0200 (CEST)",
            "from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129])\n by dpdk.org (Postfix) with ESMTP id E2CC81C0CA\n for <dev@dpdk.org>; Wed,  9 Sep 2020 22:32:13 +0200 (CEST)",
            "from Internal Mail-Server by MTLPINE1 (envelope-from\n andreyv@nvidia.com) with SMTP; 9 Sep 2020 23:32:10 +0300",
            "from nvidia.com (r-arch-host11.mtr.labs.mlnx [10.213.43.60])\n by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 089KUKbR023874;\n Wed, 9 Sep 2020 23:32:10 +0300"
        ],
        "From": "Andrey Vesnovaty <andreyv@nvidia.com>",
        "To": "dev@dpdk.org",
        "Cc": "thomas@nvidia.net, orika@nvidia.com, viacheslavo@nvidia.com,\n andrey.vesnovaty@gmail.com, ozsh@nvidia.com, elibr@nvidia.com,\n alexr@nvidia.com, roniba@nvidia.com, Ray Kinsella <mdr@ashroe.eu>,\n Neil Horman <nhorman@tuxdriver.com>",
        "Date": "Wed,  9 Sep 2020 23:30:11 +0300",
        "Message-Id": "<20200909203008.25563-4-andreyv@nvidia.com>",
        "X-Mailer": "git-send-email 2.26.2",
        "In-Reply-To": "<20200909203008.25563-1-andreyv@nvidia.com>",
        "References": "<20200909203008.25563-1-andreyv@nvidia.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [RFC 3/3] sft: introduce 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": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Defines RTE SFT APIs for Statefull Flow Table library.\n\nSFT General description:\nSFT library provides a framework for applications that need to maintain\ncontext across different packets of the connection.\nExamples for such applications:\n- Next-generation firewalls\n- Intrusion detection/prevention systems (IDS/IPS): Suricata, snort\n- SW/Virtual Switching: OVS\nThe goals of the SFT library:\n- Accelerate flow recognition & its context retrieval for further\n  lookaside processing.\n- Enable context-aware flow handling offload.\n\nSigned-off-by: Andrey Vesnovaty <andreyv@nvidia.com>\n---\n lib/librte_sft/Makefile            |  28 +\n lib/librte_sft/meson.build         |   7 +\n lib/librte_sft/rte_sft.c           |   9 +\n lib/librte_sft/rte_sft.h           | 845 +++++++++++++++++++++++++++++\n lib/librte_sft/rte_sft_driver.h    | 195 +++++++\n lib/librte_sft/rte_sft_version.map |  21 +\n 6 files changed, 1105 insertions(+)\n create mode 100644 lib/librte_sft/Makefile\n create mode 100644 lib/librte_sft/meson.build\n create mode 100644 lib/librte_sft/rte_sft.c\n create mode 100644 lib/librte_sft/rte_sft.h\n create mode 100644 lib/librte_sft/rte_sft_driver.h\n create mode 100644 lib/librte_sft/rte_sft_version.map",
    "diff": "diff --git a/lib/librte_sft/Makefile b/lib/librte_sft/Makefile\nnew file mode 100644\nindex 0000000000..23c6eee849\n--- /dev/null\n+++ b/lib/librte_sft/Makefile\n@@ -0,0 +1,28 @@\n+# SPDX-License-Identifier: BSD-3-Clause\n+# Copyright 2020 Mellanox Technologies, Ltd\n+\n+include $(RTE_SDK)/mk/rte.vars.mk\n+\n+# library name\n+LIB = librte_sft.a\n+\n+# library version\n+LIBABIVER := 1\n+\n+# build flags\n+CFLAGS += -O3\n+CFLAGS += $(WERROR_FLAGS)\n+LDLIBS += -lrte_eal -lrte_mbuf\n+\n+# library source files\n+# all source are stored in SRCS-y\n+SRCS-$(CONFIG_RTE_LIBRTE_REGEXDEV) := rte_sft.c\n+\n+# export include files\n+SYMLINK-$(CONFIG_RTE_LIBRTE_REGEXDEV)-include += rte_sft.h\n+SYMLINK-$(CONFIG_RTE_LIBRTE_REGEXDEV)-include += rte_sft_driver.h\n+\n+# versioning export map\n+EXPORT_MAP := rte_sft_version.map\n+\n+include $(RTE_SDK)/mk/rte.lib.mk\ndiff --git a/lib/librte_sft/meson.build b/lib/librte_sft/meson.build\nnew file mode 100644\nindex 0000000000..b210e43f29\n--- /dev/null\n+++ b/lib/librte_sft/meson.build\n@@ -0,0 +1,7 @@\n+# SPDX-License-Identifier: BSD-3-Clause\n+# Copyright 2020 Mellanox Technologies, Ltd\n+\n+sources = files('rte_sft.c')\n+headers = files('rte_sft.h',\n+\t'rte_sft_driver.h')\n+deps += ['mbuf']\ndiff --git a/lib/librte_sft/rte_sft.c b/lib/librte_sft/rte_sft.c\nnew file mode 100644\nindex 0000000000..f3d3945545\n--- /dev/null\n+++ b/lib/librte_sft/rte_sft.c\n@@ -0,0 +1,9 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright 2020 Mellanox Technologies, Ltd\n+ */\n+\n+\n+#include \"rte_sft.h\"\n+#include \"rte_sft_driver.h\"\n+\n+/* Placeholder for RTE SFT library APIs implementation */\ndiff --git a/lib/librte_sft/rte_sft.h b/lib/librte_sft/rte_sft.h\nnew file mode 100644\nindex 0000000000..5c9f92ea9f\n--- /dev/null\n+++ b/lib/librte_sft/rte_sft.h\n@@ -0,0 +1,845 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright 2020 Mellanox Technologies, Ltd\n+ */\n+\n+#ifndef _RTE_SFT_H_\n+#define _RTE_SFT_H_\n+\n+/**\n+ * @file\n+ *\n+ * RTE SFT API\n+ *\n+ * Defines RTE SFT APIs for Statefull Flow Table library.\n+ *\n+ * SFT General description:\n+ * SFT library provides a framework for applications that need to maintain\n+ * context across different packets of the connection.\n+ * Examples for such applications:\n+ * - Next-generation firewalls\n+ * - Intrusion detection/prevention systems (IDS/IPS): Suricata, Snort\n+ * - SW/Virtual Switching: OVS\n+ * The goals of the SFT library:\n+ * - Accelerate flow recognition & its context retrieval for further lookaside\n+ *   processing.\n+ * - Enable context-aware flow handling offload.\n+ *\n+ * Definitions and Abbreviations:\n+ * - 5-tuple: defined by:\n+ *     -- Source IP address\n+ *     -- Source port\n+ *     -- Destination IP address\n+ *     -- Destination port\n+ *     -- IP protocol number\n+ * - 7-tuple: 5-tuple zone and port (see struct rte_sft_7tuple)\n+ * - 5/7-tuple: 5/7-tuple of the packet from connection initiator\n+ * - revers 5/7-tuple: 5/7-tuple of the packet from connection initiate\n+ * - application: SFT library API consumer\n+ * - APP: see application\n+ * - CID: client ID\n+ * - CT: connection tracking\n+ * - FID: Flow identifier\n+ * - FIF: First In Flow\n+ * - Flow: defined by 7-tuple and its reverse i.e. flow is bidirectional\n+ * - SFT: Stateful Flow Table\n+ * - user: see application\n+ * - zone: additional user defined value used as differentiator for\n+ *         connections having same 5-tuple (for example different VxLan\n+ *         connections with same inner 5-tuple).\n+ *\n+ * SFT components:\n+ *\n+ * +-----------------------------------+\n+ * | RTE flow                          |\n+ * |                                   |\n+ * | +-------------------------------+ |  +----------------+\n+ * | | group X                       | |  | RTE_SFT        |\n+ * | |                               | |  |                |\n+ * | | +---------------------------+ | |  |                |\n+ * | | | rule ...                  | | |  |                |\n+ * | | | .                         | | |  +-----------+----+\n+ * | | | .                         | | |              |\n+ * | | | .                         | | |          entry\n+ * | | +---------------------------+ | |            create\n+ * | | | rule                      | | |              |\n+ * | | |   patterns ...            +---------+        |\n+ * | | |   actions                 | | |     |        |\n+ * | | |     SFT (zone=Z)          | | |     |        |\n+ * | | |     JUMP (group=Y)        | | |  lookup      |\n+ * | | +---------------------------+ | |    zone=Z,   |\n+ * | | | rule ...                  | | |    5tuple    |\n+ * | | | .                         | | |     |        |\n+ * | | | .                         | | |  +--v-------------+\n+ * | | | .                         | | |  | SFT       |    |\n+ * | | |                           | | |  |           |    |\n+ * | | +---------------------------+ | |  |        +--v--+ |\n+ * | |                               | |  |        |     | |\n+ * | +-------------------------------+ |  |        | PMD | |\n+ * |                                   |  |        |     | |\n+ * |                                   |  |        +-----+ |\n+ * | +-------------------------------+ |  |                |\n+ * | | group Y                       | |  |                |\n+ * | |                               | |  | set flow CTX   |\n+ * | | +---------------------------+ | |  |                |\n+ * | | | rule                      | | |  +--------+-------+\n+ * | | |   patterns                | | |           |\n+ * | | |     SFT (state=UNDEFINED) | | |           |\n+ * | | |   actions RSS             | | |           |\n+ * | | +---------------------------+ | |           |\n+ * | | | rule                      | | |           |\n+ * | | |   patterns                | | |           |\n+ * | | |     SFT (state=INVALID)   | <-------------+\n+ * | | |   actions DROP            | | |  forward\n+ * | | +---------------------------+ | |    group=Y\n+ * | | | rule                      | | |\n+ * | | |   patterns                | | |\n+ * | | |     SFT (state=ACCEPTED)  | | |\n+ * | | |   actions PORT            | | |\n+ * | | +---------------------------+ | |\n+ * | |  ...                          | |\n+ * | |                               | |\n+ * | +-------------------------------+ |\n+ * |  ...                              |\n+ * |                                   |\n+ * +-----------------------------------+\n+ *\n+ * SFT as datastructure:\n+ * SFT can be treated as datastructure maintaining flow context across its\n+ * lifetime. SFT flow entry represent bidirectional network flow and defined by\n+ * 7-tuple & its reverse 7-tuple.\n+ * Each entry in SFT has:\n+ * - FID: 1:1 mapped & used as entry handle & encapsulating internal\n+ *   implementation of the entry.\n+ * - State: user-defined value attached to each entry, the only library\n+ *   reserved value for state unset (the actual value defined by SFT\n+ *   configuration). The application should define flow state encodings and\n+ *   set it for flow via rte_sft_flow_set_ctx() than what actions should be\n+ *   applied on packets can be defined via related RTE flow rule matching SFT\n+ *   state (see rules in SFT components diagram above).\n+ * - Timestamp: for the last seen in flow packet used for flow aging mechanism\n+ *   implementation.\n+ * - Client Objects: user-defined flow contexts attached as opaques to flow.\n+ * - Acceleration & offloading - utilize RTE flow capabilities, when supported\n+ *   (see action ``SFT``), for flow lookup acceleration and further\n+ *   context-aware flow handling offload.\n+ * - CT state: optionally for TCP connections CT state can be maintained\n+ *   (see enum rte_sft_flow_ct_state).\n+ * - Out of order TCP packets: optionally SFT can keep out of order TCP\n+ *   packets aside the flow context till the arrival of the missing in-order\n+ *   packet.\n+ *\n+ * RTE flow changes:\n+ * The SFT flow state (or context) for RTE flow is defined by fields of\n+ * struct rte_flow_item_sft.\n+ * To utilize SFT capabilities new item and action types introduced:\n+ * - item SFT: matching on SFT flow state (see RTE_FLOW_ITEM_TYPE_SFT).\n+ * - action SFT: retrieve SFT flow context and attache it to the processed\n+ *   packet (see RTE_FLOW_ACTION_TYPE_SFT).\n+ *\n+ * The contents of per port SFT serving RTE flow action ``SFT`` managed via\n+ * SFT PMD APIs (see struct rte_sft_ops).\n+ * The SFT flow state/context retrieval performed by user-defined zone ``SFT``\n+ * action argument and processed packet 5-tuple.\n+ * If in scope of action ``SFT`` there is no context/state for the flow in SFT\n+ * undefined sate attached to the packet meaning that the flow is not\n+ * recognized by SFT, most probably FIF packet.\n+ *\n+ * Once the SFT state set for a packet it can match on item SFT\n+ * (see RTE_FLOW_ITEM_TYPE_SFT) and forwarding design can be done for the\n+ * packet, for example:\n+ * - if state value == x than queue for further processing by the application\n+ * - if state value == y than forward it to eth port (full offload)\n+ * - if state value == 'undefined' than queue for further processing by\n+ *   the application (handle FIF packets)\n+ *\n+ * Processing packets with SFT library:\n+ *\n+ * FIF packet:\n+ * To recognize upcoming packets of the SFT flow every FIF packet should be\n+ * forwarded to the application utilizing the SFT library. Non-FIF packets can\n+ * be processed by the application or its processing can be fully offloaded.\n+ * Processing of the packets in SFT library starts with rte_sft_process_mbuf\n+ * or rte_sft_process_mbuf_with_zone. If mbuf recognized as FIF application\n+ * should make a design to destroy flow or complete flow creation process in\n+ * SFT using rte_sft_flow_activate.\n+ *\n+ * Recognized SFT flow:\n+ * Once struct rte_sft_flow_status with valid fid field posesed by application\n+ * it can:\n+ * - mange client objects on it (see client_obj field in\n+ *   struct rte_sft_flow_status) using rte_sft_flow_<OP>_client_obj APIs\n+ * - analyze user-defined flow state and CT state (see state & ct_sate fields\n+ *   in struct rte_sft_flow_status).\n+ * - set flow state to be attached to the upcoming packets by action ``SFT``\n+ *   via struct rte_sft_flow_status API.\n+ * - decide to destroy flow via rte_sft_flow_destroy API.\n+ *\n+ * Flow aging:\n+ *\n+ * SFT library manages the aging for each flow. On flow creation, it's\n+ * assigned an aging value, the maximal number of seconds passed since the\n+ * last flow packet arrived, once exceeded flow considered aged.\n+ * The application notified of aged flow asynchronously via event queues.\n+ * The device and port IDs tuple to identify the event queue to enqueue\n+ * flow aged events passed on flow creation as arguments\n+ * (see rte_sft_flow_activate). It's the application responsibility to\n+ * initialize event queues and assign them to each flow for EOF event\n+ * notifications.\n+ * Aged EOF event handling:\n+ * - Should be considered as application responsibility.\n+ * - The last stage should be the release of the flow resources via\n+ *    rte_sft_flow_destroy API.\n+ * - All client objects should be removed from flow before the\n+ *   rte_sft_flow_destroy API call.\n+ * See the description of rete_sft_flow_destroy for an example of aged flow\n+ * handling.\n+ *\n+ * SFT API thread safety:\n+ *\n+ * SFT library APIs are thread-safe while handling of specific flow can be\n+ * done in a single thread simultaneously. Exclusive access to specific SFT\n+ * flow guaranteed by:\n+ * - rte_sft_process_mbuf\n+ * - rte_sft_process_mbuf_with_zone\n+ * - rte_sft_flow_create\n+ * - rte_sft_flow_lock\n+ * When application is done with the flow handling for the current packet it\n+ * should call rte_sft_flow_unlock API to maintain exclusive access to the\n+ * flow with other threads.\n+ *\n+ * SFT Library initialization and cleanup:\n+ *\n+ * SFT library should be considered as a single instance, preconfigured and\n+ * initialized via rte_sft_init() API.\n+ * SFT library resource deallocation and cleanup should be done via\n+ * rte_sft_init() API as a stage of the application termination procedure.\n+ */\n+\n+#ifdef __cplusplus\n+extern \"C\" {\n+#endif\n+\n+#include <rte_common.h>\n+#include <rte_config.h>\n+#include <rte_errno.h>\n+#include <rte_mbuf.h>\n+#include <rte_ethdev.h>\n+#include <rte_flow.h>\n+\n+/**\n+ * L3/L4 5-tuple - src/dest IP and port and IP protocol.\n+ *\n+ * Used for flow/connection identification.\n+ */\n+struct rte_sft_5tuple {\n+\tunion {\n+\t\tstruct {\n+\t\t\trte_be32_t src_addr; /**< IPv4 source address. */\n+\t\t\trte_be32_t dst_addr; /**< IPv4 destination address. */\n+\t\t} ipv4;\n+\t\tstruct {\n+\t\t\tuint8_t src_addr[16]; /**< IPv6 source address. */\n+\t\t\tuint8_t dst_addr[16]; /**< IPv6 destination address. */\n+\t\t} ipv6;\n+\t};\n+\tuint16_t src_port; /**< Source port. */\n+\tuint16_t dst_port; /**< Destination port. */\n+\tuint8_t proto; /**< IP protocol. */\n+\tuint8_t is_ipv6: 1; /**< True for valid IPv6 fields. Otherwise IPv4. */\n+};\n+\n+/**\n+ * Port flow identification.\n+ *\n+ * @p zone used for setups where 5-tuple is not enough to identify flow.\n+ * For example different VLANs/VXLANs may have similar 5-tuples.\n+ */\n+struct rte_sft_7tuple {\n+\tstruct rte_sft_5tuple flow_5tuple; /**< L3/L4 5-tuple. */\n+\tuint32_t zone; /**< Zone assigned to flow. */\n+\tuint16_t port_id; /** <Port identifier of Ethernet device. */\n+};\n+\n+/**\n+ * Flow connection tracking states\n+ */\n+enum rte_sft_flow_ct_state {\n+\tRTE_SFT_FLOW_CT_STATE_NEW  = (1 << 0),\n+\tRTE_SFT_FLOW_CT_STATE_EST  = (1 << 1),\n+\tRTE_SFT_FLOW_CT_STATE_REL  = (1 << 2),\n+\tRTE_SFT_FLOW_CT_STATE_RPL  = (1 << 3),\n+\tRTE_SFT_FLOW_CT_STATE_INV  = (1 << 4),\n+\tRTE_SFT_FLOW_CT_STATE_TRK  = (1 << 5),\n+\tRTE_SFT_FLOW_CT_STATE_SNAT = (1 << 6),\n+\tRTE_SFT_FLOW_CT_STATE_DNAT = (1 << 7),\n+};\n+\n+/**\n+ * Structure describes SFT library configuration\n+ */\n+struct rte_sft_conf {\n+\tuint32_t UDP_aging; /**< UDP proto default aging. */\n+\tuint32_t TCP_aging; /**< TCP proto default aging. */\n+\tuint32_t TCP_SYN_aging; /**< TCP SYN default aging. */\n+\tuint32_t OTHER_aging; /**< All unlisted proto default aging. */\n+\tuint32_t size; /**< Max entries in SFT. */\n+\tuint8_t undefined_state; /**< Undefined state constant. */\n+\tuint8_t reorder_enable: 1;\n+\t/**< TCP packet reordering feature enabled bit. */\n+\tuint8_t ct_enable: 1; /**< Connection tracking feature enabled bit. */\n+};\n+\n+/**\n+ * Structure describes the state of the flow in SFT.\n+ */\n+struct rte_sft_flow_status {\n+\tuint32_t fid; /**< SFT flow id. */\n+\tuint32_t zone; /**< Zone for lookup in SFT */\n+\tuint8_t state; /**< Application defined bidirectional flow state. */\n+\tuint8_t ct_state; /**< Connection tracking flow state. */\n+\tuint32_t age; /**< Seconds passed since last flown packet. */\n+\tuint32_t aging;\n+\t/**< Flow considered aged once this age (seconds) reached. */\n+\tuint32_t nb_in_order_mbufs;\n+\t/**< Number of in-order mbufs available for drain */\n+\tvoid **client_obj; /**< Array of clients attached to flow. */\n+\tint nb_clients; /**< Number of clients attached to flow. */\n+\tuint8_t defined: 1; /**< Flow defined in SFT bit. */\n+\tuint8_t activated: 1; /**< Flow activation bit. */\n+\tuint8_t fragmented: 1; /**< Last flow mbuf was fragmented. */\n+\tuint8_t out_of_order: 1; /**< Last flow mbuf was out of order (TCP). */\n+};\n+\n+/**\n+ * @warning\n+ * @b EXPERIMENTAL: this API may change without prior notice.\n+ *\n+ * Get SFT flow status.\n+ * Flow should be locked by caller (see rte_sft_flow_lock).\n+ *\n+ * Flow should be locked by caller (see rte_sft_flow_lock).\n+ *\n+ * @param fid\n+ *   SFT flow ID.\n+ * @param[out] status\n+ *   Structure to dump actual SFT flow status.\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_sft_flow_get_status(const uint32_t fid,\n+\t\t\tstruct rte_sft_flow_status *status,\n+\t\t\tstruct rte_sft_error *error);\n+\n+/**\n+ * @warning\n+ * @b EXPERIMENTAL: this API may change without prior notice.\n+ *\n+ * Set user defined context.\n+ * Flow should be locked by caller (see rte_sft_flow_lock).\n+ *\n+ * Updates per ethernet dev SFT entries:\n+ * - flow lookup acceleration\n+ * - partial/full flow offloading managed by flow context\n+ * Flow should be locked by caller (see rte_sft_flow_lock).\n+ *\n+ * @param fid\n+ *   SFT flow ID.\n+ * @param ctx\n+ *   User defined state to set.\n+ *   Update of *fid* or *zone* fields in struct rte_flow_item_sft unsupported.\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_sft_flow_set_ctx(uint32_t fid,\n+\t\t     const struct rte_flow_item_sft *ctx,\n+\t\t     struct rte_sft_error *error);\n+\n+/**\n+ * @warning\n+ * @b EXPERIMENTAL: this API may change without prior notice.\n+ *\n+ * Initialize SFT library instance.\n+ *\n+ * @param conf\n+ *   SFT library instance configuration.\n+ *\n+ * @return\n+ *   0 on success , a negative errno value otherwise and rte_errno is set.\n+ */\n+int\n+rte_sft_init(const struct rte_sft_conf *conf);\n+\n+/**\n+ * @warning\n+ * @b EXPERIMENTAL: this API may change without prior notice.\n+ *\n+ * Finalize SFT library instance.\n+ * Cleanup & release allocated resources.\n+ */\n+void\n+rte_sft_fini(void);\n+\n+/**\n+ * @warning\n+ * @b EXPERIMENTAL: this API may change without prior notice.\n+ *\n+ * Process mbuf received on RX queue.\n+ *\n+ * Fragmentation handling (SFT fragmentation feature configured):\n+ * If *mbuf_in* of fragmented packet received it will be stored by SFT library.\n+ * status->fragmented bit will be set and *mbuf_out* will be set to NULL.\n+ * On reception of all related fragments of IP packet it will be reassembled\n+ * and further processed by this function on reception of last fragment.\n+ *\n+ * Flow definition:\n+ * SFT flow defined by one of its 7-tuples, since there is no zone value as\n+ * argument flow should be defined by context attached to mbuf with action\n+ * ``SFT`` (see RTE flow RTE_FLOW_ACTION_TYPE_SFT). Otherwise status->defined\n+ * field will be turned off & *mbuf_out* will be set to *mbuf_in*.\n+ * In order to define flow for *mbuf_in* without attached sft context\n+ * rte_sft_process_mbuf_with_zone() should be used with *zone* argument\n+ * supplied by caller.\n+ *\n+ * Flow lookup:\n+ * If SFT flow identifier can't be retrieved from SFT context attached to\n+ * *mbuf_in* by action ``SFT`` - SFT lookup should be performmed by zone,\n+ * retrieved from SFT context attached to *mbuf_in*, and 5-tuple, extracted\n+ * form mbuf outer header contents.\n+ *\n+ * Flow defined but does not exists:\n+ * If flow not found in SFT inactivated flow will be created in SFT.\n+ * status->activated field will be turned off & *mbuf_out* be set to *mbuf_in*.\n+ * In order to activate created flow rte_sft_flow_activate() should be used\n+ * with reverse 7-tuple supplied by caller.\n+ * This is first phase of flow creation in SFT for second phase & more detailed\n+ * descriotion of flow creation see rte_sft_flow_activate.\n+ *\n+ * Out of order (SFT out of oreder feature configured):\n+ * If flow defined & activated but *mbuf_in* is TCP out of order packet it will\n+ * be stored by SFT library. status->out_of_order bit will be set & *mbuf_out*\n+ * will be set to NULL. On reception of the first missing in order packet\n+ * status->nb_in_order_mbufs will be set to number of mbufs that available for\n+ * processing with rte_sft_drain_mbuf().\n+ *\n+ * Flow defined & activated, mbuf not fragmented and 'in order':\n+ * - Flow aging related data (see age field in `struct rte_sft_flow_status`)\n+ *   will be updated according to *mbuf_in* timestamp.\n+ * - Flow connection tracking state (see ct_state field in\n+ *   `struct rte_sft_flow_status`)  will be updated according to *mbuf_in* L4\n+ *   header contents.\n+ * - *mbuf_out* will be set to last processed mbuf.\n+ *\n+ * @param[in] mbuf_in\n+ *   mbuf to process; mbuf pinter considered 'consumed' and should not be used\n+ *   after successful call to this function.\n+ * @param[out] mbuf_out\n+ *   last processed not fragmented and in order mbuf.\n+ * @param[out] status\n+ *   Structure to dump SFT flow status once updated according to contents of\n+ *   *mbuf_in*.\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:\n+ *   - *mbuf_out* contains valid mbuf pointer, locked SFT flow recognized by\n+ *     status->fid.\n+ *   - *mbuf_out* is NULL and status->fragmented bit on in case of\n+ *     non last fragment *mbuf_in*.\n+ *   - *mbuf_out* is NULL and status->out_of_order bit on in case of out of\n+ *     order *mbuf_in*, locked SFT flow recognized by status->fid.\n+ *   On failure a negative errno value and rte_errno is set.\n+ */\n+int\n+rte_sft_process_mbuf(struct rte_mbuf *mbuf_in,\n+\t\t     struct rte_mbuf **mbuf_out,\n+\t\t     struct rte_sft_flow_status *status,\n+\t\t     struct rte_sft_error *error);\n+\n+/**\n+ * @warning\n+ * @b EXPERIMENTAL: this API may change without prior notice.\n+ *\n+ * Process mbuf received on RX queue while zone value provided by caller.\n+ *\n+ * The behaviour of this function is similar to rte_sft_process_mbuf except\n+ * the lookup in SFT procedure. The lookup in SFT always done by the *zone*\n+ * arg and 5-tuple 5-tuple, extracted form mbuf outer header contents.\n+ *\n+ * @see rte_sft_process_mbuf\n+ *\n+ * @param[in] mbuf_in\n+ *   mbuf to process; mbuf pinter considered 'consumed' and should not be used\n+ *   after successful call to this function.\n+ * @param[out] mbuf_out\n+ *   last processed not fragmented and in order mbuf.\n+ * @param[out] status\n+ *   Structure to dump SFT flow status once updated according to contents of\n+ *   *mbuf_in*.\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:\n+ *   - *mbuf_out* contains valid mbuf pointer.\n+ *   - *mbuf_out* is NULL and status->fragmented bit on in case of\n+ *     non last fragment *mbuf_in*.\n+ *   - *mbuf_out* is NULL and status->out_of_order bit on in case of out of\n+ *     order *mbuf_in*.\n+ *   On failure a negative errno value and rte_errno is set.\n+ */\n+int\n+rte_sft_process_mbuf_with_zone(struct rte_mbuf *mbuf_in,\n+\t\t\t       uint32_t zone,\n+\t\t\t       struct rte_mbuf **mbuf_out,\n+\t\t\t       struct rte_sft_flow_status *status,\n+\t\t\t       struct rte_sft_error *error);\n+\n+/**\n+ * @warning\n+ * @b EXPERIMENTAL: this API may change without prior notice.\n+ *\n+ * Drain next in order mbuf.\n+ * Flow should be locked by caller (see rte_sft_flow_lock).\n+ *\n+ * This function behaves similar to rte_sft_process_mbuf() but acts on packets\n+ * accumulated in SFT flow due to missing in order packet. Processing done on\n+ * single mbuf at a time and `in order`. Other than above the behavior is\n+ * same as of rte_sft_process_mbuf for flow defined & activated & mbuf isn't\n+ * fragmented & 'in order'. This function should be called when\n+ * rte_sft_process_mbuf or rte_sft_process_mbuf_with_zone sets\n+ * status->nb_in_order_mbufs output param !=0 and until\n+ * status->nb_in_order_mbufs == 0.\n+ * Flow should be locked by caller (see rte_sft_flow_lock).\n+ *\n+ * @param fid\n+ *   SFT flow ID.\n+ * @param[out] status\n+ *   Structure to dump SFT flow status once updated according to contents of\n+ *   *mbuf_in*.\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 mbuf in case of success, NULL otherwise and rte_errno is set.\n+ */\n+struct rte_mbuf *\n+rte_sft_drain_mbuf(uint32_t fid,\n+\t\t   struct rte_sft_flow_status *status,\n+\t\t   struct rte_sft_error *error);\n+\n+/**\n+ * @warning\n+ * @b EXPERIMENTAL: this API may change without prior notice.\n+ *\n+ * Activate flow in SFT.\n+ * Flow should be locked by caller (see rte_sft_flow_lock).\n+ *\n+ * This function performs second phase of flow creation in SFT.\n+ * The reasons for 2 phase flow creation procedure:\n+ * 1. Missing reverse flow - flow context is shared for both flow directions\n+ *    i.e. in order maintain bidirectional flow context in RTE SFT packets\n+ *    arriving from both dirrections should be identified as packets of the\n+ *    RTE SFT flow. Consequently before creation of the SFT flow caller should\n+ *    provide reverse flow direction 7-tuple.\n+ * 2. The caller of rte_sft_process_mbuf/rte_sft_process_mbuf_with_zone should\n+ *   be notified that arrived mbuf is first in flow & decide weather to\n+ *   create new flow or it distroy before it was activated with\n+ *   rte_sft_flow_destroy.\n+ * This function completes creation of the bidirectional SFT flow & creates\n+ * entry for 7-tuple on SFT PMD defined by the tuple port for both\n+ * initiator/initiate 7-tuples.\n+ * Flow aging, connection tracking state & out of order handling will be\n+ * initialized according to the content of the *mbuf_in* passes to\n+ * rte_sft_process_mbuf/_with_zone during the phase 1 of flow creation.\n+ * Once this function returns upcoming calls rte_sft_process_mbuf/_with_zone\n+ * with 7-tuple or its reverse will return handle to this flow.\n+ * Flow should be locked by caller (see rte_sft_flow_lock).\n+ *\n+ * @param fid\n+ *   SFT flow ID.\n+ * @param reverse_tuple\n+ *   Expected response flow 7-tuple.\n+ * @param ctx\n+ *   User defined state to set.\n+ *   Update of *fid* or *zone* fields in struct rte_flow_item_sft unsupported.\n+ * @param ct_enable\n+ *   Enables maintenance of status->ct_state connection tracking value for the\n+ *   flow; otherwise status->ct_state will be initialized with zeros.\n+ * @param evdev_id\n+ *   Event dev ID to enqueue end of flow event.\n+ * @param evport_id\n+ *   Event port ID to enqueue end of flow event.\n+ * @param[out] status\n+ *   Structure to dump SFT flow status once activated.\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_sft_flow_activate(uint32_t fid,\n+\t\t      const struct rte_sft_7tuple *reverse_tuple,\n+\t\t      const struct rte_flow_item_sft *ctx,\n+\t\t      uint8_t ct_enable,\n+\t\t      uint8_t dev_id,\n+\t\t      uint8_t port_id,\n+\t\t      struct rte_sft_flow_status *status,\n+\t\t      struct rte_sft_error *error);\n+\n+/**\n+ * @warning\n+ * @b EXPERIMENTAL: this API may change without prior notice.\n+ *\n+ * Artificially create SFT flow.\n+ *\n+ * Function to create SFT flow before reception of the first flow packet.\n+ *\n+ * @param tuple\n+ *   Expected initiator flow 7-tuple.\n+ * @param reverse_tuple\n+ *   Expected initiate flow 7-tuple.\n+ * @param ctx\n+ *   User defined state to set.\n+ *   Setting of *fid* or *zone* fields in struct rte_flow_item_sft unsupported.\n+ * @param[out] ct_enable\n+ *   Enables maintenance of status->ct_state connection tracking value for the\n+ *   flow; otherwise status->ct_state will be initialized with zeros.\n+ * @param[out] status\n+ *   Structure to dump SFT flow status once created.\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+ *   - on success: 0, locked SFT flow recognized by status->fid.\n+ *   - on error: a negative errno value otherwise and rte_errno is set.\n+ */\n+\n+int\n+rte_sft_flow_create(const struct rte_sft_7tuple *tuple,\n+\t\t    const struct rte_sft_7tuple *reverse_tuple,\n+\t\t    const struct rte_flow_item_sft *ctx,\n+\t\t    uint8_t ct_enable,\n+\t\t    struct rte_sft_flow_status *status,\n+\t\t    struct rte_sft_error *error);\n+\n+/**\n+ * @warning\n+ * @b EXPERIMENTAL: this API may change without prior notice.\n+ *\n+ * Lock exclusively SFT flow.\n+ *\n+ * Explicit flow locking; used for handling aged flows.\n+ *\n+ * @param fid\n+ *   SFT flow ID.\n+ *\n+ * @return\n+ *   0 on success, a negative errno value otherwise and rte_errno is set.\n+ */\n+int\n+rte_sft_flow_lock(uint32_t fid);\n+\n+/**\n+ * @warning\n+ * @b EXPERIMENTAL: this API may change without prior notice.\n+ *\n+ * Release exclusively locked SFT flow.\n+ *\n+ * When rte_sft_process_mbuf/_with_zone and rte_sft_flow_create\n+ * return *status* containing fid with defined bit on the flow considered\n+ * exclusively locked and should be unlocked with this function.\n+ *\n+ * @param fid\n+ *   SFT flow ID.\n+ *\n+ * @return\n+ *   0 on success, a negative errno value otherwise and rte_errno is set.\n+ */\n+int\n+rte_sft_flow_unlock(uint32_t fid);\n+\n+/**\n+ * @warning\n+ * @b EXPERIMENTAL: this API may change without prior notice.\n+ *\n+ * Removes flow from SFT.\n+ * Flow should be locked by caller (see rte_sft_flow_lock).\n+ *\n+ * - Flow should be locked by caller in order to remove it.\n+ * - Flow should have no client objects attached.\n+ *\n+ * Should be applied on aged flows, when flow aged event received.\n+ *\n+ * @code{.c}\n+ *     while (1) {\n+ *         rte_event_dequeue_burst(...);\n+ *         FOR_EACH_EV(ev) {\n+ *             uint32_t fid = ev.u64;\n+ *             rte_sft_flow_lock(fid);\n+ *             FOR_EACH_CLIENT(fid, client_id) {\n+ *                 rte_sft_flow_reset_client_obj(fid, client_obj);\n+ *                 // detached client object handling\n+ *             }\n+ *             rte_sft_flow_destroy(fid, &error);\n+ *         }\n+ *     }\n+ * @endcode\n+ *\n+ * @param fid\n+ *   SFT flow ID 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_sft_flow_destroy(uint32_t fid, struct rte_sft_error *error);\n+\n+/**\n+ * @warning\n+ * @b EXPERIMENTAL: this API may change without prior notice.\n+ *\n+ * Reset flow age to zero.\n+ * Flow should be locked by caller (see rte_sft_flow_lock).\n+ *\n+ * Simulates last flow packet with timestamp set to just now.\n+ *\n+ * @param fid\n+ *   SFT flow ID.\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_sft_flow_touch(uint32_t fid, struct rte_sft_error *error);\n+\n+/**\n+ * @warning\n+ * @b EXPERIMENTAL: this API may change without prior notice.\n+ *\n+ * Set flow aging to specific value.\n+ * Flow should be locked by caller (see rte_sft_flow_lock).\n+ *\n+ * @param fid\n+ *   SFT flow ID.\n+ * @param aging\n+ *   New flow aging value.\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_sft_flow_set_aging(uint32_t fid,\n+\t\t       uint32_t aging,\n+\t\t       struct rte_sft_error *error);\n+\n+/**\n+ * @warning\n+ * @b EXPERIMENTAL: this API may change without prior notice.\n+ *\n+ * Set client object for given client ID.\n+ * Flow should be locked by caller (see rte_sft_flow_lock).\n+ *\n+ * @param fid\n+ *   SFT flow ID.\n+ * @param client_id\n+ *   Client ID to set object for.\n+ * @param client_obj\n+ *   Pointer to opaque client object structure.\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_sft_flow_set_client_obj(uint32_t fid,\n+\t\t\t    uint8_t client_id,\n+\t\t\t    void *client_obj,\n+\t\t\t    struct rte_sft_error *error);\n+\n+/**\n+ * @warning\n+ * @b EXPERIMENTAL: this API may change without prior notice.\n+ *\n+ * Get client object for given client ID.\n+ * Flow should be locked by caller (see rte_sft_flow_lock).\n+ *\n+ * @param fid\n+ *   SFT flow ID.\n+ * @param client_id\n+ *   Client ID to get object for.\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 client object opaque pointer in case of success, NULL otherwise\n+ *   and rte_errno is set.\n+ */\n+void *\n+rte_sft_flow_get_client_obj(const uint32_t fid,\n+\t\t\t    uint8_t client_id,\n+\t\t\t    struct rte_sft_error *error);\n+\n+/**\n+ * @warning\n+ * @b EXPERIMENTAL: this API may change without prior notice.\n+ *\n+ * Remove client object for given client ID.\n+ * Flow should be locked by caller (see rte_sft_flow_lock).\n+ *\n+ * Detaches client object from SFT flow and returns the ownership for the\n+ * client object to the caller by returning client object pointer value.\n+ * The pointer returned by this function won't be accessed any more, the caller\n+ * may release all client obj related resources & the memory allocated for\n+ * this client object.\n+ *\n+ * @param fid\n+ *   SFT flow ID.\n+ * @param client_id\n+ *   Client ID to remove object for.\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 client object opaque pointer in case of success, NULL otherwise\n+ *   and rte_errno is set.\n+ */\n+void *\n+rte_sft_flow_reset_client_obj(uint32_t fid,\n+\t\t\t      uint8_t client_id,\n+\t\t\t      struct rte_sft_error *error);\n+\n+#ifdef __cplusplus\n+}\n+#endif\n+\n+#endif /* _RTE_SFT_H_ */\ndiff --git a/lib/librte_sft/rte_sft_driver.h b/lib/librte_sft/rte_sft_driver.h\nnew file mode 100644\nindex 0000000000..0c9e28fe17\n--- /dev/null\n+++ b/lib/librte_sft/rte_sft_driver.h\n@@ -0,0 +1,195 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright 2020 Mellanox Technologies, Ltd\n+ */\n+\n+#ifndef _RTE_SFT_DRIVER_H_\n+#define _RTE_SFT_DRIVER_H_\n+\n+/**\n+ * @file\n+ *\n+ * RTE SFT Ethernet device PMD API\n+ *\n+ * APIs that are used by the SFT library to offload SFT operationons\n+ * to Ethernet device.\n+ */\n+\n+#include \"rte_sft.h\"\n+\n+#ifdef __cplusplus\n+extern \"C\" {\n+#endif\n+\n+/**\n+ * Opaque type returned after successfully creating an entry in SFT.\n+ *\n+ * This handle can be used to manage and query the related entry (e.g. to\n+ * destroy it or update age).\n+ */\n+struct rte_sft_entry;\n+\n+/**\n+ * Create SFT entry in eth_dev SFT.\n+ *\n+ * @param dev\n+ *   Pointer to Ethernet device structure.\n+ * @param tuple\n+ *   L3/L4 5-tuple - src/dest IP and port and IP protocol.\n+ * @param nat_tuple\n+ *   L3/L4 5-tuple to replace in packet original 5-tuple in order to implement\n+ *   NAT offloading; if NULL NAT offloading won't be configured for the flow.\n+ * @param aging\n+ *   Flow aging timeout in seconds.\n+ * @param ctx\n+ *   Initial values in SFT flow context\n+ *   (see RTE flow struct rte_flow_item_sft).\n+ *   ctx->zone should be valid.\n+ * @param fid\n+ *   SFT flow ID for the entry to create on *device*.\n+ *   If there is an entry for the *fid* in PMD it will be updated with the\n+ *   values of *ctx*.\n+ * @param[out] queue_index\n+ *   if PMD can figure out the queue where the flow packets will\n+ *   arrive in RX data path it will set the value of queue_index; otherwise\n+ *   all bits will be turned on.\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+ */\n+typedef struct rte_sft_entry *(*sft_entry_create_t) (struct rte_eth_dev *dev,\n+\t\tconst struct rte_sft_5tuple *tuple,\n+\t\tconst struct rte_sft_5tuple *nat_tuple,\n+\t\tconst uint32_t aging,\n+\t\tconst struct rte_flow_item_sft *ctx,\n+\t\tconst uint32_t fid,\n+\t\tuint16_t *queue_index,\n+\t\tstruct rte_sft_error *error);\n+\n+/**\n+ * Destroy SFT entry in eth_dev SFT.\n+ *\n+ * @param dev\n+ *   Pointer to Ethernet device structure.\n+ * @param entry\n+ *   Handle to the SFT entry 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+typedef int (*sft_entry_destroy_t)(struct rte_eth_dev *dev,\n+\t\tstruct rte_sft_entry *entry,\n+\t\tstruct rte_sft_error *error);\n+\n+/**\n+ * Decodes SFT flow context if attached to mbuf by action ``SFT``.\n+ * @see RTE flow RTE_FLOW_ACTION_TYPE_SFT.\n+ *\n+ * @param dev\n+ *   Pointer to Ethernet device structure.\n+ * @param mbuf\n+ *   mbuf of the packet to decode attached state from.\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 SFT flow context in case of success, NULL otherwise and rte_errno\n+ *   is set.\n+ */\n+typedef struct rte_flow_item_sft *(*sft_entry_mbuf_decode_ctx_t)(\n+\t\tstruct rte_eth_dev *dev,\n+\t\tconst struct rte_mbuf *mbuf,\n+\t\tstruct rte_sft_error *error);\n+\n+/**\n+ * Get aged-out SFT entries.\n+ *\n+ * Report entry as aged-out if timeout passed without any matching\n+ * on the SFT entry.\n+ *\n+ * @param[in] dev\n+ *   Pointer to Ethernet device structure.\n+ * @param[in, out] fid_aged\n+ *   The address of an array of aged-out SFT flow IDs.\n+ * @param[in] nb_aged\n+ *   The length of *fid_aged* array pointers.\n+ * @param[out] error\n+ *   Perform verbose error reporting if not NULL. Initialized in case of\n+ *   error only.\n+ *\n+ * @return\n+ *   if nb_aged is 0, return the amount of all aged flows.\n+ *   if nb_aged is not 0 , return the amount of aged flows reported\n+ *   in the *fid_aged* array, otherwise negative errno value.\n+ */\n+typedef int (*sft_entry_get_aged_entries_t)(struct rte_eth_dev *dev,\n+\t\tuint32_t *fid_aged,\n+\t\tint nb_aged,\n+\t\tstruct rte_sft_error *error);\n+\n+/**\n+ * Simulate SFT entry match in terms of entry aging.\n+ *\n+ * @param dev\n+ *   Pointer to Ethernet device structure.\n+ * @param fid\n+ *   SFT flow ID paired with dev to retrieve related SFT entry.\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+typedef int (*sft_entry_touch_t)(struct rte_eth_dev *dev,\n+\t\tuint32_t fid,\n+\t\tstruct rte_sft_error *error);\n+\n+/**\n+ * Set SFT entry aging to specific value.\n+ *\n+ * @param dev\n+ *   Pointer to Ethernet device structure.\n+ * @param fid\n+ *   SFT flow ID paired with dev to retrieve related SFT entry.\n+ * @param aging\n+ *   New entry aging value.\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+typedef int (*sft_entry_set_aging_t)(struct rte_eth_dev *dev,\n+\t\tuint32_t fid,\n+\t\tuint32_t aging,\n+\t\tstruct rte_sft_error *error);\n+\n+/** SFT operations function pointer table */\n+struct rte_sft_ops {\n+\tsft_entry_create_t entry_create;\n+\t/**< Create SFT entry in eth_dev SFT. */\n+\tsft_entry_destroy_t entry_destroy;\n+\t/**< Destroy SFT entry in eth_dev SFT. */\n+\tsft_entry_mbuf_decode_ctx_t mbuf_decode_ctx;\n+\t/**< Decodes SFT flow context if attached to mbuf by action ``SFT``. */\n+\tsft_entry_get_aged_entries_t get_aged_entries;\n+\t/**< Get aged-out SFT entries. */\n+\tsft_entry_touch_t entry_touch;\n+\t/**< Simulate SFT entry match in terms of entry aging. */\n+\tsft_entry_set_aging_t set_aging;\n+\t/**< Set SFT entry aging to specific value. */\n+};\n+\n+#ifdef __cplusplus\n+}\n+#endif\n+\n+#endif /* _RTE_SFT_DRIVER_H_ */\ndiff --git a/lib/librte_sft/rte_sft_version.map b/lib/librte_sft/rte_sft_version.map\nnew file mode 100644\nindex 0000000000..747e100ac5\n--- /dev/null\n+++ b/lib/librte_sft/rte_sft_version.map\n@@ -0,0 +1,21 @@\n+EXPERIMENTAL {\n+\tglobal:\n+\n+\trte_sft_flow_get_status;\n+\trte_sft_flow_set_ctx;\n+\trte_sft_init;\n+\trte_sft_fini;\n+\trte_sft_process_mbuf;\n+\trte_sft_process_mbuf_with_zone;\n+\trte_sft_drain_mbuf;\n+\trte_sft_flow_activate;\n+\trte_sft_flow_create;\n+\trte_sft_flow_lock;\n+\trte_sft_flow_unlock;\n+\trte_sft_flow_destroy;\n+\trte_sft_flow_touch;\n+\trte_sft_flow_set_aging;\n+\trte_sft_flow_set_client_obj;\n+\trte_sft_flow_get_client_obj;\n+\trte_sft_flow_reset_client_obj;\n+};\n",
    "prefixes": [
        "RFC",
        "3/3"
    ]
}