get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 47648,
    "url": "http://patches.dpdk.org/api/patches/47648/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1541065053-28436-3-git-send-email-dekelp@mellanox.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": "<1541065053-28436-3-git-send-email-dekelp@mellanox.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1541065053-28436-3-git-send-email-dekelp@mellanox.com",
    "date": "2018-11-01T09:37:28",
    "name": "[v8,2/7] net/mlx5: add VXLAN encap action to Direct Verbs",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "88ba1c306ffb9fba97dcf88ba8ffc819c7c2917d",
    "submitter": {
        "id": 1082,
        "url": "http://patches.dpdk.org/api/people/1082/?format=api",
        "name": "Dekel Peled",
        "email": "dekelp@mellanox.com"
    },
    "delegate": {
        "id": 6624,
        "url": "http://patches.dpdk.org/api/users/6624/?format=api",
        "username": "shahafs",
        "first_name": "Shahaf",
        "last_name": "Shuler",
        "email": "shahafs@mellanox.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1541065053-28436-3-git-send-email-dekelp@mellanox.com/mbox/",
    "series": [
        {
            "id": 2173,
            "url": "http://patches.dpdk.org/api/series/2173/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=2173",
            "date": "2018-10-31T07:10:40",
            "name": "add encap and decap actions to Direct Verbs flow in MLX5 PMD",
            "version": 7,
            "mbox": "http://patches.dpdk.org/series/2173/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/47648/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/47648/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 650215681;\n\tThu,  1 Nov 2018 10:38:35 +0100 (CET)",
            "from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129])\n\tby dpdk.org (Postfix) with ESMTP id B84265587\n\tfor <dev@dpdk.org>; Thu,  1 Nov 2018 10:38:33 +0100 (CET)",
            "from Internal Mail-Server by MTLPINE1 (envelope-from\n\tdekelp@mellanox.com)\n\twith ESMTPS (AES256-SHA encrypted); 1 Nov 2018 11:43:48 +0200",
            "from mtl-vdi-280.wap.labs.mlnx. (mtl-vdi-280.wap.labs.mlnx\n\t[10.128.130.87])\n\tby labmailer.mlnx (8.13.8/8.13.8) with ESMTP id wA19cQA5024558;\n\tThu, 1 Nov 2018 11:38:29 +0200"
        ],
        "From": "Dekel Peled <dekelp@mellanox.com>",
        "To": "yskoh@mellanox.com, shahafs@mellanox.com",
        "Cc": "dev@dpdk.org, orika@mellanox.com",
        "Date": "Thu,  1 Nov 2018 11:37:28 +0200",
        "Message-Id": "<1541065053-28436-3-git-send-email-dekelp@mellanox.com>",
        "X-Mailer": "git-send-email 1.7.1",
        "In-Reply-To": "<1540969847-48919-1-git-send-email-dekelp@mellanox.com>",
        "References": "<1540969847-48919-1-git-send-email-dekelp@mellanox.com>",
        "Subject": "[dpdk-dev] [PATCH v8 2/7] net/mlx5: add VXLAN encap action to\n\tDirect Verbs",
        "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\t<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\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "This patch implements the VXLAN encap action in DV flow for MLX5 PMD.\n\nSigned-off-by: Dekel Peled <dekelp@mellanox.com>\n---\n drivers/net/mlx5/mlx5_flow.h    |   3 +\n drivers/net/mlx5/mlx5_flow_dv.c | 349 +++++++++++++++++++++++++++++++++++++++-\n 2 files changed, 347 insertions(+), 5 deletions(-)",
    "diff": "diff --git a/drivers/net/mlx5/mlx5_flow.h b/drivers/net/mlx5/mlx5_flow.h\nindex 61299d6..286d7bb 100644\n--- a/drivers/net/mlx5/mlx5_flow.h\n+++ b/drivers/net/mlx5/mlx5_flow.h\n@@ -92,6 +92,7 @@\n #define MLX5_FLOW_ACTION_DEC_TTL (1u << 19)\n #define MLX5_FLOW_ACTION_SET_MAC_SRC (1u << 20)\n #define MLX5_FLOW_ACTION_SET_MAC_DST (1u << 21)\n+#define MLX5_FLOW_ACTION_VXLAN_ENCAP (1u << 22)\n \n #define MLX5_FLOW_FATE_ACTIONS \\\n \t(MLX5_FLOW_ACTION_DROP | MLX5_FLOW_ACTION_QUEUE | MLX5_FLOW_ACTION_RSS)\n@@ -181,6 +182,8 @@ struct mlx5_flow_dv {\n #ifdef HAVE_IBV_FLOW_DV_SUPPORT\n \tstruct mlx5dv_flow_action_attr actions[MLX5_DV_MAX_NUMBER_OF_ACTIONS];\n \t/**< Action list. */\n+\tstruct ibv_flow_action *encap_decap_verbs_action;\n+\t/**< Verbs encap/decap object. */\n #endif\n \tint actions_n; /**< number of actions. */\n };\ndiff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c\nindex 8f729f4..e44b1e6 100644\n--- a/drivers/net/mlx5/mlx5_flow_dv.c\n+++ b/drivers/net/mlx5/mlx5_flow_dv.c\n@@ -34,6 +34,8 @@\n \n #ifdef HAVE_IBV_FLOW_DV_SUPPORT\n \n+#define MLX5_ENCAP_MAX_LEN 132\n+\n /**\n  * Validate META item.\n  *\n@@ -96,6 +98,305 @@\n }\n \n /**\n+ * Validate the L2 encap action.\n+ *\n+ * @param[in] action_flags\n+ *   Holds the actions detected until now.\n+ * @param[in] action\n+ *   Pointer to the encap action.\n+ * @param[in] attr\n+ *   Pointer to flow attributes\n+ * @param[out] error\n+ *   Pointer to error structure.\n+ *\n+ * @return\n+ *   0 on success, a negative errno value otherwise and rte_errno is set.\n+ */\n+static int\n+flow_dv_validate_action_l2_encap(uint64_t action_flags,\n+\t\t\t\t const struct rte_flow_action *action,\n+\t\t\t\t const struct rte_flow_attr *attr,\n+\t\t\t\t struct rte_flow_error *error)\n+{\n+\tif (!(action->conf))\n+\t\treturn rte_flow_error_set(error, EINVAL,\n+\t\t\t\t\t  RTE_FLOW_ERROR_TYPE_ACTION, action,\n+\t\t\t\t\t  \"configuration cannot be null\");\n+\tif (action_flags & MLX5_FLOW_ACTION_DROP)\n+\t\treturn rte_flow_error_set(error, EINVAL,\n+\t\t\t\t\t  RTE_FLOW_ERROR_TYPE_ACTION, NULL,\n+\t\t\t\t\t  \"can't drop and encap in same flow\");\n+\tif (action_flags & MLX5_FLOW_ACTION_VXLAN_ENCAP)\n+\t\treturn rte_flow_error_set(error, EINVAL,\n+\t\t\t\t\t  RTE_FLOW_ERROR_TYPE_ACTION, NULL,\n+\t\t\t\t\t  \"can only have a single encap\"\n+\t\t\t\t\t  \" action in a flow\");\n+\tif (attr->ingress)\n+\t\treturn rte_flow_error_set(error, ENOTSUP,\n+\t\t\t\t\t  RTE_FLOW_ERROR_TYPE_ATTR_INGRESS,\n+\t\t\t\t\t  NULL,\n+\t\t\t\t\t  \"encap action not supported for \"\n+\t\t\t\t\t  \"ingress\");\n+\treturn 0;\n+}\n+\n+/**\n+ * Get the size of specific rte_flow_item_type\n+ *\n+ * @param[in] item_type\n+ *   Tested rte_flow_item_type.\n+ *\n+ * @return\n+ *   sizeof struct item_type, 0 if void or irrelevant.\n+ */\n+static size_t\n+flow_dv_get_item_len(const enum rte_flow_item_type item_type)\n+{\n+\tsize_t retval;\n+\n+\tswitch (item_type) {\n+\tcase RTE_FLOW_ITEM_TYPE_ETH:\n+\t\tretval = sizeof(struct rte_flow_item_eth);\n+\t\tbreak;\n+\tcase RTE_FLOW_ITEM_TYPE_VLAN:\n+\t\tretval = sizeof(struct rte_flow_item_vlan);\n+\t\tbreak;\n+\tcase RTE_FLOW_ITEM_TYPE_IPV4:\n+\t\tretval = sizeof(struct rte_flow_item_ipv4);\n+\t\tbreak;\n+\tcase RTE_FLOW_ITEM_TYPE_IPV6:\n+\t\tretval = sizeof(struct rte_flow_item_ipv6);\n+\t\tbreak;\n+\tcase RTE_FLOW_ITEM_TYPE_UDP:\n+\t\tretval = sizeof(struct rte_flow_item_udp);\n+\t\tbreak;\n+\tcase RTE_FLOW_ITEM_TYPE_TCP:\n+\t\tretval = sizeof(struct rte_flow_item_tcp);\n+\t\tbreak;\n+\tcase RTE_FLOW_ITEM_TYPE_VXLAN:\n+\t\tretval = sizeof(struct rte_flow_item_vxlan);\n+\t\tbreak;\n+\tcase RTE_FLOW_ITEM_TYPE_GRE:\n+\t\tretval = sizeof(struct rte_flow_item_gre);\n+\t\tbreak;\n+\tcase RTE_FLOW_ITEM_TYPE_NVGRE:\n+\t\tretval = sizeof(struct rte_flow_item_nvgre);\n+\t\tbreak;\n+\tcase RTE_FLOW_ITEM_TYPE_VXLAN_GPE:\n+\t\tretval = sizeof(struct rte_flow_item_vxlan_gpe);\n+\t\tbreak;\n+\tcase RTE_FLOW_ITEM_TYPE_MPLS:\n+\t\tretval = sizeof(struct rte_flow_item_mpls);\n+\t\tbreak;\n+\tcase RTE_FLOW_ITEM_TYPE_VOID: /* Fall through. */\n+\tdefault:\n+\t\tretval = 0;\n+\t\tbreak;\n+\t}\n+\treturn retval;\n+};\n+\n+#define MLX5_ENCAP_IPV4_VERSION\t\t0x40\n+#define MLX5_ENCAP_IPV4_IHL_MIN\t\t0x05\n+#define MLX5_ENCAP_IPV4_TTL_DEF\t\t0x40\n+#define MLX5_ENCAP_IPV6_VTC_FLOW\t0x60000000\n+#define MLX5_ENCAP_IPV6_HOP_LIMIT\t0xff\n+#define MLX5_ENCAP_VXLAN_FLAGS\t\t0x08000000\n+#define MLX5_ENCAP_VXLAN_GPE_FLAGS\t0x04\n+\n+/**\n+ * Convert the encap action data from list of rte_flow_item to raw buffer\n+ *\n+ * @param[in] items\n+ *   Pointer to rte_flow_item objects list.\n+ * @param[out] buf\n+ *   Pointer to the output buffer.\n+ * @param[out] size\n+ *   Pointer to the output buffer size.\n+ * @param[out] error\n+ *   Pointer to the error structure.\n+ *\n+ * @return\n+ *   0 on success, a negative errno value otherwise and rte_errno is set.\n+ */\n+static int\n+flow_dv_convert_encap_data(const struct rte_flow_item *items, uint8_t *buf,\n+\t\t\t   size_t *size, struct rte_flow_error *error)\n+{\n+\tstruct ether_hdr *eth = NULL;\n+\tstruct vlan_hdr *vlan = NULL;\n+\tstruct ipv4_hdr *ipv4 = NULL;\n+\tstruct ipv6_hdr *ipv6 = NULL;\n+\tstruct udp_hdr *udp = NULL;\n+\tstruct vxlan_hdr *vxlan = NULL;\n+\tstruct vxlan_gpe_hdr *vxlan_gpe = NULL;\n+\tsize_t len;\n+\tsize_t temp_size = 0;\n+\n+\tif (!items)\n+\t\treturn rte_flow_error_set(error, EINVAL,\n+\t\t\t\t\t  RTE_FLOW_ERROR_TYPE_ACTION,\n+\t\t\t\t\t  NULL, \"invalid empty data\");\n+\tfor (; items->type != RTE_FLOW_ITEM_TYPE_END; items++) {\n+\t\tlen = flow_dv_get_item_len(items->type);\n+\t\tif (len + temp_size > MLX5_ENCAP_MAX_LEN)\n+\t\t\treturn rte_flow_error_set(error, EINVAL,\n+\t\t\t\t\t\t  RTE_FLOW_ERROR_TYPE_ACTION,\n+\t\t\t\t\t\t  (void *)items->type,\n+\t\t\t\t\t\t  \"items total size is too big\"\n+\t\t\t\t\t\t  \" for encap action\");\n+\t\trte_memcpy((void *)&buf[temp_size], items->spec, len);\n+\t\tswitch (items->type) {\n+\t\tcase RTE_FLOW_ITEM_TYPE_ETH:\n+\t\t\teth = (struct ether_hdr *)&buf[temp_size];\n+\t\t\tbreak;\n+\t\tcase RTE_FLOW_ITEM_TYPE_VLAN:\n+\t\t\tvlan = (struct vlan_hdr *)&buf[temp_size];\n+\t\t\tif (!eth)\n+\t\t\t\treturn rte_flow_error_set(error, EINVAL,\n+\t\t\t\t\t\tRTE_FLOW_ERROR_TYPE_ACTION,\n+\t\t\t\t\t\t(void *)items->type,\n+\t\t\t\t\t\t\"eth header not found\");\n+\t\t\tif (!eth->ether_type)\n+\t\t\t\teth->ether_type = RTE_BE16(ETHER_TYPE_VLAN);\n+\t\t\tbreak;\n+\t\tcase RTE_FLOW_ITEM_TYPE_IPV4:\n+\t\t\tipv4 = (struct ipv4_hdr *)&buf[temp_size];\n+\t\t\tif (!vlan && !eth)\n+\t\t\t\treturn rte_flow_error_set(error, EINVAL,\n+\t\t\t\t\t\tRTE_FLOW_ERROR_TYPE_ACTION,\n+\t\t\t\t\t\t(void *)items->type,\n+\t\t\t\t\t\t\"neither eth nor vlan\"\n+\t\t\t\t\t\t\" header found\");\n+\t\t\tif (vlan && !vlan->eth_proto)\n+\t\t\t\tvlan->eth_proto = RTE_BE16(ETHER_TYPE_IPv4);\n+\t\t\telse if (eth && !eth->ether_type)\n+\t\t\t\teth->ether_type = RTE_BE16(ETHER_TYPE_IPv4);\n+\t\t\tif (!ipv4->version_ihl)\n+\t\t\t\tipv4->version_ihl = MLX5_ENCAP_IPV4_VERSION |\n+\t\t\t\t\t\t    MLX5_ENCAP_IPV4_IHL_MIN;\n+\t\t\tif (!ipv4->time_to_live)\n+\t\t\t\tipv4->time_to_live = MLX5_ENCAP_IPV4_TTL_DEF;\n+\t\t\tbreak;\n+\t\tcase RTE_FLOW_ITEM_TYPE_IPV6:\n+\t\t\tipv6 = (struct ipv6_hdr *)&buf[temp_size];\n+\t\t\tif (!vlan && !eth)\n+\t\t\t\treturn rte_flow_error_set(error, EINVAL,\n+\t\t\t\t\t\tRTE_FLOW_ERROR_TYPE_ACTION,\n+\t\t\t\t\t\t(void *)items->type,\n+\t\t\t\t\t\t\"neither eth nor vlan\"\n+\t\t\t\t\t\t\" header found\");\n+\t\t\tif (vlan && !vlan->eth_proto)\n+\t\t\t\tvlan->eth_proto = RTE_BE16(ETHER_TYPE_IPv6);\n+\t\t\telse if (eth && !eth->ether_type)\n+\t\t\t\teth->ether_type = RTE_BE16(ETHER_TYPE_IPv6);\n+\t\t\tif (!ipv6->vtc_flow)\n+\t\t\t\tipv6->vtc_flow =\n+\t\t\t\t\tRTE_BE32(MLX5_ENCAP_IPV6_VTC_FLOW);\n+\t\t\tif (!ipv6->hop_limits)\n+\t\t\t\tipv6->hop_limits = MLX5_ENCAP_IPV6_HOP_LIMIT;\n+\t\t\tbreak;\n+\t\tcase RTE_FLOW_ITEM_TYPE_UDP:\n+\t\t\tudp = (struct udp_hdr *)&buf[temp_size];\n+\t\t\tif (!ipv4 && !ipv6)\n+\t\t\t\treturn rte_flow_error_set(error, EINVAL,\n+\t\t\t\t\t\tRTE_FLOW_ERROR_TYPE_ACTION,\n+\t\t\t\t\t\t(void *)items->type,\n+\t\t\t\t\t\t\"ip header not found\");\n+\t\t\tif (ipv4 && !ipv4->next_proto_id)\n+\t\t\t\tipv4->next_proto_id = IPPROTO_UDP;\n+\t\t\telse if (ipv6 && !ipv6->proto)\n+\t\t\t\tipv6->proto = IPPROTO_UDP;\n+\t\t\tbreak;\n+\t\tcase RTE_FLOW_ITEM_TYPE_VXLAN:\n+\t\t\tvxlan = (struct vxlan_hdr *)&buf[temp_size];\n+\t\t\tif (!udp)\n+\t\t\t\treturn rte_flow_error_set(error, EINVAL,\n+\t\t\t\t\t\tRTE_FLOW_ERROR_TYPE_ACTION,\n+\t\t\t\t\t\t(void *)items->type,\n+\t\t\t\t\t\t\"udp header not found\");\n+\t\t\tif (!udp->dst_port)\n+\t\t\t\tudp->dst_port = RTE_BE16(MLX5_UDP_PORT_VXLAN);\n+\t\t\tif (!vxlan->vx_flags)\n+\t\t\t\tvxlan->vx_flags =\n+\t\t\t\t\tRTE_BE32(MLX5_ENCAP_VXLAN_FLAGS);\n+\t\t\tbreak;\n+\t\tcase RTE_FLOW_ITEM_TYPE_VXLAN_GPE:\n+\t\t\tvxlan_gpe = (struct vxlan_gpe_hdr *)&buf[temp_size];\n+\t\t\tif (!udp)\n+\t\t\t\treturn rte_flow_error_set(error, EINVAL,\n+\t\t\t\t\t\tRTE_FLOW_ERROR_TYPE_ACTION,\n+\t\t\t\t\t\t(void *)items->type,\n+\t\t\t\t\t\t\"udp header not found\");\n+\t\t\tif (!vxlan_gpe->proto)\n+\t\t\t\treturn rte_flow_error_set(error, EINVAL,\n+\t\t\t\t\t\tRTE_FLOW_ERROR_TYPE_ACTION,\n+\t\t\t\t\t\t(void *)items->type,\n+\t\t\t\t\t\t\"next protocol not found\");\n+\t\t\tif (!udp->dst_port)\n+\t\t\t\tudp->dst_port =\n+\t\t\t\t\tRTE_BE16(MLX5_UDP_PORT_VXLAN_GPE);\n+\t\t\tif (!vxlan_gpe->vx_flags)\n+\t\t\t\tvxlan_gpe->vx_flags =\n+\t\t\t\t\t\tMLX5_ENCAP_VXLAN_GPE_FLAGS;\n+\t\t\tbreak;\n+\t\tcase RTE_FLOW_ITEM_TYPE_VOID:\n+\t\t\tbreak;\n+\t\tdefault:\n+\t\t\treturn rte_flow_error_set(error, EINVAL,\n+\t\t\t\t\t\t  RTE_FLOW_ERROR_TYPE_ACTION,\n+\t\t\t\t\t\t  (void *)items->type,\n+\t\t\t\t\t\t  \"unsupported item type\");\n+\t\t\tbreak;\n+\t\t}\n+\t\ttemp_size += len;\n+\t}\n+\t*size = temp_size;\n+\treturn 0;\n+}\n+\n+/**\n+ * Convert L2 encap action to DV specification.\n+ *\n+ * @param[in] dev\n+ *   Pointer to rte_eth_dev structure.\n+ * @param[in] action\n+ *   Pointer to action structure.\n+ * @param[out] error\n+ *   Pointer to the error structure.\n+ *\n+ * @return\n+ *   Pointer to action on success, NULL otherwise and rte_errno is set.\n+ */\n+static struct ibv_flow_action *\n+flow_dv_create_action_l2_encap(struct rte_eth_dev *dev,\n+\t\t\t       const struct rte_flow_action *action,\n+\t\t\t       struct rte_flow_error *error)\n+{\n+\tstruct ibv_flow_action *verbs_action = NULL;\n+\tconst struct rte_flow_item *encap_data;\n+\tstruct priv *priv = dev->data->dev_private;\n+\tuint8_t buf[MLX5_ENCAP_MAX_LEN];\n+\tsize_t size = 0;\n+\tint convert_result = 0;\n+\n+\tencap_data = ((const struct rte_flow_action_vxlan_encap *)\n+\t\t\t\t\t\taction->conf)->definition;\n+\tconvert_result = flow_dv_convert_encap_data(encap_data, buf,\n+\t\t\t\t\t\t    &size, error);\n+\tif (convert_result)\n+\t\treturn NULL;\n+\tverbs_action = mlx5_glue->dv_create_flow_action_packet_reformat\n+\t\t(priv->ctx, size, buf,\n+\t\t MLX5DV_FLOW_ACTION_PACKET_REFORMAT_TYPE_L2_TO_L2_TUNNEL,\n+\t\t MLX5DV_FLOW_TABLE_TYPE_NIC_TX);\n+\tif (!verbs_action)\n+\t\trte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ACTION,\n+\t\t\t\t   NULL, \"cannot create L2 encap action\");\n+\treturn verbs_action;\n+}\n+\n+/**\n  * Verify the @p attributes will be correctly understood by the NIC and store\n  * them in the @p flow if everything is correct.\n  *\n@@ -339,6 +640,16 @@\n \t\t\taction_flags |= MLX5_FLOW_ACTION_COUNT;\n \t\t\t++actions_n;\n \t\t\tbreak;\n+\t\tcase RTE_FLOW_ACTION_TYPE_VXLAN_ENCAP:\n+\t\t\tret = flow_dv_validate_action_l2_encap(action_flags,\n+\t\t\t\t\t\t\t       actions, attr,\n+\t\t\t\t\t\t\t       error);\n+\t\t\tif (ret < 0)\n+\t\t\t\treturn ret;\n+\t\t\taction_flags |= MLX5_FLOW_ACTION_VXLAN_ENCAP;\n+\t\t\t++actions_n;\n+\t\t\tbreak;\n+\n \t\tdefault:\n \t\t\treturn rte_flow_error_set(error, ENOTSUP,\n \t\t\t\t\t\t  RTE_FLOW_ERROR_TYPE_ACTION,\n@@ -1045,14 +1356,23 @@\n /**\n  * Store the requested actions in an array.\n  *\n+ * @param[in] dev\n+ *   Pointer to rte_eth_dev structure.\n  * @param[in] action\n  *   Flow action to translate.\n  * @param[in, out] dev_flow\n  *   Pointer to the mlx5_flow.\n+ * @param[out] error\n+ *   Pointer to the error structure.\n+ *\n+ * @return\n+ *   0 on success, a negative errno value otherwise and rte_errno is set.\n  */\n-static void\n-flow_dv_create_action(const struct rte_flow_action *action,\n-\t\t      struct mlx5_flow *dev_flow)\n+static int\n+flow_dv_create_action(struct rte_eth_dev *dev,\n+\t\t      const struct rte_flow_action *action,\n+\t\t      struct mlx5_flow *dev_flow,\n+\t\t      struct rte_flow_error *error)\n {\n \tconst struct rte_flow_action_queue *queue;\n \tconst struct rte_flow_action_rss *rss;\n@@ -1100,10 +1420,24 @@\n \t\t/* Added to array only in apply since we need the QP */\n \t\tflow->actions |= MLX5_FLOW_ACTION_RSS;\n \t\tbreak;\n+\tcase RTE_FLOW_ACTION_TYPE_VXLAN_ENCAP:\n+\t\tdev_flow->dv.actions[actions_n].type =\n+\t\t\tMLX5DV_FLOW_ACTION_IBV_FLOW_ACTION;\n+\t\tdev_flow->dv.actions[actions_n].action =\n+\t\t\t\tflow_dv_create_action_l2_encap(dev, action,\n+\t\t\t\t\t\t\t       error);\n+\t\tif (!(dev_flow->dv.actions[actions_n].action))\n+\t\t\treturn -rte_errno;\n+\t\tdev_flow->dv.encap_decap_verbs_action =\n+\t\t\tdev_flow->dv.actions[actions_n].action;\n+\t\tflow->actions |= MLX5_FLOW_ACTION_VXLAN_ENCAP;\n+\t\tactions_n++;\n+\t\tbreak;\n \tdefault:\n \t\tbreak;\n \t}\n \tdev_flow->dv.actions_n = actions_n;\n+\treturn 0;\n }\n \n static uint32_t matcher_zero[MLX5_ST_SZ_DW(fte_match_param)] = { 0 };\n@@ -1217,7 +1551,6 @@\n \treturn 0;\n }\n \n-\n /**\n  * Fill the flow with DV spec.\n  *\n@@ -1272,7 +1605,8 @@\n \tif (flow_dv_matcher_register(dev, &matcher, dev_flow, error))\n \t\treturn -rte_errno;\n \tfor (; actions->type != RTE_FLOW_ACTION_TYPE_END; actions++)\n-\t\tflow_dv_create_action(actions, dev_flow);\n+\t\tif (flow_dv_create_action(dev, actions, dev_flow, error))\n+\t\t\treturn -rte_errno;\n \treturn 0;\n }\n \n@@ -1457,6 +1791,11 @@\n \t\tLIST_REMOVE(dev_flow, next);\n \t\tif (dev_flow->dv.matcher)\n \t\t\tflow_dv_matcher_release(dev, dev_flow);\n+\t\tif (dev_flow->dv.encap_decap_verbs_action) {\n+\t\t\tclaim_zero(mlx5_glue->destroy_flow_action\n+\t\t\t\t(dev_flow->dv.encap_decap_verbs_action));\n+\t\t\tdev_flow->dv.encap_decap_verbs_action = NULL;\n+\t\t}\n \t\trte_free(dev_flow);\n \t}\n }\n",
    "prefixes": [
        "v8",
        "2/7"
    ]
}