get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 91026,
    "url": "https://patches.dpdk.org/api/patches/91026/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1618062393-205611-1-git-send-email-bingz@nvidia.com/",
    "project": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<1618062393-205611-1-git-send-email-bingz@nvidia.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1618062393-205611-1-git-send-email-bingz@nvidia.com",
    "date": "2021-04-10T13:46:33",
    "name": "ethdev: introduce conntrack flow action and item",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "d5446b13d935214bb010caf80e140e547dbaa5d1",
    "submitter": {
        "id": 1976,
        "url": "https://patches.dpdk.org/api/people/1976/?format=api",
        "name": "Bing Zhao",
        "email": "bingz@nvidia.com"
    },
    "delegate": {
        "id": 319,
        "url": "https://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1618062393-205611-1-git-send-email-bingz@nvidia.com/mbox/",
    "series": [
        {
            "id": 16265,
            "url": "https://patches.dpdk.org/api/series/16265/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=16265",
            "date": "2021-04-10T13:46:33",
            "name": "ethdev: introduce conntrack flow action and item",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/16265/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/91026/comments/",
    "check": "warning",
    "checks": "https://patches.dpdk.org/api/patches/91026/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 mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id C9EEDA0546;\n\tSat, 10 Apr 2021 15:46:45 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 5D9051411D7;\n\tSat, 10 Apr 2021 15:46:45 +0200 (CEST)",
            "from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129])\n by mails.dpdk.org (Postfix) with ESMTP id C538A140FA2\n for <dev@dpdk.org>; Sat, 10 Apr 2021 15:46:43 +0200 (CEST)",
            "from Internal Mail-Server by MTLPINE1 (envelope-from\n bingz@nvidia.com) with SMTP; 10 Apr 2021 16:46:42 +0300",
            "from nvidia.com (mtbc-r640-01.mtbc.labs.mlnx [10.75.70.6])\n by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 13ADkeCM003861;\n Sat, 10 Apr 2021 16:46:41 +0300"
        ],
        "From": "Bing Zhao <bingz@nvidia.com>",
        "To": "orika@nvidia.com, thomas@monjalon.net, ferruh.yigit@intel.com,\n andrew.rybchenko@oktetlabs.ru",
        "Cc": "dev@dpdk.org, ajit.khaparde@broadcom.com",
        "Date": "Sat, 10 Apr 2021 21:46:33 +0800",
        "Message-Id": "<1618062393-205611-1-git-send-email-bingz@nvidia.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "In-Reply-To": "<1616052616-344969-1-git-send-email-bingz@nvidia.com>",
        "References": "<1616052616-344969-1-git-send-email-bingz@nvidia.com>",
        "Subject": "[dpdk-dev] [PATCH] ethdev: introduce conntrack flow action and item",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "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": "This commit introduced the conntrack action and item.\n\nUsually the HW offloading is stateless. For some stateful offloading\nlike a TCP connection, HW module will help provide the ability of a\nfull offloading w/o SW participation after the connection was\nestablished.\n\nThe basic usage is that in the first flow the application should add\nthe conntrack action and in the following flow(s) the application\nshould use the conntrack item to match on the result.\n\nA TCP connection has two directions traffic. To set a conntrack\naction context correctly, information from packets of both directions\nare required.\n\nThe conntrack action should be created on one port and supply the\npeer port as a parameter to the action. After context creating, it\ncould only be used between the ports (dual-port mode) or a single\nport. The application should modify the action via the API\n\"action_handle_update\" only when before using it to create a flow\nwith opposite direction. This will help the driver to recognize the\ndirection of the flow to be created, especially in single port mode.\nThe traffic from both directions will go through the same port if\nthe application works as an \"forwarding engine\" but not a end point.\nThere is no need to call the update interface if the subsequent flows\nhave nothing to be changed.\n\nQuery will be supported via action_ctx_query interface, about the\ncurrent packets information and connection status. Tha fields\nquery capabilities depends on the HW.\n\nFor the packets received during the conntrack setup, it is suggested\nto re-inject the packets in order to take full advantage of the\nconntrack. Only the valid packets should pass the conntrack, packets\nwith invalid TCP information, like out of window, or with invalid\nheader, like malformed, should not pass.\n\nNaming and definition:\nhttps://elixir.bootlin.com/linux/latest/source/include/uapi/linux/netfilter/nf_conntrack_tcp.h\nhttps://elixir.bootlin.com/linux/latest/source/net/netfilter/nf_conntrack_proto_tcp.c\n\nOther reference:\nhttps://www.usenix.org/legacy/events/sec01/invitedtalks/rooij.pdf\n\nSigned-off-by: Bing Zhao <bingz@nvidia.com>\n---\n lib/librte_ethdev/rte_flow.h | 195 +++++++++++++++++++++++++++++++++++\n 1 file changed, 195 insertions(+)",
    "diff": "diff --git a/lib/librte_ethdev/rte_flow.h b/lib/librte_ethdev/rte_flow.h\nindex 6cc57136ac..d506377f7e 100644\n--- a/lib/librte_ethdev/rte_flow.h\n+++ b/lib/librte_ethdev/rte_flow.h\n@@ -551,6 +551,15 @@ enum rte_flow_item_type {\n \t * See struct rte_flow_item_geneve_opt\n \t */\n \tRTE_FLOW_ITEM_TYPE_GENEVE_OPT,\n+\n+\t/**\n+\t * [META]\n+\t *\n+\t * Matches conntrack state.\n+\t *\n+\t * See struct rte_flow_item_conntrack.\n+\t */\n+\tRTE_FLOW_ITEM_TYPE_CONNTRACK,\n };\n \n /**\n@@ -1685,6 +1694,51 @@ rte_flow_item_geneve_opt_mask = {\n };\n #endif\n \n+/**\n+ * The packet is with valid state after conntrack checking.\n+ */\n+#define RTE_FLOW_CONNTRACK_FLAG_PKT_STATE_VALID (1 << 0)\n+/**\n+ * The state of the connection was changed.\n+ */\n+#define RTE_FLOW_CONNTRACK_FLAG_PKT_STATE_CHANGED (1 << 1)\n+/**\n+ * Error is detected on this packet for this connection and\n+ * an invalid state is set.\n+ */\n+#define RTE_FLOW_CONNTRACK_FLAG_PKT_STATE_INVAL (1 << 2)\n+/**\n+ * The HW connection tracking module is disabled.\n+ * It can be due to application command or an invalid state.\n+ */\n+#define RTE_FLOW_CONNTRACK_FLAG_HW_DISABLED (1 << 3)\n+/**\n+ * The packet contains some bad field(s) and cannot continue\n+ * with the conntrack module checking.\n+ */\n+#define RTE_FLOW_CONNTRACK_FLAG_PKT_BAD (1 << 4)\n+\n+/**\n+ * @warning\n+ * @b EXPERIMENTAL: this structure may change without prior notice\n+ *\n+ * RTE_FLOW_ITEM_TYPE_CONNTRACK\n+ *\n+ * Matches the state of a packet after it passed the connection tracking\n+ * examination. The state is a bit mask of one RTE_FLOW_CONNTRACK_FLAG*\n+ * or a reasonable combination of these bits.\n+ */\n+struct rte_flow_item_conntrack {\n+\tuint32_t flags;\n+};\n+\n+/** Default mask for RTE_FLOW_ITEM_TYPE_CONNTRACK. */\n+#ifndef __cplusplus\n+static const struct rte_flow_item_conntrack rte_flow_item_conntrack_mask = {\n+\t.flags = 0xffffffff,\n+};\n+#endif\n+\n /**\n  * Matching pattern item definition.\n  *\n@@ -2267,6 +2321,17 @@ enum rte_flow_action_type {\n \t * See struct rte_flow_action_modify_field.\n \t */\n \tRTE_FLOW_ACTION_TYPE_MODIFY_FIELD,\n+\n+\t/**\n+\t * [META]\n+\t *\n+\t * Enable tracking a TCP connection state.\n+\t *\n+\t * Send packet to HW connection tracking module for examination.\n+\t *\n+\t * See struct rte_flow_action_conntrack.\n+\t */\n+\tRTE_FLOW_ACTION_TYPE_CONNTRACK,\n };\n \n /**\n@@ -2859,6 +2924,136 @@ struct rte_flow_action_set_dscp {\n  */\n struct rte_flow_shared_action;\n \n+/**\n+ * The state of a TCP connection.\n+ */\n+enum rte_flow_conntrack_state {\n+\t/**< SYN-ACK packet was seen. */\n+\tRTE_FLOW_CONNTRACK_STATE_SYN_RECV,\n+\t/**< 3-way handshark was done. */\n+\tRTE_FLOW_CONNTRACK_STATE_ESTABLISHED,\n+\t/**< First FIN packet was received to close the connection. */\n+\tRTE_FLOW_CONNTRACK_STATE_FIN_WAIT,\n+\t/**< First FIN was ACKed. */\n+\tRTE_FLOW_CONNTRACK_STATE_CLOSE_WAIT,\n+\t/**< Second FIN was received, waiting for the last ACK. */\n+\tRTE_FLOW_CONNTRACK_STATE_LAST_ACK,\n+\t/**< Second FIN was ACKed, connection was closed. */\n+\tRTE_FLOW_CONNTRACK_STATE_TIME_WAIT,\n+};\n+\n+/**\n+ * The last passed TCP packet flags of a connection.\n+ */\n+enum rte_flow_conntrack_tcp_last_index {\n+\tRTE_FLOW_CONNTRACK_FLAG_NONE = 0, /**< No Flag. */\n+\tRTE_FLOW_CONNTRACK_FLAG_SYN = (1 << 0), /**< With SYN flag. */\n+\tRTE_FLOW_CONNTRACK_FLAG_SYNACK = (1 << 1), /**< With SYN+ACK flag. */\n+\tRTE_FLOW_CONNTRACK_FLAG_FIN = (1 << 2), /**< With FIN flag. */\n+\tRTE_FLOW_CONNTRACK_FLAG_ACK = (1 << 3), /**< With ACK flag. */\n+\tRTE_FLOW_CONNTRACK_FLAG_RST = (1 << 4), /**< With RST flag. */\n+};\n+\n+/**\n+ * @warning\n+ * @b EXPERIMENTAL: this structure may change without prior notice\n+ *\n+ * Configuration parameters for each direction of a TCP connection.\n+ */\n+struct rte_flow_tcp_dir_param {\n+\tuint32_t scale:4; /**< TCP window scaling factor, 0xF to disable. */\n+\tuint32_t close_initiated:1; /**< The FIN was sent by this direction. */\n+\t/**< An ACK packet has been received by this side. */\n+\tuint32_t last_ack_seen:1;\n+\t/**< If set, indicates that there is unacked data of the connection. */\n+\tuint32_t data_unacked:1;\n+\t/**< Maximal value of sequence + payload length over sent\n+\t * packets (next ACK from the opposite direction).\n+\t */\n+\tuint32_t sent_end;\n+\t/**< Maximal value of (ACK + window size) over received packet + length\n+\t * over sent packet (maximal sequence could be sent).\n+\t */\n+\tuint32_t reply_end;\n+\t/**< Maximal value of actual window size over sent packets. */\n+\tuint32_t max_win;\n+\t/**< Maximal value of ACK over sent packets. */\n+\tuint32_t max_ack;\n+};\n+\n+/**\n+ * @warning\n+ * @b EXPERIMENTAL: this structure may change without prior notice\n+ *\n+ * RTE_FLOW_ACTION_TYPE_CONNTRACK\n+ *\n+ * Configuration and initial state for the connection tracking module.\n+ * This structure could be used for both setting and query.\n+ */\n+struct rte_flow_action_conntrack {\n+\tuint16_t peer_port; /**< The peer port number, can be the same port. */\n+\t/**< Direction of this connection when creating a flow, the value only\n+\t * affects the subsequent flows creation.\n+\t */\n+\tuint32_t is_original_dir:1;\n+\t/**< Enable / disable the conntrack HW module. When disabled, the\n+\t * result will always be RTE_FLOW_CONNTRACK_FLAG_DISABLED.\n+\t * In this state the HW will act as passthrough.\n+\t * It only affects this conntrack object in the HW without any effect\n+\t * to the other objects.\n+\t */\n+\tuint32_t enable:1;\n+\t/**< At least one ack was seen, after the connection was established. */\n+\tuint32_t live_connection:1;\n+\t/**< Enable selective ACK on this connection. */\n+\tuint32_t selective_ack:1;\n+\t/**< A challenge ack has passed. */\n+\tuint32_t challenge_ack_passed:1;\n+\t/**< 1: The last packet is seen that comes from the original direction.\n+\t * 0: From the reply direction.\n+\t */\n+\tuint32_t last_direction:1;\n+\t/**< No TCP check will be done except the state change. */\n+\tuint32_t liberal_mode:1;\n+\t/**< The current state of the connection. */\n+\tenum rte_flow_conntrack_state state;\n+\t/**< Scaling factor for maximal allowed ACK window. */\n+\tuint8_t max_ack_window;\n+\t/**< Maximal allowed number of retransmission times. */\n+\tuint8_t retransmission_limit;\n+\t/**< TCP parameters of the original direction. */\n+\tstruct rte_flow_tcp_dir_param original_dir;\n+\t/**< TCP parameters of the reply direction. */\n+\tstruct rte_flow_tcp_dir_param reply_dir;\n+\t/**< The window value of the last packet passed this conntrack. */\n+\tuint16_t last_window;\n+\tenum rte_flow_conntrack_tcp_last_index last_index;\n+\t/**< The sequence of the last packet passed this conntrack. */\n+\tuint32_t last_seq;\n+\t/**< The acknowledgement of the last packet passed this conntrack. */\n+\tuint32_t last_ack;\n+\t/**< The total value ACK + payload length of the last packet passed\n+\t * this conntrack.\n+\t */\n+\tuint32_t last_end;\n+};\n+\n+/**\n+ * RTE_FLOW_ACTION_TYPE_CONNTRACK\n+ *\n+ * Wrapper structure for the context update interface.\n+ * Ports cannot support updating, and the only valid solution is to\n+ * destroy the old context and create a new one instead.\n+ */\n+struct rte_flow_modify_conntrack {\n+\t/**< New connection tracking parameters to be updated. */\n+\tstruct rte_flow_action_conntrack new_ct;\n+\tuint32_t direction:1; /**< The direction field will be updated. */\n+\t/**< All the other fields except direction will be updated. */\n+\tuint32_t state:1;\n+\tuint32_t reserved:30; /**< Reserved bits for the future usage. */\n+};\n+\n /**\n  * Field IDs for MODIFY_FIELD action.\n  */\n",
    "prefixes": []
}