Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/47439/?format=api
https://patches.dpdk.org/api/patches/47439/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/1540498108-18358-4-git-send-email-dekelp@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": "<1540498108-18358-4-git-send-email-dekelp@mellanox.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1540498108-18358-4-git-send-email-dekelp@mellanox.com", "date": "2018-10-25T20:08:25", "name": "[v6,3/6] net/mlx5: add VXLAN decap action to Direct Verbs", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "0877612c664b2639bd2a1ba5c1d26b578000ed93", "submitter": { "id": 1082, "url": "https://patches.dpdk.org/api/people/1082/?format=api", "name": "Dekel Peled", "email": "dekelp@mellanox.com" }, "delegate": null, "mbox": "https://patches.dpdk.org/project/dpdk/patch/1540498108-18358-4-git-send-email-dekelp@mellanox.com/mbox/", "series": [ { "id": 1835, "url": "https://patches.dpdk.org/api/series/1835/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=1835", "date": "2018-10-11T12:12:43", "name": "add support of Direct Verbs encap and decap actions", "version": 5, "mbox": "https://patches.dpdk.org/series/1835/mbox/" } ], "comments": "https://patches.dpdk.org/api/patches/47439/comments/", "check": "success", "checks": "https://patches.dpdk.org/api/patches/47439/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 27EA46833;\n\tThu, 25 Oct 2018 22:09:35 +0200 (CEST)", "from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129])\n\tby dpdk.org (Postfix) with ESMTP id AE55D6833\n\tfor <dev@dpdk.org>; Thu, 25 Oct 2018 22:09:32 +0200 (CEST)", "from Internal Mail-Server by MTLPINE1 (envelope-from\n\tdekelp@mellanox.com)\n\twith ESMTPS (AES256-SHA encrypted); 25 Oct 2018 22:14:41 +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 w9PK9EZb028635;\n\tThu, 25 Oct 2018 23:09:31 +0300" ], "From": "Dekel Peled <dekelp@mellanox.com>", "To": "yskoh@mellanox.com, shahafs@mellanox.com", "Cc": "dev@dpdk.org, orika@mellanox.com", "Date": "Thu, 25 Oct 2018 23:08:25 +0300", "Message-Id": "<1540498108-18358-4-git-send-email-dekelp@mellanox.com>", "X-Mailer": "git-send-email 1.7.1", "In-Reply-To": "<1539259967-10975-1-git-send-email-dekelp@mellanox.com>", "References": "<1539259967-10975-1-git-send-email-dekelp@mellanox.com>", "Subject": "[dpdk-dev] [PATCH v6 3/6] net/mlx5: add VXLAN decap 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 decap action in DV flow for MLX5 PMD.\n\nSigned-off-by: Dekel Peled <dekelp@mellanox.com>\n---\n drivers/net/mlx5/mlx5_flow.h | 1 +\n drivers/net/mlx5/mlx5_flow_dv.c | 103 ++++++++++++++++++++++++++++++++++++++--\n 2 files changed, 100 insertions(+), 4 deletions(-)", "diff": "diff --git a/drivers/net/mlx5/mlx5_flow.h b/drivers/net/mlx5/mlx5_flow.h\nindex 6e92afe..3795644 100644\n--- a/drivers/net/mlx5/mlx5_flow.h\n+++ b/drivers/net/mlx5/mlx5_flow.h\n@@ -93,6 +93,7 @@\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+#define MLX5_FLOW_ACTION_VXLAN_DECAP (1u << 23)\n \n #define MLX5_FLOW_FATE_ACTIONS \\\n \t(MLX5_FLOW_ACTION_DROP | MLX5_FLOW_ACTION_QUEUE | MLX5_FLOW_ACTION_RSS)\ndiff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c\nindex 14110c5..e84a2b6 100644\n--- a/drivers/net/mlx5/mlx5_flow_dv.c\n+++ b/drivers/net/mlx5/mlx5_flow_dv.c\n@@ -131,11 +131,12 @@\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+\tif (action_flags & (MLX5_FLOW_ACTION_VXLAN_ENCAP |\n+\t\t\t MLX5_FLOW_ACTION_VXLAN_DECAP))\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+\t\t\t\t\t \"can only have a single encap or\"\n+\t\t\t\t\t \" decap 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@@ -146,6 +147,47 @@\n }\n \n /**\n+ * Validate the L2 decap action.\n+ * Used for VXLAN decap action.\n+ *\n+ * @param[in] action_flags\n+ * Holds the actions detected until now.\n+ * @param[in] action\n+ * Pointer to the decap 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_decap(uint64_t action_flags,\n+\t\t\tconst struct rte_flow_action *action __rte_unused,\n+\t\t\tconst struct rte_flow_attr *attr,\n+\t\t\tstruct rte_flow_error *error)\n+{\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 decap in same flow\");\n+\tif (action_flags & (MLX5_FLOW_ACTION_VXLAN_ENCAP |\n+\t\t\t MLX5_FLOW_ACTION_VXLAN_DECAP))\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 or\"\n+\t\t\t\t\t \" decap action in a flow\");\n+\tif (attr->egress)\n+\t\treturn rte_flow_error_set(error, ENOTSUP,\n+\t\t\t\t\t RTE_FLOW_ERROR_TYPE_ATTR_EGRESS,\n+\t\t\t\t\t NULL,\n+\t\t\t\t\t \"decap action not supported for \"\n+\t\t\t\t\t \"egress\");\n+\treturn 0;\n+}\n+\n+/**\n * Get the size of specific rte_flow_item_type\n *\n * @param[in] item_type\n@@ -396,6 +438,38 @@\n }\n \n /**\n+ * Convert L2 decap action to DV specification.\n+ * Used for VXLAN decap action.\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_decap(struct rte_eth_dev *dev,\n+\t\t\tconst struct rte_flow_action *action __rte_unused,\n+\t\t\tstruct rte_flow_error *error)\n+{\n+\tstruct ibv_flow_action *verbs_action = NULL;\n+\tstruct priv *priv = dev->data->dev_private;\n+\n+\tverbs_action = mlx5_glue->dv_create_flow_action_packet_reformat\n+\t\t(priv->ctx, 0, NULL,\n+\t\t MLX5DV_FLOW_ACTION_PACKET_REFORMAT_TYPE_L2_TUNNEL_TO_L2,\n+\t\t MLX5DV_FLOW_TABLE_TYPE_NIC_RX);\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 decap 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@@ -648,7 +722,15 @@\n \t\t\taction_flags |= MLX5_FLOW_ACTION_VXLAN_ENCAP;\n \t\t\t++actions_n;\n \t\t\tbreak;\n-\n+\t\tcase RTE_FLOW_ACTION_TYPE_VXLAN_DECAP:\n+\t\t\tret = flow_dv_validate_action_l2_decap(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_DECAP;\n+\t\t\t++actions_n;\n+\t\t\tbreak;\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@@ -1435,6 +1517,19 @@\n \t\tflow->actions |= MLX5_FLOW_ACTION_VXLAN_ENCAP;\n \t\tactions_n++;\n \t\tbreak;\n+\tcase RTE_FLOW_ACTION_TYPE_VXLAN_DECAP:\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_decap(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.verbs_action =\n+\t\t\tdev_flow->dv.actions[actions_n].action;\n+\t\tflow->actions |= MLX5_FLOW_ACTION_VXLAN_DECAP;\n+\t\tactions_n++;\n+\t\tbreak;\n \tdefault:\n \t\tbreak;\n \t}\n", "prefixes": [ "v6", "3/6" ] }{ "id": 47439, "url": "