get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 67076,
    "url": "https://patches.dpdk.org/api/patches/67076/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1585062980-27196-3-git-send-email-bingz@mellanox.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": "<1585062980-27196-3-git-send-email-bingz@mellanox.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1585062980-27196-3-git-send-email-bingz@mellanox.com",
    "date": "2020-03-24T15:16:18",
    "name": "[v3,2/4] net/mlx5: reorganize mlx5 flow structures",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "6b7176b9001e8dc5f271c516b322e4bc539351ee",
    "submitter": {
        "id": 1357,
        "url": "https://patches.dpdk.org/api/people/1357/?format=api",
        "name": "Bing Zhao",
        "email": "bingz@mellanox.com"
    },
    "delegate": {
        "id": 3268,
        "url": "https://patches.dpdk.org/api/users/3268/?format=api",
        "username": "rasland",
        "first_name": "Raslan",
        "last_name": "Darawsheh",
        "email": "rasland@nvidia.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1585062980-27196-3-git-send-email-bingz@mellanox.com/mbox/",
    "series": [
        {
            "id": 9024,
            "url": "https://patches.dpdk.org/api/series/9024/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=9024",
            "date": "2020-03-24T15:16:16",
            "name": "net/mlx5: move to non-cached mode for flow rules",
            "version": 3,
            "mbox": "https://patches.dpdk.org/series/9024/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/67076/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/67076/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 39D93A058A;\n\tTue, 24 Mar 2020 16:17:25 +0100 (CET)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 0F7491BF6D;\n\tTue, 24 Mar 2020 16:17:25 +0100 (CET)",
            "from git-send-mailer.rdmz.labs.mlnx (unknown [37.142.13.130])\n by dpdk.org (Postfix) with ESMTP id C87131BE8A\n for <dev@dpdk.org>; Tue, 24 Mar 2020 16:17:22 +0100 (CET)"
        ],
        "From": "Bing Zhao <bingz@mellanox.com>",
        "To": "orika@mellanox.com,\n\trasland@mellanox.com,\n\tmatan@mellanox.com",
        "Cc": "viacheslavo@mellanox.com,\n\tdev@dpdk.org",
        "Date": "Tue, 24 Mar 2020 15:16:18 +0000",
        "Message-Id": "<1585062980-27196-3-git-send-email-bingz@mellanox.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "In-Reply-To": "<1585062980-27196-1-git-send-email-bingz@mellanox.com>",
        "References": "<1580816002-159035-1-git-send-email-bingz@mellanox.com>\n <1585062980-27196-1-git-send-email-bingz@mellanox.com>",
        "Subject": "[dpdk-dev] [PATCH v3 2/4] net/mlx5: reorganize mlx5 flow structures",
        "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": "Common structures used for mlx5 flow creating and destroying are\nreorganized in order to separating the parts only for destroying\nfrom all the items.\nThe \"mlx5_flow\" will contain the common items of DV and Verbs flow,\nspecific items for DV / Verbs only. These items will only be used\nwhen creating a flow.\nAt the end of \"mlx5_flow\", a nested structure \"mlx5_flow_handle\"\nlocated. It contains all the items used both for creating and\ndestroying a flow. Also, it consists of common items, and DV / Verbs\nspecific items.\n\nSigned-off-by: Bing Zhao <bingz@mellanox.com>\n---\n drivers/net/mlx5/mlx5_flow.c       |  43 ++++----\n drivers/net/mlx5/mlx5_flow.h       | 108 ++++++++++----------\n drivers/net/mlx5/mlx5_flow_dv.c    | 197 +++++++++++++++++++------------------\n drivers/net/mlx5/mlx5_flow_verbs.c |  89 ++++++++---------\n 4 files changed, 223 insertions(+), 214 deletions(-)",
    "diff": "diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c\nindex 81a85ec..230f071 100644\n--- a/drivers/net/mlx5/mlx5_flow.c\n+++ b/drivers/net/mlx5/mlx5_flow.c\n@@ -720,9 +720,9 @@ uint32_t mlx5_flow_adjust_priority(struct rte_eth_dev *dev, int32_t priority,\n {\n \tstruct mlx5_priv *priv = dev->data->dev_private;\n \tstruct rte_flow *flow = dev_flow->flow;\n-\tconst int mark = !!(dev_flow->actions &\n+\tconst int mark = !!(dev_flow->handle.act_flags &\n \t\t\t    (MLX5_FLOW_ACTION_FLAG | MLX5_FLOW_ACTION_MARK));\n-\tconst int tunnel = !!(dev_flow->layers & MLX5_FLOW_LAYER_TUNNEL);\n+\tconst int tunnel = !!(dev_flow->handle.layers & MLX5_FLOW_LAYER_TUNNEL);\n \tunsigned int i;\n \n \tfor (i = 0; i != flow->rss.queue_num; ++i) {\n@@ -751,7 +751,7 @@ uint32_t mlx5_flow_adjust_priority(struct rte_eth_dev *dev, int32_t priority,\n \t\t\t/* Increase the counter matching the flow. */\n \t\t\tfor (j = 0; j != MLX5_FLOW_TUNNEL; ++j) {\n \t\t\t\tif ((tunnels_info[j].tunnel &\n-\t\t\t\t     dev_flow->layers) ==\n+\t\t\t\t     dev_flow->handle.layers) ==\n \t\t\t\t    tunnels_info[j].tunnel) {\n \t\t\t\t\trxq_ctrl->flow_tunnels_n[j]++;\n \t\t\t\t\tbreak;\n@@ -793,9 +793,9 @@ uint32_t mlx5_flow_adjust_priority(struct rte_eth_dev *dev, int32_t priority,\n {\n \tstruct mlx5_priv *priv = dev->data->dev_private;\n \tstruct rte_flow *flow = dev_flow->flow;\n-\tconst int mark = !!(dev_flow->actions &\n+\tconst int mark = !!(dev_flow->handle.act_flags &\n \t\t\t    (MLX5_FLOW_ACTION_FLAG | MLX5_FLOW_ACTION_MARK));\n-\tconst int tunnel = !!(dev_flow->layers & MLX5_FLOW_LAYER_TUNNEL);\n+\tconst int tunnel = !!(dev_flow->handle.layers & MLX5_FLOW_LAYER_TUNNEL);\n \tunsigned int i;\n \n \tMLX5_ASSERT(dev->data->dev_started);\n@@ -820,7 +820,7 @@ uint32_t mlx5_flow_adjust_priority(struct rte_eth_dev *dev, int32_t priority,\n \t\t\t/* Decrease the counter matching the flow. */\n \t\t\tfor (j = 0; j != MLX5_FLOW_TUNNEL; ++j) {\n \t\t\t\tif ((tunnels_info[j].tunnel &\n-\t\t\t\t     dev_flow->layers) ==\n+\t\t\t\t     dev_flow->handle.layers) ==\n \t\t\t\t    tunnels_info[j].tunnel) {\n \t\t\t\t\trxq_ctrl->flow_tunnels_n[j]--;\n \t\t\t\t\tbreak;\n@@ -2312,8 +2312,8 @@ uint32_t mlx5_flow_adjust_priority(struct rte_eth_dev *dev, int32_t priority,\n \tstruct mlx5_flow *dev_flow;\n \n \tLIST_FOREACH(dev_flow, &flow->dev_flows, next)\n-\t\tif (dev_flow->qrss_id)\n-\t\t\tflow_qrss_free_id(dev, dev_flow->qrss_id);\n+\t\tif (dev_flow->handle.qrss_id)\n+\t\t\tflow_qrss_free_id(dev, dev_flow->handle.qrss_id);\n }\n \n static int\n@@ -2696,18 +2696,22 @@ uint32_t mlx5_flow_adjust_priority(struct rte_eth_dev *dev, int32_t priority,\n {\n \tuint64_t layers = 0;\n \n-\t/* If no decap actions, use the layers directly. */\n-\tif (!(dev_flow->actions & MLX5_FLOW_ACTION_DECAP))\n-\t\treturn dev_flow->layers;\n+\t/*\n+\t * Layers bits could be localization, but usually the compiler will\n+\t * help to do the optimization work for source code.\n+\t * If no decap actions, use the layers directly.\n+\t */\n+\tif (!(dev_flow->handle.act_flags & MLX5_FLOW_ACTION_DECAP))\n+\t\treturn dev_flow->handle.layers;\n \t/* Convert L3 layers with decap action. */\n-\tif (dev_flow->layers & MLX5_FLOW_LAYER_INNER_L3_IPV4)\n+\tif (dev_flow->handle.layers & MLX5_FLOW_LAYER_INNER_L3_IPV4)\n \t\tlayers |= MLX5_FLOW_LAYER_OUTER_L3_IPV4;\n-\telse if (dev_flow->layers & MLX5_FLOW_LAYER_INNER_L3_IPV6)\n+\telse if (dev_flow->handle.layers & MLX5_FLOW_LAYER_INNER_L3_IPV6)\n \t\tlayers |= MLX5_FLOW_LAYER_OUTER_L3_IPV6;\n \t/* Convert L4 layers with decap action.  */\n-\tif (dev_flow->layers & MLX5_FLOW_LAYER_INNER_L4_TCP)\n+\tif (dev_flow->handle.layers & MLX5_FLOW_LAYER_INNER_L4_TCP)\n \t\tlayers |= MLX5_FLOW_LAYER_OUTER_L4_TCP;\n-\telse if (dev_flow->layers & MLX5_FLOW_LAYER_INNER_L4_UDP)\n+\telse if (dev_flow->handle.layers & MLX5_FLOW_LAYER_INNER_L4_UDP)\n \t\tlayers |= MLX5_FLOW_LAYER_OUTER_L4_UDP;\n \treturn layers;\n }\n@@ -3453,7 +3457,7 @@ uint32_t mlx5_flow_adjust_priority(struct rte_eth_dev *dev, int32_t priority,\n \t * flow may need some user defined item layer flags.\n \t */\n \tif (prefix_layers)\n-\t\tdev_flow->layers = prefix_layers;\n+\t\tdev_flow->handle.layers = prefix_layers;\n \tif (sub_flow)\n \t\t*sub_flow = dev_flow;\n \treturn flow_drv_translate(dev, dev_flow, attr, items, actions, error);\n@@ -3968,8 +3972,7 @@ uint32_t mlx5_flow_adjust_priority(struct rte_eth_dev *dev, int32_t priority,\n \t\t\t * reallocation becomes possible (for example, for\n \t\t\t * other flows in other threads).\n \t\t\t */\n-\t\t\tdev_flow->qrss_id = qrss_id;\n-\t\t\tqrss_id = 0;\n+\t\t\tdev_flow->handle.qrss_id = qrss_id;\n \t\t\tret = mlx5_flow_get_reg_id(dev, MLX5_COPY_MARK, 0,\n \t\t\t\t\t\t   error);\n \t\t\tif (ret < 0)\n@@ -3984,6 +3987,8 @@ uint32_t mlx5_flow_adjust_priority(struct rte_eth_dev *dev, int32_t priority,\n \t\t\t\t\t      external, error);\n \t\tif (ret < 0)\n \t\t\tgoto exit;\n+\t\t/* qrss ID should be freed if failed. */\n+\t\tqrss_id = 0;\n \t\tMLX5_ASSERT(dev_flow);\n \t}\n \n@@ -4080,7 +4085,7 @@ uint32_t mlx5_flow_adjust_priority(struct rte_eth_dev *dev, int32_t priority,\n \t\t\tret = -rte_errno;\n \t\t\tgoto exit;\n \t\t}\n-\t\tdev_flow->mtr_flow_id = mtr_tag_id;\n+\t\tdev_flow->handle.mtr_flow_id = mtr_tag_id;\n \t\t/* Setting the sfx group atrr. */\n \t\tsfx_attr.group = sfx_attr.transfer ?\n \t\t\t\t(MLX5_FLOW_TABLE_LEVEL_SUFFIX - 1) :\ndiff --git a/drivers/net/mlx5/mlx5_flow.h b/drivers/net/mlx5/mlx5_flow.h\nindex 13c8589..f3aea53 100644\n--- a/drivers/net/mlx5/mlx5_flow.h\n+++ b/drivers/net/mlx5/mlx5_flow.h\n@@ -464,25 +464,28 @@ struct mlx5_flow_tbl_data_entry {\n \t/**< jump resource, at most one for each table created. */\n };\n \n-/*\n- * Max number of actions per DV flow.\n- * See CREATE_FLOW_MAX_FLOW_ACTIONS_SUPPORTED\n- * In rdma-core file providers/mlx5/verbs.c\n- */\n-#define MLX5_DV_MAX_NUMBER_OF_ACTIONS 8\n+/* Verbs specification header. */\n+struct ibv_spec_header {\n+\tenum ibv_flow_spec_type type;\n+\tuint16_t size;\n+};\n+\n+struct mlx5_flow_rss {\n+\tuint32_t level;\n+\tuint32_t queue_num; /**< Number of entries in @p queue. */\n+\tuint64_t types; /**< Specific RSS hash types (see ETH_RSS_*). */\n+\tuint16_t (*queue)[]; /**< Destination queues to redirect traffic to. */\n+\tuint8_t key[MLX5_RSS_HASH_KEY_LEN]; /**< RSS hash key. */\n+};\n \n-/* DV flows structure. */\n-struct mlx5_flow_dv {\n-\tstruct mlx5_hrxq *hrxq; /**< Hash Rx queues. */\n+/** Device flow handle structure for DV mode only. */\n+struct mlx5_flow_handle_dv {\n \t/* Flow DV api: */\n \tstruct mlx5_flow_dv_matcher *matcher; /**< Cache to matcher. */\n-\tstruct mlx5_flow_dv_match_params value;\n-\t/**< Holds the value that the packet is compared to. */\n \tstruct mlx5_flow_dv_encap_decap_resource *encap_decap;\n \t/**< Pointer to encap/decap resource in cache. */\n \tstruct mlx5_flow_dv_modify_hdr_resource *modify_hdr;\n \t/**< Pointer to modify header resource in cache. */\n-\tstruct ibv_flow *flow; /**< Installed flow. */\n \tstruct mlx5_flow_dv_jump_tbl_resource *jump;\n \t/**< Pointer to the jump action resource. */\n \tstruct mlx5_flow_dv_port_id_action_resource *port_id_action;\n@@ -493,65 +496,64 @@ struct mlx5_flow_dv {\n \t/**< Pointer to push VLAN action resource in cache. */\n \tstruct mlx5_flow_dv_tag_resource *tag_resource;\n \t/**< pointer to the tag action. */\n+};\n+\n+/** Device flow handle structure: used both for creating & destroying. */\n+struct mlx5_flow_handle {\n+\tuint64_t layers;\n+\t/**< Bit-fields of present layers, see MLX5_FLOW_LAYER_*. */\n+\tuint64_t act_flags;\n+\t/**< Bit-fields of detected actions, see MLX5_FLOW_ACTION_*. */\n+\tvoid *ib_flow; /**< Verbs flow pointer. */\n+\tstruct mlx5_hrxq *hrxq; /**< Hash Rx queue object. */\n+\tstruct mlx5_vf_vlan vf_vlan; /**< Structure for VF VLAN workaround. */\n+\tunion {\n+\t\tuint32_t qrss_id; /**< Uniqie Q/RSS suffix subflow tag. */\n+\t\tuint32_t mtr_flow_id; /**< Unique meter match flow id. */\n+\t};\n #ifdef HAVE_IBV_FLOW_DV_SUPPORT\n-\tvoid *actions[MLX5_DV_MAX_NUMBER_OF_ACTIONS];\n-\t/**< Action list. */\n+\tstruct mlx5_flow_handle_dv dvh;\n #endif\n-\tint actions_n; /**< number of actions. */\n };\n \n-/* Verbs specification header. */\n-struct ibv_spec_header {\n-\tenum ibv_flow_spec_type type;\n-\tuint16_t size;\n-};\n+/*\n+ * Max number of actions per DV flow.\n+ * See CREATE_FLOW_MAX_FLOW_ACTIONS_SUPPORTED\n+ * in rdma-core file providers/mlx5/verbs.c.\n+ */\n+#define MLX5_DV_MAX_NUMBER_OF_ACTIONS 8\n \n-/** Handles information leading to a drop fate. */\n-struct mlx5_flow_verbs {\n-\tLIST_ENTRY(mlx5_flow_verbs) next;\n-\tunsigned int size; /**< Size of the attribute. */\n-\tstruct {\n-\t\tstruct ibv_flow_attr *attr;\n-\t\t/**< Pointer to the Specification buffer. */\n-\t\tuint8_t *specs; /**< Pointer to the specifications. */\n-\t};\n-\tstruct ibv_flow *flow; /**< Verbs flow pointer. */\n-\tstruct mlx5_hrxq *hrxq; /**< Hash Rx queue object. */\n-\tstruct mlx5_vf_vlan vf_vlan;\n-\t/**< Structure for VF VLAN workaround. */\n+/** Device flow structure only for DV flow creation. */\n+struct mlx5_flow_resource_dv {\n+\tuint32_t group; /**< The group index. */\n+\tuint8_t transfer; /**< 1 if the flow is E-Switch flow. */\n+\tint actions_n; /**< number of actions. */\n+\tvoid *actions[MLX5_DV_MAX_NUMBER_OF_ACTIONS]; /**< Action list. */\n+\tstruct mlx5_flow_dv_match_params value;\n+\t/**< Holds the value that the packet is compared to. */\n };\n \n-struct mlx5_flow_rss {\n-\tuint32_t level;\n-\tuint32_t queue_num; /**< Number of entries in @p queue. */\n-\tuint64_t types; /**< Specific RSS hash types (see ETH_RSS_*). */\n-\tuint16_t (*queue)[]; /**< Destination queues to redirect traffic to. */\n-\tuint8_t key[MLX5_RSS_HASH_KEY_LEN]; /**< RSS hash key. */\n+/** Device flow structure only for Verbs flow creation. */\n+struct mlx5_flow_resource_verbs {\n+\tunsigned int size; /**< Size of the attribute. */\n+\tstruct ibv_flow_attr *attr; /**< Pointer to the Specification buffer. */\n+\tuint8_t *specs; /**< Pointer to the specifications. */\n };\n \n /** Device flow structure. */\n struct mlx5_flow {\n-\tLIST_ENTRY(mlx5_flow) next;\n+\tLIST_ENTRY(mlx5_flow) next; /**< Pointer to next device flow. */\n \tstruct rte_flow *flow; /**< Pointer to the main flow. */\n-\tuint64_t layers;\n-\t/**< Bit-fields of present layers, see MLX5_FLOW_LAYER_*. */\n-\tuint64_t actions;\n-\t/**< Bit-fields of detected actions, see MLX5_FLOW_ACTION_*. */\n \tuint64_t hash_fields; /**< Verbs hash Rx queue hash fields. */\n+\tbool external; /**< true if the flow is created external to PMD. */\n \tuint8_t ingress; /**< 1 if the flow is ingress. */\n-\tuint32_t group; /**< The group index. */\n-\tuint8_t transfer; /**< 1 if the flow is E-Switch flow. */\n \tunion {\n #ifdef HAVE_IBV_FLOW_DV_SUPPORT\n-\t\tstruct mlx5_flow_dv dv;\n+\t\tstruct mlx5_flow_resource_dv dv;\n #endif\n-\t\tstruct mlx5_flow_verbs verbs;\n-\t};\n-\tunion {\n-\t\tuint32_t qrss_id; /**< Uniqie Q/RSS suffix subflow tag. */\n-\t\tuint32_t mtr_flow_id; /**< Unique meter match flow id. */\n+\t\tstruct mlx5_flow_resource_verbs verbs;\n \t};\n-\tbool external; /**< true if the flow is created external to PMD. */\n+\tstruct mlx5_flow_handle handle;\n };\n \n /* Flow meter state. */\ndiff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c\nindex 2090631..d1eec96 100644\n--- a/drivers/net/mlx5/mlx5_flow_dv.c\n+++ b/drivers/net/mlx5/mlx5_flow_dv.c\n@@ -92,20 +92,22 @@\n flow_dv_attr_init(const struct rte_flow_item *item, union flow_dv_attr *attr,\n \t\t  struct mlx5_flow *dev_flow, bool tunnel_decap)\n {\n+\tuint64_t layers = dev_flow->handle.layers;\n+\n \t/*\n \t * If layers is already initialized, it means this dev_flow is the\n \t * suffix flow, the layers flags is set by the prefix flow. Need to\n \t * use the layer flags from prefix flow as the suffix flow may not\n \t * have the user defined items as the flow is split.\n \t */\n-\tif (dev_flow->layers) {\n-\t\tif (dev_flow->layers & MLX5_FLOW_LAYER_OUTER_L3_IPV4)\n+\tif (layers) {\n+\t\tif (layers & MLX5_FLOW_LAYER_OUTER_L3_IPV4)\n \t\t\tattr->ipv4 = 1;\n-\t\telse if (dev_flow->layers & MLX5_FLOW_LAYER_OUTER_L3_IPV6)\n+\t\telse if (layers & MLX5_FLOW_LAYER_OUTER_L3_IPV6)\n \t\t\tattr->ipv6 = 1;\n-\t\tif (dev_flow->layers & MLX5_FLOW_LAYER_OUTER_L4_TCP)\n+\t\tif (layers & MLX5_FLOW_LAYER_OUTER_L4_TCP)\n \t\t\tattr->tcp = 1;\n-\t\telse if (dev_flow->layers & MLX5_FLOW_LAYER_OUTER_L4_UDP)\n+\t\telse if (layers & MLX5_FLOW_LAYER_OUTER_L4_UDP)\n \t\t\tattr->udp = 1;\n \t\tattr->valid = 1;\n \t\treturn;\n@@ -2377,7 +2379,7 @@ struct field_modify_info modify_tcp[] = {\n \tstruct mlx5_flow_dv_encap_decap_resource *cache_resource;\n \tstruct mlx5dv_dr_domain *domain;\n \n-\tresource->flags = dev_flow->group ? 0 : 1;\n+\tresource->flags = dev_flow->dv.group ? 0 : 1;\n \tif (resource->ft_type == MLX5DV_FLOW_TABLE_TYPE_FDB)\n \t\tdomain = sh->fdb_domain;\n \telse if (resource->ft_type == MLX5DV_FLOW_TABLE_TYPE_NIC_RX)\n@@ -2397,7 +2399,7 @@ struct field_modify_info modify_tcp[] = {\n \t\t\t\t(void *)cache_resource,\n \t\t\t\trte_atomic32_read(&cache_resource->refcnt));\n \t\t\trte_atomic32_inc(&cache_resource->refcnt);\n-\t\t\tdev_flow->dv.encap_decap = cache_resource;\n+\t\t\tdev_flow->handle.dvh.encap_decap = cache_resource;\n \t\t\treturn 0;\n \t\t}\n \t}\n@@ -2423,7 +2425,7 @@ struct field_modify_info modify_tcp[] = {\n \trte_atomic32_init(&cache_resource->refcnt);\n \trte_atomic32_inc(&cache_resource->refcnt);\n \tLIST_INSERT_HEAD(&sh->encaps_decaps, cache_resource, next);\n-\tdev_flow->dv.encap_decap = cache_resource;\n+\tdev_flow->handle.dvh.encap_decap = cache_resource;\n \tDRV_LOG(DEBUG, \"new encap/decap resource %p: refcnt %d++\",\n \t\t(void *)cache_resource,\n \t\trte_atomic32_read(&cache_resource->refcnt));\n@@ -2474,7 +2476,7 @@ struct field_modify_info modify_tcp[] = {\n \t\t\t(void *)&tbl_data->jump, cnt);\n \t}\n \trte_atomic32_inc(&tbl_data->jump.refcnt);\n-\tdev_flow->dv.jump = &tbl_data->jump;\n+\tdev_flow->handle.dvh.jump = &tbl_data->jump;\n \treturn 0;\n }\n \n@@ -2512,7 +2514,7 @@ struct field_modify_info modify_tcp[] = {\n \t\t\t\t(void *)cache_resource,\n \t\t\t\trte_atomic32_read(&cache_resource->refcnt));\n \t\t\trte_atomic32_inc(&cache_resource->refcnt);\n-\t\t\tdev_flow->dv.port_id_action = cache_resource;\n+\t\t\tdev_flow->handle.dvh.port_id_action = cache_resource;\n \t\t\treturn 0;\n \t\t}\n \t}\n@@ -2540,7 +2542,7 @@ struct field_modify_info modify_tcp[] = {\n \trte_atomic32_init(&cache_resource->refcnt);\n \trte_atomic32_inc(&cache_resource->refcnt);\n \tLIST_INSERT_HEAD(&sh->port_id_action_list, cache_resource, next);\n-\tdev_flow->dv.port_id_action = cache_resource;\n+\tdev_flow->handle.dvh.port_id_action = cache_resource;\n \tDRV_LOG(DEBUG, \"new port id action resource %p: refcnt %d++\",\n \t\t(void *)cache_resource,\n \t\trte_atomic32_read(&cache_resource->refcnt));\n@@ -2583,7 +2585,7 @@ struct field_modify_info modify_tcp[] = {\n \t\t\t\t(void *)cache_resource,\n \t\t\t\trte_atomic32_read(&cache_resource->refcnt));\n \t\t\trte_atomic32_inc(&cache_resource->refcnt);\n-\t\t\tdev_flow->dv.push_vlan_res = cache_resource;\n+\t\t\tdev_flow->handle.dvh.push_vlan_res = cache_resource;\n \t\t\treturn 0;\n \t\t}\n \t}\n@@ -2612,7 +2614,7 @@ struct field_modify_info modify_tcp[] = {\n \trte_atomic32_init(&cache_resource->refcnt);\n \trte_atomic32_inc(&cache_resource->refcnt);\n \tLIST_INSERT_HEAD(&sh->push_vlan_action_list, cache_resource, next);\n-\tdev_flow->dv.push_vlan_res = cache_resource;\n+\tdev_flow->handle.dvh.push_vlan_res = cache_resource;\n \tDRV_LOG(DEBUG, \"new push vlan action resource %p: refcnt %d++\",\n \t\t(void *)cache_resource,\n \t\trte_atomic32_read(&cache_resource->refcnt));\n@@ -3699,8 +3701,8 @@ struct field_modify_info modify_tcp[] = {\n \tstruct mlx5dv_dr_domain *ns;\n \tuint32_t actions_len;\n \n-\tresource->flags =\n-\t\tdev_flow->group ? 0 : MLX5DV_DR_ACTION_FLAGS_ROOT_LEVEL;\n+\tresource->flags = dev_flow->dv.group ? 0 :\n+\t\t\t  MLX5DV_DR_ACTION_FLAGS_ROOT_LEVEL;\n \tif (resource->actions_num > flow_dv_modify_hdr_action_max(dev,\n \t\t\t\t    resource->flags))\n \t\treturn rte_flow_error_set(error, EOVERFLOW,\n@@ -3725,7 +3727,7 @@ struct field_modify_info modify_tcp[] = {\n \t\t\t\t(void *)cache_resource,\n \t\t\t\trte_atomic32_read(&cache_resource->refcnt));\n \t\t\trte_atomic32_inc(&cache_resource->refcnt);\n-\t\t\tdev_flow->dv.modify_hdr = cache_resource;\n+\t\t\tdev_flow->handle.dvh.modify_hdr = cache_resource;\n \t\t\treturn 0;\n \t\t}\n \t}\n@@ -3752,7 +3754,7 @@ struct field_modify_info modify_tcp[] = {\n \trte_atomic32_init(&cache_resource->refcnt);\n \trte_atomic32_inc(&cache_resource->refcnt);\n \tLIST_INSERT_HEAD(&sh->modify_cmds, cache_resource, next);\n-\tdev_flow->dv.modify_hdr = cache_resource;\n+\tdev_flow->handle.dvh.modify_hdr = cache_resource;\n \tDRV_LOG(DEBUG, \"new modify-header resource %p: refcnt %d++\",\n \t\t(void *)cache_resource,\n \t\trte_atomic32_read(&cache_resource->refcnt));\n@@ -5236,7 +5238,7 @@ struct field_modify_info modify_tcp[] = {\n \t}\n \tdev_flow->dv.value.size = MLX5_ST_SZ_BYTES(fte_match_param);\n \tdev_flow->ingress = attr->ingress;\n-\tdev_flow->transfer = attr->transfer;\n+\tdev_flow->dv.transfer = attr->transfer;\n \treturn dev_flow;\n }\n \n@@ -5392,7 +5394,7 @@ struct field_modify_info modify_tcp[] = {\n \t\t * This is workaround, masks are not supported,\n \t\t * and pre-validated.\n \t\t */\n-\t\tdev_flow->dv.vf_vlan.tag =\n+\t\tdev_flow->handle.vf_vlan.tag =\n \t\t\trte_be_to_cpu_16(vlan_v->tci) & 0x0fff;\n \t}\n \ttci_m = rte_be_to_cpu_16(vlan_m->tci);\n@@ -6893,7 +6895,7 @@ struct field_modify_info modify_tcp[] = {\n \t\t\t\t(void *)cache_matcher,\n \t\t\t\trte_atomic32_read(&cache_matcher->refcnt));\n \t\t\trte_atomic32_inc(&cache_matcher->refcnt);\n-\t\t\tdev_flow->dv.matcher = cache_matcher;\n+\t\t\tdev_flow->handle.dvh.matcher = cache_matcher;\n \t\t\t/* old matcher should not make the table ref++. */\n \t\t\tflow_dv_tbl_resource_release(dev, tbl);\n \t\t\treturn 0;\n@@ -6930,7 +6932,7 @@ struct field_modify_info modify_tcp[] = {\n \t/* only matcher ref++, table ref++ already done above in get API. */\n \trte_atomic32_inc(&cache_matcher->refcnt);\n \tLIST_INSERT_HEAD(&tbl_data->matchers, cache_matcher, next);\n-\tdev_flow->dv.matcher = cache_matcher;\n+\tdev_flow->handle.dvh.matcher = cache_matcher;\n \tDRV_LOG(DEBUG, \"%s group %u priority %hd new %s matcher %p: refcnt %d\",\n \t\tkey->domain ? \"FDB\" : \"NIC\", key->table_id,\n \t\tcache_matcher->priority,\n@@ -6972,7 +6974,7 @@ struct field_modify_info modify_tcp[] = {\n \t\tcache_resource = container_of\n \t\t\t(entry, struct mlx5_flow_dv_tag_resource, entry);\n \t\trte_atomic32_inc(&cache_resource->refcnt);\n-\t\tdev_flow->dv.tag_resource = cache_resource;\n+\t\tdev_flow->handle.dvh.tag_resource = cache_resource;\n \t\tDRV_LOG(DEBUG, \"cached tag resource %p: refcnt now %d++\",\n \t\t\t(void *)cache_resource,\n \t\t\trte_atomic32_read(&cache_resource->refcnt));\n@@ -7001,7 +7003,7 @@ struct field_modify_info modify_tcp[] = {\n \t\t\t\t\t  RTE_FLOW_ERROR_TYPE_UNSPECIFIED,\n \t\t\t\t\t  NULL, \"cannot insert tag\");\n \t}\n-\tdev_flow->dv.tag_resource = cache_resource;\n+\tdev_flow->handle.dvh.tag_resource = cache_resource;\n \tDRV_LOG(DEBUG, \"new tag resource %p: refcnt now %d++\",\n \t\t(void *)cache_resource,\n \t\trte_atomic32_read(&cache_resource->refcnt));\n@@ -7146,7 +7148,7 @@ struct field_modify_info modify_tcp[] = {\n flow_dv_hashfields_set(struct mlx5_flow *dev_flow)\n {\n \tstruct rte_flow *flow = dev_flow->flow;\n-\tuint64_t items = dev_flow->layers;\n+\tuint64_t items = dev_flow->handle.layers;\n \tint rss_inner = 0;\n \tuint64_t rss_types = rte_eth_rss_hf_refine(flow->rss.types);\n \n@@ -7271,7 +7273,7 @@ struct field_modify_info modify_tcp[] = {\n \t\t\t\t       !!priv->fdb_def_rule, &table, error);\n \tif (ret)\n \t\treturn ret;\n-\tdev_flow->group = table;\n+\tdev_flow->dv.group = table;\n \tif (attr->transfer)\n \t\tmhdr_res->ft_type = MLX5DV_FLOW_TABLE_TYPE_FDB;\n \tif (priority == MLX5_FLOW_PRIO_RSVD)\n@@ -7304,7 +7306,7 @@ struct field_modify_info modify_tcp[] = {\n \t\t\t    (dev, &port_id_resource, dev_flow, error))\n \t\t\t\treturn -rte_errno;\n \t\t\tdev_flow->dv.actions[actions_n++] =\n-\t\t\t\tdev_flow->dv.port_id_action->action;\n+\t\t\t\tdev_flow->handle.dvh.port_id_action->action;\n \t\t\taction_flags |= MLX5_FLOW_ACTION_PORT_ID;\n \t\t\tbreak;\n \t\tcase RTE_FLOW_ACTION_TYPE_FLAG:\n@@ -7322,12 +7324,12 @@ struct field_modify_info modify_tcp[] = {\n \t\t\t\tbreak;\n \t\t\t}\n \t\t\ttag_be = mlx5_flow_mark_set(MLX5_FLOW_MARK_DEFAULT);\n-\t\t\tif (!dev_flow->dv.tag_resource)\n+\t\t\tif (!dev_flow->handle.dvh.tag_resource)\n \t\t\t\tif (flow_dv_tag_resource_register\n \t\t\t\t    (dev, tag_be, dev_flow, error))\n \t\t\t\t\treturn -rte_errno;\n \t\t\tdev_flow->dv.actions[actions_n++] =\n-\t\t\t\tdev_flow->dv.tag_resource->action;\n+\t\t\t\tdev_flow->handle.dvh.tag_resource->action;\n \t\t\tbreak;\n \t\tcase RTE_FLOW_ACTION_TYPE_MARK:\n \t\t\taction_flags |= MLX5_FLOW_ACTION_MARK;\n@@ -7349,12 +7351,12 @@ struct field_modify_info modify_tcp[] = {\n \t\t\ttag_be = mlx5_flow_mark_set\n \t\t\t      (((const struct rte_flow_action_mark *)\n \t\t\t       (actions->conf))->id);\n-\t\t\tif (!dev_flow->dv.tag_resource)\n+\t\t\tif (!dev_flow->handle.dvh.tag_resource)\n \t\t\t\tif (flow_dv_tag_resource_register\n \t\t\t\t    (dev, tag_be, dev_flow, error))\n \t\t\t\t\treturn -rte_errno;\n \t\t\tdev_flow->dv.actions[actions_n++] =\n-\t\t\t\tdev_flow->dv.tag_resource->action;\n+\t\t\t\tdev_flow->handle.dvh.tag_resource->action;\n \t\t\tbreak;\n \t\tcase RTE_FLOW_ACTION_TYPE_SET_META:\n \t\t\tif (flow_dv_convert_action_set_meta\n@@ -7404,9 +7406,9 @@ struct field_modify_info modify_tcp[] = {\n \t\t\t\tgoto cnt_err;\n \t\t\t}\n \t\t\tflow->counter = flow_dv_counter_alloc(dev,\n-\t\t\t\t\t\t\t      count->shared,\n-\t\t\t\t\t\t\t      count->id,\n-\t\t\t\t\t\t\t      dev_flow->group);\n+\t\t\t\t\t\t\tcount->shared,\n+\t\t\t\t\t\t\tcount->id,\n+\t\t\t\t\t\t\tdev_flow->dv.group);\n \t\t\tif (flow->counter == NULL)\n \t\t\t\tgoto cnt_err;\n \t\t\tdev_flow->dv.actions[actions_n++] =\n@@ -7452,7 +7454,7 @@ struct field_modify_info modify_tcp[] = {\n \t\t\t\t\t    (dev, attr, &vlan, dev_flow, error))\n \t\t\t\treturn -rte_errno;\n \t\t\tdev_flow->dv.actions[actions_n++] =\n-\t\t\t\t\t   dev_flow->dv.push_vlan_res->action;\n+\t\t\t\tdev_flow->handle.dvh.push_vlan_res->action;\n \t\t\taction_flags |= MLX5_FLOW_ACTION_OF_PUSH_VLAN;\n \t\t\tbreak;\n \t\tcase RTE_FLOW_ACTION_TYPE_OF_SET_VLAN_PCP:\n@@ -7479,7 +7481,7 @@ struct field_modify_info modify_tcp[] = {\n \t\t\t\t\t\t\t   error))\n \t\t\t\treturn -rte_errno;\n \t\t\tdev_flow->dv.actions[actions_n++] =\n-\t\t\t\tdev_flow->dv.encap_decap->verbs_action;\n+\t\t\t\tdev_flow->handle.dvh.encap_decap->verbs_action;\n \t\t\taction_flags |= MLX5_FLOW_ACTION_ENCAP;\n \t\t\tbreak;\n \t\tcase RTE_FLOW_ACTION_TYPE_VXLAN_DECAP:\n@@ -7489,7 +7491,7 @@ struct field_modify_info modify_tcp[] = {\n \t\t\t\t\t\t\t   error))\n \t\t\t\treturn -rte_errno;\n \t\t\tdev_flow->dv.actions[actions_n++] =\n-\t\t\t\tdev_flow->dv.encap_decap->verbs_action;\n+\t\t\t\tdev_flow->handle.dvh.encap_decap->verbs_action;\n \t\t\taction_flags |= MLX5_FLOW_ACTION_DECAP;\n \t\t\tbreak;\n \t\tcase RTE_FLOW_ACTION_TYPE_RAW_ENCAP:\n@@ -7499,7 +7501,7 @@ struct field_modify_info modify_tcp[] = {\n \t\t\t\t\t(dev, actions, dev_flow, attr, error))\n \t\t\t\t\treturn -rte_errno;\n \t\t\t\tdev_flow->dv.actions[actions_n++] =\n-\t\t\t\t\tdev_flow->dv.encap_decap->verbs_action;\n+\t\t\t\tdev_flow->handle.dvh.encap_decap->verbs_action;\n \t\t\t} else {\n \t\t\t\t/* Handle encap without preceding decap. */\n \t\t\t\tif (flow_dv_create_action_l2_encap\n@@ -7507,7 +7509,7 @@ struct field_modify_info modify_tcp[] = {\n \t\t\t\t     error))\n \t\t\t\t\treturn -rte_errno;\n \t\t\t\tdev_flow->dv.actions[actions_n++] =\n-\t\t\t\t\tdev_flow->dv.encap_decap->verbs_action;\n+\t\t\t\tdev_flow->handle.dvh.encap_decap->verbs_action;\n \t\t\t}\n \t\t\taction_flags |= MLX5_FLOW_ACTION_ENCAP;\n \t\t\tbreak;\n@@ -7519,7 +7521,7 @@ struct field_modify_info modify_tcp[] = {\n \t\t\t\t    (dev, dev_flow, attr->transfer, error))\n \t\t\t\t\treturn -rte_errno;\n \t\t\t\tdev_flow->dv.actions[actions_n++] =\n-\t\t\t\t\tdev_flow->dv.encap_decap->verbs_action;\n+\t\t\t\tdev_flow->handle.dvh.encap_decap->verbs_action;\n \t\t\t}\n \t\t\t/* If decap is followed by encap, handle it at encap. */\n \t\t\taction_flags |= MLX5_FLOW_ACTION_DECAP;\n@@ -7551,7 +7553,7 @@ struct field_modify_info modify_tcp[] = {\n \t\t\t\t\t\t \"cannot create jump action.\");\n \t\t\t}\n \t\t\tdev_flow->dv.actions[actions_n++] =\n-\t\t\t\tdev_flow->dv.jump->action;\n+\t\t\t\tdev_flow->handle.dvh.jump->action;\n \t\t\taction_flags |= MLX5_FLOW_ACTION_JUMP;\n \t\t\tbreak;\n \t\tcase RTE_FLOW_ACTION_TYPE_SET_MAC_SRC:\n@@ -7684,7 +7686,7 @@ struct field_modify_info modify_tcp[] = {\n \t\t\t\t\t(dev, mhdr_res, dev_flow, error))\n \t\t\t\t\treturn -rte_errno;\n \t\t\t\tdev_flow->dv.actions[modify_action_position] =\n-\t\t\t\t\tdev_flow->dv.modify_hdr->verbs_action;\n+\t\t\t\tdev_flow->handle.dvh.modify_hdr->verbs_action;\n \t\t\t}\n \t\t\tbreak;\n \t\tdefault:\n@@ -7695,7 +7697,7 @@ struct field_modify_info modify_tcp[] = {\n \t\t\tmodify_action_position = actions_n++;\n \t}\n \tdev_flow->dv.actions_n = actions_n;\n-\tdev_flow->actions = action_flags;\n+\tdev_flow->handle.act_flags = action_flags;\n \tfor (; items->type != RTE_FLOW_ITEM_TYPE_END; items++) {\n \t\tint tunnel = !!(item_flags & MLX5_FLOW_LAYER_TUNNEL);\n \t\tint item_type = items->type;\n@@ -7728,7 +7730,7 @@ struct field_modify_info modify_tcp[] = {\n \t\t\t\t\t\t  &item_flags, &tunnel);\n \t\t\tflow_dv_translate_item_ipv4(match_mask, match_value,\n \t\t\t\t\t\t    items, item_flags, tunnel,\n-\t\t\t\t\t\t    dev_flow->group);\n+\t\t\t\t\t\t    dev_flow->dv.group);\n \t\t\tmatcher.priority = MLX5_PRIORITY_MAP_L3;\n \t\t\tlast_item = tunnel ? MLX5_FLOW_LAYER_INNER_L3_IPV4 :\n \t\t\t\t\t     MLX5_FLOW_LAYER_OUTER_L3_IPV4;\n@@ -7751,7 +7753,7 @@ struct field_modify_info modify_tcp[] = {\n \t\t\t\t\t\t  &item_flags, &tunnel);\n \t\t\tflow_dv_translate_item_ipv6(match_mask, match_value,\n \t\t\t\t\t\t    items, item_flags, tunnel,\n-\t\t\t\t\t\t    dev_flow->group);\n+\t\t\t\t\t\t    dev_flow->dv.group);\n \t\t\tmatcher.priority = MLX5_PRIORITY_MAP_L3;\n \t\t\tlast_item = tunnel ? MLX5_FLOW_LAYER_INNER_L3_IPV6 :\n \t\t\t\t\t     MLX5_FLOW_LAYER_OUTER_L3_IPV6;\n@@ -7900,7 +7902,7 @@ struct field_modify_info modify_tcp[] = {\n \t * Layers may be already initialized from prefix flow if this dev_flow\n \t * is the suffix flow.\n \t */\n-\tdev_flow->layers |= item_flags;\n+\tdev_flow->handle.layers |= item_flags;\n \tif (action_flags & MLX5_FLOW_ACTION_RSS)\n \t\tflow_dv_hashfields_set(dev_flow);\n \t/* Register matcher. */\n@@ -7911,7 +7913,7 @@ struct field_modify_info modify_tcp[] = {\n \t/* reserved field no needs to be set to 0 here. */\n \ttbl_key.domain = attr->transfer;\n \ttbl_key.direction = attr->egress;\n-\ttbl_key.table_id = dev_flow->group;\n+\ttbl_key.table_id = dev_flow->dv.group;\n \tif (flow_dv_matcher_register(dev, &matcher, &tbl_key, dev_flow, error))\n \t\treturn -rte_errno;\n \treturn 0;\n@@ -7935,21 +7937,25 @@ struct field_modify_info modify_tcp[] = {\n __flow_dv_apply(struct rte_eth_dev *dev, struct rte_flow *flow,\n \t\tstruct rte_flow_error *error)\n {\n-\tstruct mlx5_flow_dv *dv;\n+\tstruct mlx5_flow_resource_dv *dv;\n+\tstruct mlx5_flow_handle *dh;\n+\tstruct mlx5_flow_handle_dv *dv_h;\n \tstruct mlx5_flow *dev_flow;\n \tstruct mlx5_priv *priv = dev->data->dev_private;\n \tint n;\n \tint err;\n \n \tLIST_FOREACH(dev_flow, &flow->dev_flows, next) {\n+\t\tdh = &dev_flow->handle;\n \t\tdv = &dev_flow->dv;\n \t\tn = dv->actions_n;\n-\t\tif (dev_flow->actions & MLX5_FLOW_ACTION_DROP) {\n-\t\t\tif (dev_flow->transfer) {\n+\t\tdv_h = &dh->dvh;\n+\t\tif (dh->act_flags & MLX5_FLOW_ACTION_DROP) {\n+\t\t\tif (dv->transfer) {\n \t\t\t\tdv->actions[n++] = priv->sh->esw_drop_action;\n \t\t\t} else {\n-\t\t\t\tdv->hrxq = mlx5_hrxq_drop_new(dev);\n-\t\t\t\tif (!dv->hrxq) {\n+\t\t\t\tdh->hrxq = mlx5_hrxq_drop_new(dev);\n+\t\t\t\tif (!dh->hrxq) {\n \t\t\t\t\trte_flow_error_set\n \t\t\t\t\t\t(error, errno,\n \t\t\t\t\t\t RTE_FLOW_ERROR_TYPE_UNSPECIFIED,\n@@ -7957,9 +7963,9 @@ struct field_modify_info modify_tcp[] = {\n \t\t\t\t\t\t \"cannot get drop hash queue\");\n \t\t\t\t\tgoto error;\n \t\t\t\t}\n-\t\t\t\tdv->actions[n++] = dv->hrxq->action;\n+\t\t\t\tdv->actions[n++] = dh->hrxq->action;\n \t\t\t}\n-\t\t} else if (dev_flow->actions &\n+\t\t} else if (dh->act_flags &\n \t\t\t   (MLX5_FLOW_ACTION_QUEUE | MLX5_FLOW_ACTION_RSS)) {\n \t\t\tstruct mlx5_hrxq *hrxq;\n \n@@ -7976,7 +7982,7 @@ struct field_modify_info modify_tcp[] = {\n \t\t\t\t\t dev_flow->hash_fields,\n \t\t\t\t\t (*flow->rss.queue),\n \t\t\t\t\t flow->rss.queue_num,\n-\t\t\t\t\t !!(dev_flow->layers &\n+\t\t\t\t\t !!(dev_flow->handle.layers &\n \t\t\t\t\t    MLX5_FLOW_LAYER_TUNNEL));\n \t\t\t}\n \t\t\tif (!hrxq) {\n@@ -7986,14 +7992,14 @@ struct field_modify_info modify_tcp[] = {\n \t\t\t\t\t \"cannot get hash queue\");\n \t\t\t\tgoto error;\n \t\t\t}\n-\t\t\tdv->hrxq = hrxq;\n-\t\t\tdv->actions[n++] = dv->hrxq->action;\n+\t\t\tdh->hrxq = hrxq;\n+\t\t\tdv->actions[n++] = dh->hrxq->action;\n \t\t}\n-\t\tdv->flow =\n-\t\t\tmlx5_glue->dv_create_flow(dv->matcher->matcher_object,\n+\t\tdh->ib_flow =\n+\t\t\tmlx5_glue->dv_create_flow(dv_h->matcher->matcher_object,\n \t\t\t\t\t\t  (void *)&dv->value, n,\n \t\t\t\t\t\t  dv->actions);\n-\t\tif (!dv->flow) {\n+\t\tif (!dh->ib_flow) {\n \t\t\trte_flow_error_set(error, errno,\n \t\t\t\t\t   RTE_FLOW_ERROR_TYPE_UNSPECIFIED,\n \t\t\t\t\t   NULL,\n@@ -8001,32 +8007,30 @@ struct field_modify_info modify_tcp[] = {\n \t\t\tgoto error;\n \t\t}\n \t\tif (priv->vmwa_context &&\n-\t\t    dev_flow->dv.vf_vlan.tag &&\n-\t\t    !dev_flow->dv.vf_vlan.created) {\n+\t\t    dh->vf_vlan.tag && !dh->vf_vlan.created) {\n \t\t\t/*\n \t\t\t * The rule contains the VLAN pattern.\n \t\t\t * For VF we are going to create VLAN\n \t\t\t * interface to make hypervisor set correct\n \t\t\t * e-Switch vport context.\n \t\t\t */\n-\t\t\tmlx5_vlan_vmwa_acquire(dev, &dev_flow->dv.vf_vlan);\n+\t\t\tmlx5_vlan_vmwa_acquire(dev, &dh->vf_vlan);\n \t\t}\n \t}\n \treturn 0;\n error:\n \terr = rte_errno; /* Save rte_errno before cleanup. */\n \tLIST_FOREACH(dev_flow, &flow->dev_flows, next) {\n-\t\tstruct mlx5_flow_dv *dv = &dev_flow->dv;\n-\t\tif (dv->hrxq) {\n-\t\t\tif (dev_flow->actions & MLX5_FLOW_ACTION_DROP)\n+\t\tstruct mlx5_flow_handle *dh_tmp = &dev_flow->handle;\n+\t\tif (dh_tmp->hrxq) {\n+\t\t\tif (dh_tmp->act_flags & MLX5_FLOW_ACTION_DROP)\n \t\t\t\tmlx5_hrxq_drop_release(dev);\n \t\t\telse\n-\t\t\t\tmlx5_hrxq_release(dev, dv->hrxq);\n-\t\t\tdv->hrxq = NULL;\n+\t\t\t\tmlx5_hrxq_release(dev, dh_tmp->hrxq);\n+\t\t\tdh_tmp->hrxq = NULL;\n \t\t}\n-\t\tif (dev_flow->dv.vf_vlan.tag &&\n-\t\t    dev_flow->dv.vf_vlan.created)\n-\t\t\tmlx5_vlan_vmwa_release(dev, &dev_flow->dv.vf_vlan);\n+\t\tif (dh_tmp->vf_vlan.tag && dh_tmp->vf_vlan.created)\n+\t\t\tmlx5_vlan_vmwa_release(dev, &dh_tmp->vf_vlan);\n \t}\n \trte_errno = err; /* Restore rte_errno. */\n \treturn -rte_errno;\n@@ -8047,7 +8051,7 @@ struct field_modify_info modify_tcp[] = {\n flow_dv_matcher_release(struct rte_eth_dev *dev,\n \t\t\tstruct mlx5_flow *flow)\n {\n-\tstruct mlx5_flow_dv_matcher *matcher = flow->dv.matcher;\n+\tstruct mlx5_flow_dv_matcher *matcher = flow->handle.dvh.matcher;\n \n \tMLX5_ASSERT(matcher->matcher_object);\n \tDRV_LOG(DEBUG, \"port %u matcher %p: refcnt %d--\",\n@@ -8080,7 +8084,7 @@ struct field_modify_info modify_tcp[] = {\n flow_dv_encap_decap_resource_release(struct mlx5_flow *flow)\n {\n \tstruct mlx5_flow_dv_encap_decap_resource *cache_resource =\n-\t\t\t\t\t\tflow->dv.encap_decap;\n+\t\t\t\t\t\tflow->handle.dvh.encap_decap;\n \n \tMLX5_ASSERT(cache_resource->verbs_action);\n \tDRV_LOG(DEBUG, \"encap/decap resource %p: refcnt %d--\",\n@@ -8113,7 +8117,8 @@ struct field_modify_info modify_tcp[] = {\n flow_dv_jump_tbl_resource_release(struct rte_eth_dev *dev,\n \t\t\t\t  struct mlx5_flow *flow)\n {\n-\tstruct mlx5_flow_dv_jump_tbl_resource *cache_resource = flow->dv.jump;\n+\tstruct mlx5_flow_dv_jump_tbl_resource *cache_resource =\n+\t\t\t\t\t\tflow->handle.dvh.jump;\n \tstruct mlx5_flow_tbl_data_entry *tbl_data =\n \t\t\tcontainer_of(cache_resource,\n \t\t\t\t     struct mlx5_flow_tbl_data_entry, jump);\n@@ -8147,7 +8152,7 @@ struct field_modify_info modify_tcp[] = {\n flow_dv_modify_hdr_resource_release(struct mlx5_flow *flow)\n {\n \tstruct mlx5_flow_dv_modify_hdr_resource *cache_resource =\n-\t\t\t\t\t\tflow->dv.modify_hdr;\n+\t\t\t\t\t\tflow->handle.dvh.modify_hdr;\n \n \tMLX5_ASSERT(cache_resource->verbs_action);\n \tDRV_LOG(DEBUG, \"modify-header resource %p: refcnt %d--\",\n@@ -8178,7 +8183,7 @@ struct field_modify_info modify_tcp[] = {\n flow_dv_port_id_action_resource_release(struct mlx5_flow *flow)\n {\n \tstruct mlx5_flow_dv_port_id_action_resource *cache_resource =\n-\t\tflow->dv.port_id_action;\n+\t\t\t\t\t\tflow->handle.dvh.port_id_action;\n \n \tMLX5_ASSERT(cache_resource->action);\n \tDRV_LOG(DEBUG, \"port ID action resource %p: refcnt %d--\",\n@@ -8209,7 +8214,7 @@ struct field_modify_info modify_tcp[] = {\n flow_dv_push_vlan_action_resource_release(struct mlx5_flow *flow)\n {\n \tstruct mlx5_flow_dv_push_vlan_action_resource *cache_resource =\n-\t\tflow->dv.push_vlan_res;\n+\t\t\t\t\t\tflow->handle.dvh.push_vlan_res;\n \n \tMLX5_ASSERT(cache_resource->action);\n \tDRV_LOG(DEBUG, \"push VLAN action resource %p: refcnt %d--\",\n@@ -8239,27 +8244,26 @@ struct field_modify_info modify_tcp[] = {\n static void\n __flow_dv_remove(struct rte_eth_dev *dev, struct rte_flow *flow)\n {\n-\tstruct mlx5_flow_dv *dv;\n+\tstruct mlx5_flow_handle *dh;\n \tstruct mlx5_flow *dev_flow;\n \n \tif (!flow)\n \t\treturn;\n \tLIST_FOREACH(dev_flow, &flow->dev_flows, next) {\n-\t\tdv = &dev_flow->dv;\n-\t\tif (dv->flow) {\n-\t\t\tclaim_zero(mlx5_glue->dv_destroy_flow(dv->flow));\n-\t\t\tdv->flow = NULL;\n+\t\tdh = &dev_flow->handle;\n+\t\tif (dh->ib_flow) {\n+\t\t\tclaim_zero(mlx5_glue->dv_destroy_flow(dh->ib_flow));\n+\t\t\tdh->ib_flow = NULL;\n \t\t}\n-\t\tif (dv->hrxq) {\n-\t\t\tif (dev_flow->actions & MLX5_FLOW_ACTION_DROP)\n+\t\tif (dh->hrxq) {\n+\t\t\tif (dev_flow->handle.act_flags & MLX5_FLOW_ACTION_DROP)\n \t\t\t\tmlx5_hrxq_drop_release(dev);\n \t\t\telse\n-\t\t\t\tmlx5_hrxq_release(dev, dv->hrxq);\n-\t\t\tdv->hrxq = NULL;\n+\t\t\t\tmlx5_hrxq_release(dev, dh->hrxq);\n+\t\t\tdh->hrxq = NULL;\n \t\t}\n-\t\tif (dev_flow->dv.vf_vlan.tag &&\n-\t\t    dev_flow->dv.vf_vlan.created)\n-\t\t\tmlx5_vlan_vmwa_release(dev, &dev_flow->dv.vf_vlan);\n+\t\tif (dh->vf_vlan.tag && dh->vf_vlan.created)\n+\t\t\tmlx5_vlan_vmwa_release(dev, &dh->vf_vlan);\n \t}\n }\n \n@@ -8291,20 +8295,21 @@ struct field_modify_info modify_tcp[] = {\n \twhile (!LIST_EMPTY(&flow->dev_flows)) {\n \t\tdev_flow = LIST_FIRST(&flow->dev_flows);\n \t\tLIST_REMOVE(dev_flow, next);\n-\t\tif (dev_flow->dv.matcher)\n+\t\tif (dev_flow->handle.dvh.matcher)\n \t\t\tflow_dv_matcher_release(dev, dev_flow);\n-\t\tif (dev_flow->dv.encap_decap)\n+\t\tif (dev_flow->handle.dvh.encap_decap)\n \t\t\tflow_dv_encap_decap_resource_release(dev_flow);\n-\t\tif (dev_flow->dv.modify_hdr)\n+\t\tif (dev_flow->handle.dvh.modify_hdr)\n \t\t\tflow_dv_modify_hdr_resource_release(dev_flow);\n-\t\tif (dev_flow->dv.jump)\n+\t\tif (dev_flow->handle.dvh.jump)\n \t\t\tflow_dv_jump_tbl_resource_release(dev, dev_flow);\n-\t\tif (dev_flow->dv.port_id_action)\n+\t\tif (dev_flow->handle.dvh.port_id_action)\n \t\t\tflow_dv_port_id_action_resource_release(dev_flow);\n-\t\tif (dev_flow->dv.push_vlan_res)\n+\t\tif (dev_flow->handle.dvh.push_vlan_res)\n \t\t\tflow_dv_push_vlan_action_resource_release(dev_flow);\n-\t\tif (dev_flow->dv.tag_resource)\n-\t\t\tflow_dv_tag_release(dev, dev_flow->dv.tag_resource);\n+\t\tif (dev_flow->handle.dvh.tag_resource)\n+\t\t\tflow_dv_tag_release(dev,\n+\t\t\t\t\tdev_flow->handle.dvh.tag_resource);\n \t\trte_free(dev_flow);\n \t}\n }\ndiff --git a/drivers/net/mlx5/mlx5_flow_verbs.c b/drivers/net/mlx5/mlx5_flow_verbs.c\nindex 459e7b6..08185ec 100644\n--- a/drivers/net/mlx5/mlx5_flow_verbs.c\n+++ b/drivers/net/mlx5/mlx5_flow_verbs.c\n@@ -253,7 +253,8 @@\n  *   Size in bytes of the specification to copy.\n  */\n static void\n-flow_verbs_spec_add(struct mlx5_flow_verbs *verbs, void *src, unsigned int size)\n+flow_verbs_spec_add(struct mlx5_flow_resource_verbs *verbs,\n+\t\t    void *src, unsigned int size)\n {\n \tvoid *dst;\n \n@@ -393,7 +394,7 @@\n \telse\n \t\tflow_verbs_item_vlan_update(dev_flow->verbs.attr, &eth);\n \tif (!tunnel)\n-\t\tdev_flow->verbs.vf_vlan.tag =\n+\t\tdev_flow->handle.vf_vlan.tag =\n \t\t\trte_be_to_cpu_16(spec->tci) & 0x0fff;\n }\n \n@@ -743,7 +744,7 @@\n \t\t\t      const struct rte_flow_item *item __rte_unused,\n \t\t\t      uint64_t item_flags)\n {\n-\tstruct mlx5_flow_verbs *verbs = &dev_flow->verbs;\n+\tstruct mlx5_flow_resource_verbs *verbs = &dev_flow->verbs;\n #ifndef HAVE_IBV_DEVICE_MPLS_SUPPORT\n \tunsigned int size = sizeof(struct ibv_flow_spec_tunnel);\n \tstruct ibv_flow_spec_tunnel tunnel = {\n@@ -1418,7 +1419,7 @@\n \tdev_flow->verbs.attr = (void *)(dev_flow + 1);\n \tdev_flow->verbs.specs = (void *)(dev_flow->verbs.attr + 1);\n \tdev_flow->ingress = attr->ingress;\n-\tdev_flow->transfer = attr->transfer;\n+\t/* Need to set transfer attribute: not supported in Verbs mode. */\n \treturn dev_flow;\n }\n \n@@ -1498,7 +1499,7 @@\n \t\t\t\t\t\t  \"action not supported\");\n \t\t}\n \t}\n-\tdev_flow->actions = action_flags;\n+\tdev_flow->handle.act_flags = action_flags;\n \tfor (; items->type != RTE_FLOW_ITEM_TYPE_END; items++) {\n \t\tint tunnel = !!(item_flags & MLX5_FLOW_LAYER_TUNNEL);\n \n@@ -1600,7 +1601,7 @@\n \t\t\t\t\t\t  \"item not supported\");\n \t\t}\n \t}\n-\tdev_flow->layers = item_flags;\n+\tdev_flow->handle.layers = item_flags;\n \tdev_flow->verbs.attr->priority =\n \t\tmlx5_flow_adjust_priority(dev, priority, subpriority);\n \tdev_flow->verbs.attr->port = (uint8_t)priv->ibv_port;\n@@ -1618,28 +1619,26 @@\n static void\n flow_verbs_remove(struct rte_eth_dev *dev, struct rte_flow *flow)\n {\n-\tstruct mlx5_flow_verbs *verbs;\n+\tstruct mlx5_flow_handle *dh;\n \tstruct mlx5_flow *dev_flow;\n \n \tif (!flow)\n \t\treturn;\n \tLIST_FOREACH(dev_flow, &flow->dev_flows, next) {\n-\t\tverbs = &dev_flow->verbs;\n-\t\tif (verbs->flow) {\n-\t\t\tclaim_zero(mlx5_glue->destroy_flow(verbs->flow));\n-\t\t\tverbs->flow = NULL;\n+\t\tdh = &dev_flow->handle;\n+\t\tif (dh->ib_flow) {\n+\t\t\tclaim_zero(mlx5_glue->destroy_flow(dh->ib_flow));\n+\t\t\tdh->ib_flow = NULL;\n \t\t}\n-\t\tif (verbs->hrxq) {\n-\t\t\tif (dev_flow->actions & MLX5_FLOW_ACTION_DROP)\n+\t\tif (dh->hrxq) {\n+\t\t\tif (dev_flow->handle.act_flags & MLX5_FLOW_ACTION_DROP)\n \t\t\t\tmlx5_hrxq_drop_release(dev);\n \t\t\telse\n-\t\t\t\tmlx5_hrxq_release(dev, verbs->hrxq);\n-\t\t\tverbs->hrxq = NULL;\n-\t\t}\n-\t\tif (dev_flow->verbs.vf_vlan.tag &&\n-\t\t    dev_flow->verbs.vf_vlan.created) {\n-\t\t\tmlx5_vlan_vmwa_release(dev, &dev_flow->verbs.vf_vlan);\n+\t\t\t\tmlx5_hrxq_release(dev, dh->hrxq);\n+\t\t\tdh->hrxq = NULL;\n \t\t}\n+\t\tif (dh->vf_vlan.tag && dh->vf_vlan.created)\n+\t\t\tmlx5_vlan_vmwa_release(dev, &dh->vf_vlan);\n \t}\n }\n \n@@ -1688,15 +1687,15 @@\n \t\t struct rte_flow_error *error)\n {\n \tstruct mlx5_priv *priv = dev->data->dev_private;\n-\tstruct mlx5_flow_verbs *verbs;\n+\tstruct mlx5_flow_handle *dh;\n \tstruct mlx5_flow *dev_flow;\n \tint err;\n \n \tLIST_FOREACH(dev_flow, &flow->dev_flows, next) {\n-\t\tverbs = &dev_flow->verbs;\n-\t\tif (dev_flow->actions & MLX5_FLOW_ACTION_DROP) {\n-\t\t\tverbs->hrxq = mlx5_hrxq_drop_new(dev);\n-\t\t\tif (!verbs->hrxq) {\n+\t\tdh = &dev_flow->handle;\n+\t\tif (dev_flow->handle.act_flags & MLX5_FLOW_ACTION_DROP) {\n+\t\t\tdh->hrxq = mlx5_hrxq_drop_new(dev);\n+\t\t\tif (!dh->hrxq) {\n \t\t\t\trte_flow_error_set\n \t\t\t\t\t(error, errno,\n \t\t\t\t\t RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL,\n@@ -1714,12 +1713,12 @@\n \t\t\t\t\t     flow->rss.queue_num);\n \t\t\tif (!hrxq)\n \t\t\t\thrxq = mlx5_hrxq_new(dev, flow->rss.key,\n-\t\t\t\t\t\t     MLX5_RSS_HASH_KEY_LEN,\n-\t\t\t\t\t\t     dev_flow->hash_fields,\n-\t\t\t\t\t\t     (*flow->rss.queue),\n-\t\t\t\t\t\t     flow->rss.queue_num,\n-\t\t\t\t\t\t     !!(dev_flow->layers &\n-\t\t\t\t\t\t       MLX5_FLOW_LAYER_TUNNEL));\n+\t\t\t\t\t\tMLX5_RSS_HASH_KEY_LEN,\n+\t\t\t\t\t\tdev_flow->hash_fields,\n+\t\t\t\t\t\t(*flow->rss.queue),\n+\t\t\t\t\t\tflow->rss.queue_num,\n+\t\t\t\t\t\t!!(dev_flow->handle.layers &\n+\t\t\t\t\t\tMLX5_FLOW_LAYER_TUNNEL));\n \t\t\tif (!hrxq) {\n \t\t\t\trte_flow_error_set\n \t\t\t\t\t(error, rte_errno,\n@@ -1727,11 +1726,11 @@\n \t\t\t\t\t \"cannot get hash queue\");\n \t\t\t\tgoto error;\n \t\t\t}\n-\t\t\tverbs->hrxq = hrxq;\n+\t\t\tdh->hrxq = hrxq;\n \t\t}\n-\t\tverbs->flow = mlx5_glue->create_flow(verbs->hrxq->qp,\n-\t\t\t\t\t\t     verbs->attr);\n-\t\tif (!verbs->flow) {\n+\t\tdh->ib_flow = mlx5_glue->create_flow(dh->hrxq->qp,\n+\t\t\t\t\t\t     dev_flow->verbs.attr);\n+\t\tif (!dh->ib_flow) {\n \t\t\trte_flow_error_set(error, errno,\n \t\t\t\t\t   RTE_FLOW_ERROR_TYPE_UNSPECIFIED,\n \t\t\t\t\t   NULL,\n@@ -1739,33 +1738,31 @@\n \t\t\tgoto error;\n \t\t}\n \t\tif (priv->vmwa_context &&\n-\t\t    dev_flow->verbs.vf_vlan.tag &&\n-\t\t    !dev_flow->verbs.vf_vlan.created) {\n+\t\t    dev_flow->handle.vf_vlan.tag &&\n+\t\t    !dev_flow->handle.vf_vlan.created) {\n \t\t\t/*\n \t\t\t * The rule contains the VLAN pattern.\n \t\t\t * For VF we are going to create VLAN\n \t\t\t * interface to make hypervisor set correct\n \t\t\t * e-Switch vport context.\n \t\t\t */\n-\t\t\tmlx5_vlan_vmwa_acquire(dev, &dev_flow->verbs.vf_vlan);\n+\t\t\tmlx5_vlan_vmwa_acquire(dev, &dev_flow->handle.vf_vlan);\n \t\t}\n \t}\n \treturn 0;\n error:\n \terr = rte_errno; /* Save rte_errno before cleanup. */\n \tLIST_FOREACH(dev_flow, &flow->dev_flows, next) {\n-\t\tverbs = &dev_flow->verbs;\n-\t\tif (verbs->hrxq) {\n-\t\t\tif (dev_flow->actions & MLX5_FLOW_ACTION_DROP)\n+\t\tdh = &dev_flow->handle;\n+\t\tif (dh->hrxq) {\n+\t\t\tif (dev_flow->handle.act_flags & MLX5_FLOW_ACTION_DROP)\n \t\t\t\tmlx5_hrxq_drop_release(dev);\n \t\t\telse\n-\t\t\t\tmlx5_hrxq_release(dev, verbs->hrxq);\n-\t\t\tverbs->hrxq = NULL;\n-\t\t}\n-\t\tif (dev_flow->verbs.vf_vlan.tag &&\n-\t\t    dev_flow->verbs.vf_vlan.created) {\n-\t\t\tmlx5_vlan_vmwa_release(dev, &dev_flow->verbs.vf_vlan);\n+\t\t\t\tmlx5_hrxq_release(dev, dh->hrxq);\n+\t\t\tdh->hrxq = NULL;\n \t\t}\n+\t\tif (dh->vf_vlan.tag && dh->vf_vlan.created)\n+\t\t\tmlx5_vlan_vmwa_release(dev, &dh->vf_vlan);\n \t}\n \trte_errno = err; /* Restore rte_errno. */\n \treturn -rte_errno;\n",
    "prefixes": [
        "v3",
        "2/4"
    ]
}