get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 76086,
    "url": "http://patches.dpdk.org/api/patches/76086/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1598540492-406340-6-git-send-email-jiaweiw@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": "<1598540492-406340-6-git-send-email-jiaweiw@nvidia.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1598540492-406340-6-git-send-email-jiaweiw@nvidia.com",
    "date": "2020-08-27T15:01:30",
    "name": "[v5,5/7] net/mlx5: split sample flow into two sub flows",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "4888e15a6002ad948a92d92e73e13d30ccb08bcd",
    "submitter": {
        "id": 1939,
        "url": "http://patches.dpdk.org/api/people/1939/?format=api",
        "name": "Jiawei Wang",
        "email": "jiaweiw@nvidia.com"
    },
    "delegate": {
        "id": 319,
        "url": "http://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1598540492-406340-6-git-send-email-jiaweiw@nvidia.com/mbox/",
    "series": [
        {
            "id": 11829,
            "url": "http://patches.dpdk.org/api/series/11829/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=11829",
            "date": "2020-08-27T15:01:30",
            "name": "support the flow-based traffic sampling",
            "version": 5,
            "mbox": "http://patches.dpdk.org/series/11829/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/76086/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/76086/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 BFD97A04B1;\n\tThu, 27 Aug 2020 17:22:43 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 0DF571B951;\n\tThu, 27 Aug 2020 17:22:43 +0200 (CEST)",
            "from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129])\n by dpdk.org (Postfix) with ESMTP id E8AF21B951\n for <dev@dpdk.org>; Thu, 27 Aug 2020 17:22:41 +0200 (CEST)",
            "from Internal Mail-Server by MTLPINE1 (envelope-from\n jiaweiw@nvidia.com) with SMTP; 27 Aug 2020 18:22:37 +0300",
            "from nvidia.com (gen-l-vrt-280.mtl.labs.mlnx [10.237.45.1])\n by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 07RF1W7q029794;\n Thu, 27 Aug 2020 18:01:32 +0300"
        ],
        "From": "Jiawei Wang <jiaweiw@nvidia.com>",
        "To": "orika@nvidia.com, viacheslavo@nvidia.com, matan@nvidia.com",
        "Cc": "dev@dpdk.org, thomas@monjalon.net, rasland@nvidia.com,\n ian.stokes@intel.com, fbl@redhat.com, jiaweiw@nvidia.com, asafp@nvidia.com",
        "Date": "Thu, 27 Aug 2020 18:01:30 +0300",
        "Message-Id": "<1598540492-406340-6-git-send-email-jiaweiw@nvidia.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "In-Reply-To": "<1598540492-406340-1-git-send-email-jiaweiw@nvidia.com>",
        "References": "<1598457725-396788-1-git-send-email-jiaweiw@nvidia.com>\n <1598540492-406340-1-git-send-email-jiaweiw@nvidia.com>",
        "Subject": "[dpdk-dev] [PATCH v5 5/7] net/mlx5: split sample flow into two sub\n\tflows",
        "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": "Add the sampler action resource structs definition.\n\nThe flow with sample action will be splited into two sub flows,\nthe prefix flow with sample action, the suffix flow with the left\nactions.\n\nFor the prefix flow, add the extra the tag action with unique id\nto metadata register, and suffix flow will add the extra tag item\nto match that unique id.\n\nSigned-off-by: Jiawei Wang <jiaweiw@nvidia.com>\nAcked-by: Ori Kam <orika@nvidia.com>\n---\n drivers/net/mlx5/mlx5.c      |  11 ++\n drivers/net/mlx5/mlx5.h      |   3 +\n drivers/net/mlx5/mlx5_flow.c | 258 ++++++++++++++++++++++++++++++++++++++++++-\n drivers/net/mlx5/mlx5_flow.h |  36 ++++++\n 4 files changed, 304 insertions(+), 4 deletions(-)",
    "diff": "diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c\nindex 1e4c695..7b33a3e 100644\n--- a/drivers/net/mlx5/mlx5.c\n+++ b/drivers/net/mlx5/mlx5.c\n@@ -244,6 +244,17 @@ static LIST_HEAD(, mlx5_dev_ctx_shared) mlx5_dev_ctx_list =\n \t\t.free = mlx5_free,\n \t\t.type = \"mlx5_jump_ipool\",\n \t},\n+\t{\n+\t\t.size = sizeof(struct mlx5_flow_dv_sample_resource),\n+\t\t.trunk_size = 64,\n+\t\t.grow_trunk = 3,\n+\t\t.grow_shift = 2,\n+\t\t.need_lock = 0,\n+\t\t.release_mem_en = 1,\n+\t\t.malloc = mlx5_malloc,\n+\t\t.free = mlx5_free,\n+\t\t.type = \"mlx5_sample_ipool\",\n+\t},\n #endif\n \t{\n \t\t.size = sizeof(struct mlx5_flow_meter),\ndiff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h\nindex ae0c7cc..a76c161 100644\n--- a/drivers/net/mlx5/mlx5.h\n+++ b/drivers/net/mlx5/mlx5.h\n@@ -41,6 +41,7 @@ enum mlx5_ipool_index {\n \tMLX5_IPOOL_TAG, /* Pool for tag resource. */\n \tMLX5_IPOOL_PORT_ID, /* Pool for port id resource. */\n \tMLX5_IPOOL_JUMP, /* Pool for jump resource. */\n+\tMLX5_IPOOL_SAMPLE, /* Pool for sample resource. */\n #endif\n \tMLX5_IPOOL_MTR, /* Pool for meter resource. */\n \tMLX5_IPOOL_MCP, /* Pool for metadata resource. */\n@@ -514,6 +515,7 @@ struct mlx5_flow_tbl_resource {\n /* Tables for metering splits should be added here. */\n #define MLX5_MAX_TABLES_EXTERNAL (MLX5_MAX_TABLES - 3)\n #define MLX5_MAX_TABLES_FDB UINT16_MAX\n+#define MLX5_FLOW_TABLE_FACTOR 10\n \n /* ID generation structure. */\n struct mlx5_flow_id_pool {\n@@ -642,6 +644,7 @@ struct mlx5_dev_ctx_shared {\n \tstruct mlx5_hlist *tag_table;\n \tuint32_t port_id_action_list; /* List of port ID actions. */\n \tuint32_t push_vlan_action_list; /* List of push VLAN actions. */\n+\tuint32_t sample_action_list; /* List of sample actions. */\n \tstruct mlx5_flow_counter_mng cmng; /* Counters management structure. */\n \tstruct mlx5_flow_default_miss_resource default_miss;\n \t/* Default miss action resource structure. */\ndiff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c\nindex 7150173..49f49e7 100644\n--- a/drivers/net/mlx5/mlx5_flow.c\n+++ b/drivers/net/mlx5/mlx5_flow.c\n@@ -3908,6 +3908,139 @@ struct mlx5_flow_tunnel_info {\n \treturn 0;\n }\n \n+\n+/**\n+ * Check the match action from the action list.\n+ *\n+ * @param[in] actions\n+ *   Pointer to the list of actions.\n+ * @param[in] action\n+ *   The action to be check if exist.\n+ *\n+ * @return\n+ *   > 0 the total number of actions.\n+ *   0 if not found match action in action list.\n+ */\n+static int\n+flow_check_match_action(const struct rte_flow_action actions[],\n+\t\t\t\t\tenum rte_flow_action_type action)\n+{\n+\tint actions_n = 0;\n+\tint flag = 0;\n+\n+\tfor (; actions->type != RTE_FLOW_ACTION_TYPE_END; actions++) {\n+\t\tif (actions->type == action)\n+\t\t\tflag = 1;\n+\t\tactions_n++;\n+\t}\n+\t/* Count RTE_FLOW_ACTION_TYPE_END. */\n+\treturn flag ? actions_n + 1 : 0;\n+}\n+\n+/**\n+ * Split the sample flow.\n+ *\n+ * As sample flow will split to two sub flow, sample flow with\n+ * sample action, the other actions will move to new suffix flow.\n+ *\n+ * Also add unique tag id with tag action in the sample flow,\n+ * the same tag id will be as match in the suffix flow.\n+ *\n+ * @param dev\n+ *   Pointer to Ethernet device.\n+ * @param[in] attr\n+ *   Flow rule attributes.\n+ * @param[out] sfx_items\n+ *   Suffix flow match items (list terminated by the END pattern item).\n+ * @param[in] actions\n+ *   Associated actions (list terminated by the END action).\n+ * @param[out] actions_sfx\n+ *   Suffix flow actions.\n+ * @param[out] actions_pre\n+ *   Prefix flow actions.\n+ *\n+ * @return\n+ *   0 on success, or unique flow_id.\n+ */\n+static int\n+flow_sample_split_prep(struct rte_eth_dev *dev,\n+\t\t const struct rte_flow_attr *attr,\n+\t\t struct rte_flow_item sfx_items[],\n+\t\t const struct rte_flow_action actions[],\n+\t\t struct rte_flow_action actions_sfx[],\n+\t\t struct rte_flow_action actions_pre[])\n+{\n+\tstruct mlx5_rte_flow_action_set_tag *set_tag;\n+\tstruct mlx5_rte_flow_item_tag *tag_spec;\n+\tstruct mlx5_rte_flow_item_tag *tag_mask;\n+\tstruct rte_flow_item *tag_item;\n+\tstruct rte_flow_action *tag_action = NULL;\n+\tbool pre_sample = true;\n+\tstruct rte_flow_error error;\n+\tuint32_t tag_id = 0;\n+\n+\t/* Prepare the actions for prefix and suffix flow. */\n+\tfor (; actions->type != RTE_FLOW_ACTION_TYPE_END; actions++) {\n+\t\tstruct rte_flow_action **action_cur = NULL;\n+\n+\t\tswitch (actions->type) {\n+\t\tcase RTE_FLOW_ACTION_TYPE_SAMPLE:\n+\t\t\tif (!attr->transfer) {\n+\t\t\t\t/* Add the extra tag action first for NIC-RX. */\n+\t\t\t\ttag_action = actions_pre;\n+\t\t\t\ttag_action->type = (enum rte_flow_action_type)\n+\t\t\t\t\t\tMLX5_RTE_FLOW_ACTION_TYPE_TAG;\n+\t\t\t\tactions_pre++;\n+\t\t\t}\n+\t\t\tbreak;\n+\t\tcase RTE_FLOW_ACTION_TYPE_JUMP:\n+\t\tcase RTE_FLOW_ACTION_TYPE_METER:\n+\t\t\taction_cur = &actions_sfx;\n+\t\t\tbreak;\n+\t\tdefault:\n+\t\t\tbreak;\n+\t\t}\n+\t\tif (pre_sample && !action_cur)\n+\t\t\taction_cur = &actions_pre;\n+\t\telse\n+\t\t\taction_cur = &actions_sfx;\n+\t\tmemcpy(*action_cur, actions, sizeof(struct rte_flow_action));\n+\t\t(*action_cur)++;\n+\t\tif (actions->type == RTE_FLOW_ACTION_TYPE_SAMPLE)\n+\t\t\tpre_sample = false;\n+\t}\n+\t/* Add end action to the actions. */\n+\tactions_sfx->type = RTE_FLOW_ACTION_TYPE_END;\n+\tactions_pre->type = RTE_FLOW_ACTION_TYPE_END;\n+\tif (!attr->transfer) {\n+\t\tactions_pre++;\n+\t\t/* Set the tag. */\n+\t\tset_tag = (void *)actions_pre;\n+\t\tset_tag->id = mlx5_flow_get_reg_id(dev, MLX5_APP_TAG,\n+\t\t\t\t\t\t   0, &error);\n+\t\ttag_id = flow_qrss_get_id(dev);\n+\t\tset_tag->data = tag_id;\n+\t\tassert(tag_action);\n+\t\ttag_action->conf = set_tag;\n+\t\t/* Prepare the suffix subflow items. */\n+\t\ttag_item = sfx_items++;\n+\t\tsfx_items->type = RTE_FLOW_ITEM_TYPE_END;\n+\t\tsfx_items++;\n+\t\ttag_spec = (struct mlx5_rte_flow_item_tag *)sfx_items;\n+\t\ttag_spec->data = tag_id;\n+\t\ttag_spec->id = set_tag->id;\n+\t\ttag_mask = tag_spec + 1;\n+\t\ttag_mask->data = UINT32_MAX;\n+\t\ttag_mask->id = UINT16_MAX;\n+\t\ttag_item->type = (enum rte_flow_item_type)\n+\t\t\t\tMLX5_RTE_FLOW_ITEM_TYPE_TAG;\n+\t\ttag_item->spec = tag_spec;\n+\t\ttag_item->last = NULL;\n+\t\ttag_item->mask = tag_mask;\n+\t}\n+\treturn tag_id;\n+}\n+\n /**\n  * The splitting for metadata feature.\n  *\n@@ -4169,6 +4302,7 @@ struct mlx5_flow_tunnel_info {\n static int\n flow_create_split_meter(struct rte_eth_dev *dev,\n \t\t\t   struct rte_flow *flow,\n+\t\t\t   uint64_t prefix_layers,\n \t\t\t   const struct rte_flow_attr *attr,\n \t\t\t   const struct rte_flow_item items[],\n \t\t\t   const struct rte_flow_action actions[],\n@@ -4216,8 +4350,9 @@ struct mlx5_flow_tunnel_info {\n \t\t\tgoto exit;\n \t\t}\n \t\t/* Add the prefix subflow. */\n-\t\tret = flow_create_split_inner(dev, flow, &dev_flow, 0, attr,\n-\t\t\t\t\t      items, pre_actions, external,\n+\t\tret = flow_create_split_inner(dev, flow, &dev_flow,\n+\t\t\t\t\t      prefix_layers, attr, items,\n+\t\t\t\t\t      pre_actions, external,\n \t\t\t\t\t      flow_idx, error);\n \t\tif (ret) {\n \t\t\tret = -rte_errno;\n@@ -4232,7 +4367,7 @@ struct mlx5_flow_tunnel_info {\n \t/* Add the prefix subflow. */\n \tret = flow_create_split_metadata(dev, flow, dev_flow ?\n \t\t\t\t\t flow_get_prefix_layer_flags(dev_flow) :\n-\t\t\t\t\t 0, &sfx_attr,\n+\t\t\t\t\t prefix_layers, &sfx_attr,\n \t\t\t\t\t sfx_items ? sfx_items : items,\n \t\t\t\t\t sfx_actions ? sfx_actions : actions,\n \t\t\t\t\t external, flow_idx, error);\n@@ -4243,6 +4378,121 @@ struct mlx5_flow_tunnel_info {\n }\n \n /**\n+ * The splitting for sample feature.\n+ *\n+ * The sample flow will be split to two flows as prefix and\n+ * suffix flow.\n+ *\n+ * @param dev\n+ *   Pointer to Ethernet device.\n+ * @param[in] flow\n+ *   Parent flow structure pointer.\n+ * @param[in] attr\n+ *   Flow rule attributes.\n+ * @param[in] items\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[in] external\n+ *   This flow rule is created by request external to PMD.\n+ * @param[in] flow_idx\n+ *   This memory pool index to the flow.\n+ * @param[out] error\n+ *   Perform verbose error reporting if not NULL.\n+ * @return\n+ *   0 on success, negative value otherwise\n+ */\n+static int\n+flow_create_split_sample(struct rte_eth_dev *dev,\n+\t\t\t   struct rte_flow *flow,\n+\t\t\t   const struct rte_flow_attr *attr,\n+\t\t\t   const struct rte_flow_item items[],\n+\t\t\t   const struct rte_flow_action actions[],\n+\t\t\t   bool external, uint32_t flow_idx,\n+\t\t\t   struct rte_flow_error *error)\n+{\n+\tstruct mlx5_priv *priv = dev->data->dev_private;\n+\tstruct rte_flow_action *sfx_actions = NULL;\n+\tstruct rte_flow_action *pre_actions = NULL;\n+\tstruct rte_flow_item *sfx_items = NULL;\n+\tstruct mlx5_flow *dev_flow = NULL;\n+\tstruct rte_flow_attr sfx_attr = *attr;\n+#ifdef HAVE_IBV_FLOW_DV_SUPPORT\n+\tstruct mlx5_flow_dv_sample_resource *sample_res;\n+\tstruct mlx5_flow_tbl_data_entry *sfx_tbl_data;\n+\tstruct mlx5_flow_tbl_resource *sfx_tbl;\n+\tunion mlx5_flow_tbl_key sfx_table_key;\n+#endif\n+\tsize_t act_size;\n+\tsize_t item_size;\n+\tuint32_t tag_id = 0;\n+\tint actions_n = 0;\n+\tint ret = 0;\n+\n+\tif (priv->sampler_en)\n+\t\tactions_n = flow_check_match_action(actions,\n+\t\t\t\t\tRTE_FLOW_ACTION_TYPE_SAMPLE);\n+\tif (actions_n) {\n+\t\t/* The prefix actions must includes sample, tag, end. */\n+\t\tact_size = sizeof(struct rte_flow_action) * (actions_n * 2) +\n+\t\t\t   sizeof(struct mlx5_rte_flow_action_set_tag);\n+\t\t/* tag, end. */\n+#define SAMPLE_SUFFIX_ITEM 2\n+\t\titem_size = sizeof(struct rte_flow_item) * SAMPLE_SUFFIX_ITEM +\n+\t\t\t    sizeof(struct mlx5_rte_flow_item_tag) * 2;\n+\t\tsfx_actions = rte_zmalloc(__func__, (act_size + item_size), 0);\n+\t\tif (!sfx_actions)\n+\t\t\treturn rte_flow_error_set(error, ENOMEM,\n+\t\t\t\t\t\t  RTE_FLOW_ERROR_TYPE_ACTION,\n+\t\t\t\t\t\t  NULL, \"no memory to split \"\n+\t\t\t\t\t\t  \"sample flow\");\n+\t\tif (!attr->transfer)\n+\t\t\tsfx_items = (struct rte_flow_item *)((char *)sfx_actions\n+\t\t\t\t\t+ act_size);\n+\t\tpre_actions = sfx_actions + actions_n;\n+\t\ttag_id = flow_sample_split_prep(dev, attr, sfx_items,\n+\t\t\t\t\t\t   actions, sfx_actions,\n+\t\t\t\t\t\t   pre_actions);\n+\t\tif (!attr->transfer && !tag_id) {\n+\t\t\tret = -rte_errno;\n+\t\t\tgoto exit;\n+\t\t}\n+\t\t/* Add the prefix subflow. */\n+\t\tret = flow_create_split_inner(dev, flow, &dev_flow, 0, attr,\n+\t\t\t\t\t      items, pre_actions, external,\n+\t\t\t\t\t      flow_idx, error);\n+\t\tif (ret) {\n+\t\t\tret = -rte_errno;\n+\t\t\tgoto exit;\n+\t\t}\n+\t\tdev_flow->handle->split_flow_id = tag_id;\n+#ifdef HAVE_IBV_FLOW_DV_SUPPORT\n+\t\t/* Set the sfx group attr. */\n+\t\tsample_res = (struct mlx5_flow_dv_sample_resource *)\n+\t\t\t\t\tdev_flow->dv.sample_res;\n+\t\tsfx_tbl = (struct mlx5_flow_tbl_resource *)\n+\t\t\t\t\tsample_res->normal_path_tbl;\n+\t\tsfx_tbl_data = container_of(sfx_tbl,\n+\t\t\t\t\tstruct mlx5_flow_tbl_data_entry, tbl);\n+\t\tsfx_table_key.v64 = sfx_tbl_data->entry.key;\n+\t\tsfx_attr.group = sfx_attr.transfer ?\n+\t\t\t\t\t(sfx_table_key.table_id - 1) :\n+\t\t\t\t\tsfx_table_key.table_id;\n+#endif\n+\t}\n+\t/* Add the suffix subflow. */\n+\tret = flow_create_split_meter(dev, flow, dev_flow ?\n+\t\t\t\t flow_get_prefix_layer_flags(dev_flow) : 0,\n+\t\t\t\t &sfx_attr, sfx_items ? sfx_items : items,\n+\t\t\t\t sfx_actions ? sfx_actions : actions,\n+\t\t\t\t external, flow_idx, error);\n+exit:\n+\tif (sfx_actions)\n+\t\trte_free(sfx_actions);\n+\treturn ret;\n+}\n+\n+/**\n  * Split the flow to subflow set. The splitters might be linked\n  * in the chain, like this:\n  * flow_create_split_outer() calls:\n@@ -4290,7 +4540,7 @@ struct mlx5_flow_tunnel_info {\n {\n \tint ret;\n \n-\tret = flow_create_split_meter(dev, flow, attr, items,\n+\tret = flow_create_split_sample(dev, flow, attr, items,\n \t\t\t\t\t actions, external, flow_idx, error);\n \tMLX5_ASSERT(ret <= 0);\n \treturn ret;\ndiff --git a/drivers/net/mlx5/mlx5_flow.h b/drivers/net/mlx5/mlx5_flow.h\nindex 41404de..9d2493a 100644\n--- a/drivers/net/mlx5/mlx5_flow.h\n+++ b/drivers/net/mlx5/mlx5_flow.h\n@@ -507,6 +507,38 @@ struct mlx5_flow_tbl_data_entry {\n \tuint32_t idx; /**< index for the indexed mempool. */\n };\n \n+/* Sub rdma-core actions list. */\n+struct mlx5_flow_sub_actions_list {\n+\tuint32_t actions_num; /**< Number of sample actions. */\n+\tuint64_t action_flags;\n+\tvoid *dr_queue_action;\n+\tvoid *dr_tag_action;\n+\tvoid *dr_cnt_action;\n+};\n+\n+/* Sample sub-actions resource list. */\n+struct mlx5_flow_sub_actions_idx {\n+\tuint32_t rix_hrxq; /**< Hash Rx queue object index. */\n+\tuint32_t rix_tag; /**< Index to the tag action. */\n+\tuint32_t cnt;\n+};\n+\n+/* Sample action resource structure. */\n+struct mlx5_flow_dv_sample_resource {\n+\tILIST_ENTRY(uint32_t)next; /**< Pointer to next element. */\n+\trte_atomic32_t refcnt; /**< Reference counter. */\n+\tvoid *verbs_action; /**< Verbs sample action object. */\n+\tuint8_t ft_type; /** Flow Table Type */\n+\tuint32_t ft_id; /** Flow Table Level */\n+\tvoid *normal_path_tbl; /** Flow Table pointer */\n+\tvoid *default_miss; /** default_miss dr_action. */\n+\tuint32_t ratio;   /** Sample Ratio */\n+\tstruct mlx5_flow_sub_actions_idx sample_idx;\n+\t/**< Action index resources. */\n+\tstruct mlx5_flow_sub_actions_list sample_act;\n+\t/**< Action resources. */\n+};\n+\n /* Verbs specification header. */\n struct ibv_spec_header {\n \tenum ibv_flow_spec_type type;\n@@ -539,6 +571,8 @@ struct mlx5_flow_handle_dv {\n \t/**< Index to push VLAN action resource in cache. */\n \tuint32_t rix_tag;\n \t/**< Index to the tag action. */\n+\tuint32_t rix_sample;\n+\t/**< Index to sample action resource in cache. */\n } __rte_packed;\n \n /** Device flow handle structure: used both for creating & destroying. */\n@@ -604,6 +638,8 @@ struct mlx5_flow_dv_workspace {\n \t/**< Pointer to the jump action resource. */\n \tstruct mlx5_flow_dv_match_params value;\n \t/**< Holds the value that the packet is compared to. */\n+\tstruct mlx5_flow_dv_sample_resource *sample_res;\n+\t/**< Pointer to the sample action resource. */\n };\n \n /*\n",
    "prefixes": [
        "v5",
        "5/7"
    ]
}