Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/86416/?format=api
https://patches.dpdk.org/api/patches/86416/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/20210112140241.15914-8-shirik@nvidia.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": "<20210112140241.15914-8-shirik@nvidia.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20210112140241.15914-8-shirik@nvidia.com", "date": "2021-01-12T14:02:40", "name": "[v5,7/8] net/mlx5: add GENEVE TLV option flow translation", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "6124a7da25c0e47f5a7f1d488459d434770ab155", "submitter": { "id": 1894, "url": "https://patches.dpdk.org/api/people/1894/?format=api", "name": "Shiri Kuzin", "email": "shirik@nvidia.com" }, "delegate": { "id": 319, "url": "https://patches.dpdk.org/api/users/319/?format=api", "username": "fyigit", "first_name": "Ferruh", "last_name": "Yigit", "email": "ferruh.yigit@amd.com" }, "mbox": "https://patches.dpdk.org/project/dpdk/patch/20210112140241.15914-8-shirik@nvidia.com/mbox/", "series": [ { "id": 14672, "url": "https://patches.dpdk.org/api/series/14672/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=14672", "date": "2021-01-12T14:02:33", "name": "ethdev: introduce GENEVE header TLV option item", "version": 5, "mbox": "https://patches.dpdk.org/series/14672/mbox/" } ], "comments": "https://patches.dpdk.org/api/patches/86416/comments/", "check": "success", "checks": "https://patches.dpdk.org/api/patches/86416/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 mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 3FAF6A04B5;\n\tTue, 12 Jan 2021 15:04:58 +0100 (CET)", "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 5CE65140DA5;\n\tTue, 12 Jan 2021 15:03:48 +0100 (CET)", "from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129])\n by mails.dpdk.org (Postfix) with ESMTP id B9A9A140CF7\n for <dev@dpdk.org>; Tue, 12 Jan 2021 15:03:45 +0100 (CET)", "from Internal Mail-Server by MTLPINE1 (envelope-from\n shirik@nvidia.com) with SMTP; 12 Jan 2021 16:03:41 +0200", "from nvidia.com (c-141-254-1-005.mtl.labs.mlnx [10.141.254.5])\n by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 10CE3SBn009998;\n Tue, 12 Jan 2021 16:03:41 +0200" ], "From": "Shiri Kuzin <shirik@nvidia.com>", "To": "dev@dpdk.org", "Cc": "viacheslavo@nvidia.com, adrien.mazarguil@6wind.com, orika@nvidia.com,\n ferruh.yigit@intel.com, thomas@monjalon.net, rasland@nvidia.com", "Date": "Tue, 12 Jan 2021 16:02:40 +0200", "Message-Id": "<20210112140241.15914-8-shirik@nvidia.com>", "X-Mailer": "git-send-email 2.21.0", "In-Reply-To": "<20210112140241.15914-1-shirik@nvidia.com>", "References": "<20210111142658.22239-1-shirik@nvidia.com>\n <20210112140241.15914-1-shirik@nvidia.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[dpdk-dev] [PATCH v5 7/8] net/mlx5: add GENEVE TLV option flow\n translation", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.29", "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": "The GENEVE TLV option matching flows must be created\nusing a translation function.\n\nThis function checks whether we already created a Devx\nobject for the matching and either creates the objects\nor updates the reference counter.\n\nSigned-off-by: Shiri Kuzin <shirik@nvidia.com>\nAcked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>\n---\n drivers/net/mlx5/mlx5_flow.h | 2 +-\n drivers/net/mlx5/mlx5_flow_dv.c | 80 +++++++++++++++++++++++++++++++++\n 2 files changed, 81 insertions(+), 1 deletion(-)", "diff": "diff --git a/drivers/net/mlx5/mlx5_flow.h b/drivers/net/mlx5/mlx5_flow.h\nindex 28db5faee1..d6a6839476 100644\n--- a/drivers/net/mlx5/mlx5_flow.h\n+++ b/drivers/net/mlx5/mlx5_flow.h\n@@ -329,7 +329,7 @@ enum mlx5_feature_name {\n #define MLX5_GENEVE_VER_VAL(a) \\\n \t\t(((a) >> (MLX5_GENEVE_VER_SHIFT)) & (MLX5_GENEVE_VER_MASK))\n #define MLX5_GENEVE_OPTLEN_MASK 0x3F\n-#define MLX5_GENEVE_OPTLEN_SHIFT 7\n+#define MLX5_GENEVE_OPTLEN_SHIFT 8\n #define MLX5_GENEVE_OPTLEN_VAL(a) \\\n \t (((a) >> (MLX5_GENEVE_OPTLEN_SHIFT)) & (MLX5_GENEVE_OPTLEN_MASK))\n #define MLX5_GENEVE_OAMF_MASK 0x1\ndiff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c\nindex c24123fbf3..dc30682896 100644\n--- a/drivers/net/mlx5/mlx5_flow_dv.c\n+++ b/drivers/net/mlx5/mlx5_flow_dv.c\n@@ -7336,6 +7336,75 @@ flow_dev_geneve_tlv_option_resource_register(struct rte_eth_dev *dev,\n \treturn ret;\n }\n \n+/**\n+ * Add Geneve TLV option item to matcher.\n+ *\n+ * @param[in, out] dev\n+ * Pointer to rte_eth_dev structure.\n+ * @param[in, out] matcher\n+ * Flow matcher.\n+ * @param[in, out] key\n+ * Flow matcher value.\n+ * @param[in] item\n+ * Flow pattern to translate.\n+ * @param[out] error\n+ * Pointer to error structure.\n+ */\n+static int\n+flow_dv_translate_item_geneve_opt(struct rte_eth_dev *dev, void *matcher,\n+\t\t\t\t void *key, const struct rte_flow_item *item,\n+\t\t\t\t struct rte_flow_error *error)\n+{\n+\tconst struct rte_flow_item_geneve_opt *geneve_opt_m = item->mask;\n+\tconst struct rte_flow_item_geneve_opt *geneve_opt_v = item->spec;\n+\tvoid *misc_m = MLX5_ADDR_OF(fte_match_param, matcher, misc_parameters);\n+\tvoid *misc_v = MLX5_ADDR_OF(fte_match_param, key, misc_parameters);\n+\tvoid *misc3_m = MLX5_ADDR_OF(fte_match_param, matcher,\n+\t\t\tmisc_parameters_3);\n+\tvoid *misc3_v = MLX5_ADDR_OF(fte_match_param, key, misc_parameters_3);\n+\trte_be32_t opt_data_key = 0, opt_data_mask = 0;\n+\trte_be16_t opt_len = 0x200;\n+\tint ret = 0;\n+\n+\tif (!geneve_opt_v)\n+\t\treturn -1;\n+\tif (!geneve_opt_m)\n+\t\tgeneve_opt_m = &rte_flow_item_geneve_opt_mask;\n+\tret = flow_dev_geneve_tlv_option_resource_register(dev, item,\n+\t\t\t\t\t\t\t error);\n+\tif (ret) {\n+\t\tDRV_LOG(ERR, \"Failed to create geneve_tlv_obj\");\n+\t\treturn ret;\n+\t}\n+\t/* Set the option length. */\n+\tif (!MLX5_GET16(fte_match_set_misc, misc_v, geneve_opt_len)) {\n+\t\tMLX5_SET(fte_match_set_misc, misc_m, geneve_opt_len,\n+\t\t\t MLX5_GENEVE_OPTLEN_VAL(opt_len));\n+\t\tMLX5_SET(fte_match_set_misc, misc_v, geneve_opt_len,\n+\t\t\t MLX5_GENEVE_OPTLEN_VAL(opt_len));\n+\t}\n+\t/* Set the data. */\n+\tif (geneve_opt_v->data) {\n+\t\tmemcpy(&opt_data_key, geneve_opt_v->data,\n+\t\t\tRTE_MIN((uint32_t)(geneve_opt_v->option_len * 4),\n+\t\t\t\tsizeof(opt_data_key)));\n+\t\tMLX5_ASSERT((uint32_t)(geneve_opt_v->option_len * 4) <=\n+\t\t\t\tsizeof(opt_data_key));\n+\t\tmemcpy(&opt_data_mask, geneve_opt_m->data,\n+\t\t\tRTE_MIN((uint32_t)(geneve_opt_v->option_len * 4),\n+\t\t\t\tsizeof(opt_data_mask)));\n+\t\tMLX5_ASSERT((uint32_t)(geneve_opt_v->option_len * 4) <=\n+\t\t\t\tsizeof(opt_data_mask));\n+\t\tMLX5_SET(fte_match_set_misc3, misc3_m,\n+\t\t\t\tgeneve_tlv_option_0_data,\n+\t\t\t\trte_be_to_cpu_32(opt_data_mask));\n+\t\tMLX5_SET(fte_match_set_misc3, misc3_v,\n+\t\t\t\tgeneve_tlv_option_0_data,\n+\t\t\trte_be_to_cpu_32(opt_data_key & opt_data_mask));\n+\t}\n+\treturn ret;\n+}\n+\n /**\n * Add MPLS item to matcher and to the value.\n *\n@@ -10583,6 +10652,17 @@ flow_dv_translate(struct rte_eth_dev *dev,\n \t\t\tmatcher.priority = MLX5_TUNNEL_PRIO_GET(rss_desc);\n \t\t\tlast_item = MLX5_FLOW_LAYER_GENEVE;\n \t\t\tbreak;\n+\t\tcase RTE_FLOW_ITEM_TYPE_GENEVE_OPT:\n+\t\t\tret = flow_dv_translate_item_geneve_opt(dev, match_mask,\n+\t\t\t\t\t\t\t match_value,\n+\t\t\t\t\t\t\t items, error);\n+\t\t\tif (ret)\n+\t\t\t\treturn rte_flow_error_set(error, -ret,\n+\t\t\t\t\tRTE_FLOW_ERROR_TYPE_ITEM, NULL,\n+\t\t\t\t\t\"cannot create GENEVE TLV option\");\n+\t\t\tflow->geneve_tlv_option = 1;\n+\t\t\tlast_item = MLX5_FLOW_LAYER_GENEVE_OPT;\n+\t\t\tbreak;\n \t\tcase RTE_FLOW_ITEM_TYPE_MPLS:\n \t\t\tflow_dv_translate_item_mpls(match_mask, match_value,\n \t\t\t\t\t\t items, last_item, tunnel);\n", "prefixes": [ "v5", "7/8" ] }{ "id": 86416, "url": "