Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/65038/?format=api
http://patchwork.dpdk.org/api/patches/65038/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/26679816cc524d1b5665fc79ba48b89b37d85dd7.1579703134.git.dekelp@mellanox.com/", "project": { "id": 1, "url": "http://patchwork.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": "<26679816cc524d1b5665fc79ba48b89b37d85dd7.1579703134.git.dekelp@mellanox.com>", "list_archive_url": "https://inbox.dpdk.org/dev/26679816cc524d1b5665fc79ba48b89b37d85dd7.1579703134.git.dekelp@mellanox.com", "date": "2020-01-22T14:27:17", "name": "[05/11] net/mlx5: unify validation of drop action", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "33fa18b89fa22c7f2a8d1deeec78c15dd12a3f8e", "submitter": { "id": 1082, "url": "http://patchwork.dpdk.org/api/people/1082/?format=api", "name": "Dekel Peled", "email": "dekelp@mellanox.com" }, "delegate": { "id": 3268, "url": "http://patchwork.dpdk.org/api/users/3268/?format=api", "username": "rasland", "first_name": "Raslan", "last_name": "Darawsheh", "email": "rasland@nvidia.com" }, "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/26679816cc524d1b5665fc79ba48b89b37d85dd7.1579703134.git.dekelp@mellanox.com/mbox/", "series": [ { "id": 8260, "url": "http://patchwork.dpdk.org/api/series/8260/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=8260", "date": "2020-01-22T14:27:13", "name": "net/mlx5: vlan actions validation fixes", "version": 1, "mbox": "http://patchwork.dpdk.org/series/8260/mbox/" } ], "comments": "http://patchwork.dpdk.org/api/patches/65038/comments/", "check": "success", "checks": "http://patchwork.dpdk.org/api/patches/65038/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 E0E97A0530;\n\tWed, 22 Jan 2020 15:30:40 +0100 (CET)", "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id EDF5349E0;\n\tWed, 22 Jan 2020 15:30:07 +0100 (CET)", "from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129])\n by dpdk.org (Postfix) with ESMTP id 3F0213772\n for <dev@dpdk.org>; Wed, 22 Jan 2020 15:30:02 +0100 (CET)", "from Internal Mail-Server by MTLPINE1 (envelope-from\n dekelp@mellanox.com)\n with ESMTPS (AES256-SHA encrypted); 22 Jan 2020 16:29:58 +0200", "from mtl-vdi-280.wap.labs.mlnx. (mtl-vdi-280.wap.labs.mlnx\n [10.128.130.87])\n by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 00METnL3010555;\n Wed, 22 Jan 2020 16:29:58 +0200" ], "From": "Dekel Peled <dekelp@mellanox.com>", "To": "matan@mellanox.com, viacheslavo@mellanox.com", "Cc": "rasland@mellanox.com, orika@mellanox.com, dev@dpdk.org", "Date": "Wed, 22 Jan 2020 16:27:17 +0200", "Message-Id": "\n <26679816cc524d1b5665fc79ba48b89b37d85dd7.1579703134.git.dekelp@mellanox.com>", "X-Mailer": "git-send-email 1.7.1", "In-Reply-To": "<cover.1579703134.git.dekelp@mellanox.com>", "References": "<cover.1579703134.git.dekelp@mellanox.com>", "Subject": "[dpdk-dev] [PATCH 05/11] net/mlx5: unify validation of drop action", "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": "According to PRM: \"Drop action is mutually-exclusive with any other\naction, except for Count action\".\nIn current code this limitaion is checked separately in validation\nfunction of each action.\n\nThis patch removes the discrete checks, and adds a single check common\nfor all actions.\n\nSigned-off-by: Dekel Peled <dekelp@mellanox.com>\nAcked-by: Ori Kam <orika@mellanox.com>\n---\n drivers/net/mlx5/mlx5_flow.c | 25 +------------------------\n drivers/net/mlx5/mlx5_flow_dv.c | 36 ++++++++++++------------------------\n drivers/net/mlx5/mlx5_flow_verbs.c | 12 ++++++++++++\n 3 files changed, 25 insertions(+), 48 deletions(-)", "diff": "diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c\nindex 970123b..7738cb2 100644\n--- a/drivers/net/mlx5/mlx5_flow.c\n+++ b/drivers/net/mlx5/mlx5_flow.c\n@@ -905,11 +905,6 @@ uint32_t mlx5_flow_adjust_priority(struct rte_eth_dev *dev, int32_t priority,\n \t\t\t const struct rte_flow_attr *attr,\n \t\t\t struct rte_flow_error *error)\n {\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 flag in same flow\");\n \tif (action_flags & MLX5_FLOW_ACTION_MARK)\n \t\treturn rte_flow_error_set(error, EINVAL,\n \t\t\t\t\t RTE_FLOW_ERROR_TYPE_ACTION, NULL,\n@@ -961,10 +956,6 @@ uint32_t mlx5_flow_adjust_priority(struct rte_eth_dev *dev, int32_t priority,\n \t\t\t\t\t &mark->id,\n \t\t\t\t\t \"mark id must in 0 <= id < \"\n \t\t\t\t\t RTE_STR(MLX5_FLOW_MARK_MAX));\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 mark in same flow\");\n \tif (action_flags & MLX5_FLOW_ACTION_FLAG)\n \t\treturn rte_flow_error_set(error, EINVAL,\n \t\t\t\t\t RTE_FLOW_ERROR_TYPE_ACTION, NULL,\n@@ -996,24 +987,10 @@ uint32_t mlx5_flow_adjust_priority(struct rte_eth_dev *dev, int32_t priority,\n * 0 on success, a negative errno value otherwise and rte_errno is set.\n */\n int\n-mlx5_flow_validate_action_drop(uint64_t action_flags,\n+mlx5_flow_validate_action_drop(uint64_t action_flags __rte_unused,\n \t\t\t const struct rte_flow_attr *attr,\n \t\t\t struct rte_flow_error *error)\n {\n-\tif (action_flags & MLX5_FLOW_ACTION_FLAG)\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 flag in same flow\");\n-\tif (action_flags & MLX5_FLOW_ACTION_MARK)\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 mark in same flow\");\n-\tif (action_flags & (MLX5_FLOW_FATE_ACTIONS |\n-\t\t\t MLX5_FLOW_FATE_ESWITCH_ACTIONS))\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 have 2 fate actions in\"\n-\t\t\t\t\t \" same 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, NULL,\ndiff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c\nindex 59ece01..b0d5688 100644\n--- a/drivers/net/mlx5/mlx5_flow_dv.c\n+++ b/drivers/net/mlx5/mlx5_flow_dv.c\n@@ -1912,10 +1912,6 @@ struct field_modify_info modify_tcp[] = {\n \tif (ret < 0)\n \t\treturn ret;\n \tassert(ret > 0);\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 flag in same flow\");\n \tif (action_flags & MLX5_FLOW_ACTION_MARK)\n \t\treturn rte_flow_error_set(error, EINVAL,\n \t\t\t\t\t RTE_FLOW_ERROR_TYPE_ACTION, NULL,\n@@ -1985,10 +1981,6 @@ struct field_modify_info modify_tcp[] = {\n \t\t\t\t\t RTE_FLOW_ERROR_TYPE_ACTION_CONF,\n \t\t\t\t\t &mark->id,\n \t\t\t\t\t \"mark id exceeds the limit\");\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 mark in same flow\");\n \tif (action_flags & MLX5_FLOW_ACTION_FLAG)\n \t\treturn rte_flow_error_set(error, EINVAL,\n \t\t\t\t\t RTE_FLOW_ERROR_TYPE_ACTION, NULL,\n@@ -2173,10 +2165,6 @@ struct field_modify_info modify_tcp[] = {\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_ENCAP_ACTIONS | MLX5_FLOW_DECAP_ACTIONS))\n \t\treturn rte_flow_error_set(error, EINVAL,\n \t\t\t\t\t RTE_FLOW_ERROR_TYPE_ACTION, NULL,\n@@ -2209,10 +2197,6 @@ struct field_modify_info modify_tcp[] = {\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_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_ENCAP_ACTIONS | MLX5_FLOW_DECAP_ACTIONS))\n \t\treturn rte_flow_error_set(error, EINVAL,\n \t\t\t\t\t RTE_FLOW_ERROR_TYPE_ACTION, NULL,\n@@ -2259,10 +2243,6 @@ struct field_modify_info modify_tcp[] = {\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_ENCAP_ACTIONS)\n \t\treturn rte_flow_error_set(error, EINVAL,\n \t\t\t\t\t RTE_FLOW_ERROR_TYPE_ACTION, NULL,\n@@ -2306,10 +2286,6 @@ struct field_modify_info modify_tcp[] = {\n {\n \tconst struct rte_flow_action_raw_decap *decap\t= action->conf;\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_ENCAP_ACTIONS)\n \t\treturn rte_flow_error_set(error, EINVAL,\n \t\t\t\t\t RTE_FLOW_ERROR_TYPE_ACTION, NULL,\n@@ -5051,6 +5027,18 @@ struct field_modify_info modify_tcp[] = {\n \t\t\t\t\t\t \"action not supported\");\n \t\t}\n \t}\n+\t/*\n+\t * Validate the drop action mutual exclusion with other actions.\n+\t * Drop action is mutually-exclusive with any other action, except for\n+\t * Count action.\n+\t */\n+\tif ((action_flags & MLX5_FLOW_ACTION_DROP) &&\n+\t (action_flags & ~(MLX5_FLOW_ACTION_DROP | MLX5_FLOW_ACTION_COUNT)))\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 \"Drop action is mutually-exclusive \"\n+\t\t\t\t\t \"with any other action, except for \"\n+\t\t\t\t\t \"Count action\");\n \t/* Eswitch has few restrictions on using items and actions */\n \tif (attr->transfer) {\n \t\tif (!mlx5_flow_ext_mreg_supported(dev) &&\ndiff --git a/drivers/net/mlx5/mlx5_flow_verbs.c b/drivers/net/mlx5/mlx5_flow_verbs.c\nindex c787c98..72fb1e4 100644\n--- a/drivers/net/mlx5/mlx5_flow_verbs.c\n+++ b/drivers/net/mlx5/mlx5_flow_verbs.c\n@@ -1255,6 +1255,18 @@\n \t\t\t\t\t\t \"action not supported\");\n \t\t}\n \t}\n+\t/*\n+\t * Validate the drop action mutual exclusion with other actions.\n+\t * Drop action is mutually-exclusive with any other action, except for\n+\t * Count action.\n+\t */\n+\tif ((action_flags & MLX5_FLOW_ACTION_DROP) &&\n+\t (action_flags & ~(MLX5_FLOW_ACTION_DROP | MLX5_FLOW_ACTION_COUNT)))\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 \"Drop action is mutually-exclusive \"\n+\t\t\t\t\t \"with any other action, except for \"\n+\t\t\t\t\t \"Count action\");\n \tif (!(action_flags & MLX5_FLOW_FATE_ACTIONS))\n \t\treturn rte_flow_error_set(error, EINVAL,\n \t\t\t\t\t RTE_FLOW_ERROR_TYPE_ACTION, actions,\n", "prefixes": [ "05/11" ] }{ "id": 65038, "url": "