Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/79607/?format=api
http://patches.dpdk.org/api/patches/79607/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/a14a4640bae1e6d55a0a82d4356c42c449242da2.1601886720.git.dekelp@nvidia.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": "<a14a4640bae1e6d55a0a82d4356c42c449242da2.1601886720.git.dekelp@nvidia.com>", "list_archive_url": "https://inbox.dpdk.org/dev/a14a4640bae1e6d55a0a82d4356c42c449242da2.1601886720.git.dekelp@nvidia.com", "date": "2020-10-05T08:35:51", "name": "[v3,09/11] net/mlx5: support match on IPv6 fragment ext. item", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "f9670030c4c63832e0d13d7b08f050c9229a9d30", "submitter": { "id": 1897, "url": "http://patches.dpdk.org/api/people/1897/?format=api", "name": "Dekel Peled", "email": "dekelp@nvidia.com" }, "delegate": { "id": 319, "url": "http://patches.dpdk.org/api/users/319/?format=api", "username": "fyigit", "first_name": "Ferruh", "last_name": "Yigit", "email": "ferruh.yigit@amd.com" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/a14a4640bae1e6d55a0a82d4356c42c449242da2.1601886720.git.dekelp@nvidia.com/mbox/", "series": [ { "id": 12684, "url": "http://patches.dpdk.org/api/series/12684/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=12684", "date": "2020-10-05T08:35:45", "name": "support match on L3 fragmented packets", "version": 3, "mbox": "http://patches.dpdk.org/series/12684/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/79607/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/79607/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 289DDA04BA;\n\tMon, 5 Oct 2020 10:39:03 +0200 (CEST)", "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id C10CB1BA68;\n\tMon, 5 Oct 2020 10:36:36 +0200 (CEST)", "from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129])\n by dpdk.org (Postfix) with ESMTP id 1CD2D1B812\n for <dev@dpdk.org>; Mon, 5 Oct 2020 10:36:29 +0200 (CEST)", "from Internal Mail-Server by MTLPINE1 (envelope-from\n dekelp@nvidia.com) with SMTP; 5 Oct 2020 11:36:25 +0300", "from mtl-vdi-280.wap.labs.mlnx. (mtl-vdi-280.wap.labs.mlnx\n [10.228.134.250])\n by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 0958aHl3022203;\n Mon, 5 Oct 2020 11:36:24 +0300" ], "From": "Dekel Peled <dekelp@nvidia.com>", "To": "orika@nvidia.com, thomas@monjalon.net, ferruh.yigit@intel.com,\n arybchenko@solarflare.com, konstantin.ananyev@intel.com,\n olivier.matz@6wind.com, wenzhuo.lu@intel.com, beilei.xing@intel.com,\n bernard.iremonger@intel.com, matan@nvidia.com, shahafs@nvidia.com,\n viacheslavo@nvidia.com", "Cc": "dev@dpdk.org", "Date": "Mon, 5 Oct 2020 11:35:51 +0300", "Message-Id": "\n <a14a4640bae1e6d55a0a82d4356c42c449242da2.1601886720.git.dekelp@nvidia.com>", "X-Mailer": "git-send-email 1.7.1", "In-Reply-To": "<cover.1601886719.git.dekelp@nvidia.com>", "References": "<cover.1601586563.git.dekelp@nvidia.com>\n <cover.1601886719.git.dekelp@nvidia.com>", "Subject": "[dpdk-dev] [PATCH v3 09/11] net/mlx5: support match on IPv6\n\tfragment ext. item", "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": "rte_flow update, following RFC [1], added to ethdev the rte_flow item\nipv6_frag_ext.\nThis patch adds to MLX5 PMD the option to match on this item type.\n\n[1] http://mails.dpdk.org/archives/dev/2020-March/160255.html\n\nSigned-off-by: Dekel Peled <dekelp@nvidia.com>\nAcked-by: Ori Kam <orika@nvidia.com>\n---\n drivers/net/mlx5/mlx5_flow.h | 4 +\n drivers/net/mlx5/mlx5_flow_dv.c | 209 ++++++++++++++++++++++++++++++++++++++++\n 2 files changed, 213 insertions(+)", "diff": "diff --git a/drivers/net/mlx5/mlx5_flow.h b/drivers/net/mlx5/mlx5_flow.h\nindex 1e30c93..376519f 100644\n--- a/drivers/net/mlx5/mlx5_flow.h\n+++ b/drivers/net/mlx5/mlx5_flow.h\n@@ -122,6 +122,10 @@ enum mlx5_feature_name {\n /* Pattern eCPRI Layer bit. */\n #define MLX5_FLOW_LAYER_ECPRI (UINT64_C(1) << 29)\n \n+/* IPv6 Fragment Extension Header bit. */\n+#define MLX5_FLOW_LAYER_OUTER_L3_IPV6_FRAG_EXT (1u << 30)\n+#define MLX5_FLOW_LAYER_INNER_L3_IPV6_FRAG_EXT (1u << 31)\n+\n /* Outer Masks. */\n #define MLX5_FLOW_LAYER_OUTER_L3 \\\n \t(MLX5_FLOW_LAYER_OUTER_L3_IPV4 | MLX5_FLOW_LAYER_OUTER_L3_IPV6)\ndiff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c\nindex 4403abc..eb1db12 100644\n--- a/drivers/net/mlx5/mlx5_flow_dv.c\n+++ b/drivers/net/mlx5/mlx5_flow_dv.c\n@@ -1901,6 +1901,120 @@ struct field_modify_info modify_tcp[] = {\n }\n \n /**\n+ * Validate IPV6 fragment extension item.\n+ *\n+ * @param[in] item\n+ * Item specification.\n+ * @param[in] item_flags\n+ * Bit-fields that holds the items detected until now.\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_item_ipv6_frag_ext(const struct rte_flow_item *item,\n+\t\t\t\t uint64_t item_flags,\n+\t\t\t\t struct rte_flow_error *error)\n+{\n+\tconst struct rte_flow_item_ipv6_frag_ext *spec = item->spec;\n+\tconst struct rte_flow_item_ipv6_frag_ext *last = item->last;\n+\tconst struct rte_flow_item_ipv6_frag_ext *mask = item->mask;\n+\trte_be16_t frag_data_spec = 0;\n+\trte_be16_t frag_data_last = 0;\n+\tconst int tunnel = !!(item_flags & MLX5_FLOW_LAYER_TUNNEL);\n+\tconst uint64_t l4m = tunnel ? MLX5_FLOW_LAYER_INNER_L4 :\n+\t\t\t\t MLX5_FLOW_LAYER_OUTER_L4;\n+\tint ret = 0;\n+\tstruct rte_flow_item_ipv6_frag_ext nic_mask = {\n+\t\t.hdr = {\n+\t\t\t.next_header = 0xff,\n+\t\t\t.frag_data = RTE_BE16(0xffff),\n+\t\t},\n+\t};\n+\n+\tif (item_flags & l4m)\n+\t\treturn rte_flow_error_set(error, EINVAL,\n+\t\t\t\t\t RTE_FLOW_ERROR_TYPE_ITEM, item,\n+\t\t\t\t\t \"ipv6 fragment extension item cannot \"\n+\t\t\t\t\t \"follow L4 item.\");\n+\tif ((tunnel && !(item_flags & MLX5_FLOW_LAYER_INNER_L3_IPV6)) ||\n+\t (!tunnel && !(item_flags & MLX5_FLOW_LAYER_OUTER_L3_IPV6)))\n+\t\treturn rte_flow_error_set(error, EINVAL,\n+\t\t\t\t\t RTE_FLOW_ERROR_TYPE_ITEM, item,\n+\t\t\t\t\t \"ipv6 fragment extension item must \"\n+\t\t\t\t\t \"follow ipv6 item\");\n+\tif (spec && mask)\n+\t\tfrag_data_spec = spec->hdr.frag_data & mask->hdr.frag_data;\n+\tif (!frag_data_spec)\n+\t\treturn 0;\n+\t/*\n+\t * spec and mask are valid, enforce using full mask to make sure the\n+\t * complete value is used correctly.\n+\t */\n+\tif ((mask->hdr.frag_data & RTE_BE16(RTE_IPV6_FRAG_USED_MASK)) !=\n+\t\t\t\tRTE_BE16(RTE_IPV6_FRAG_USED_MASK))\n+\t\treturn rte_flow_error_set(error, EINVAL,\n+\t\t\t\t\t RTE_FLOW_ERROR_TYPE_ITEM_MASK,\n+\t\t\t\t\t item, \"must use full mask for\"\n+\t\t\t\t\t \" frag_data\");\n+\t/*\n+\t * Match on frag_data 0x00001 means M is 1 and frag-offset is 0.\n+\t * This is 1st fragment of fragmented packet.\n+\t */\n+\tif (frag_data_spec == RTE_BE16(RTE_IPV6_EHDR_MF_MASK))\n+\t\treturn rte_flow_error_set(error, ENOTSUP,\n+\t\t\t\t\t RTE_FLOW_ERROR_TYPE_ITEM, item,\n+\t\t\t\t\t \"match on first fragment not \"\n+\t\t\t\t\t \"supported\");\n+\tif (frag_data_spec && !last)\n+\t\treturn rte_flow_error_set(error, EINVAL,\n+\t\t\t\t\t RTE_FLOW_ERROR_TYPE_ITEM, item,\n+\t\t\t\t\t \"specified value not supported\");\n+\tret = mlx5_flow_item_acceptable\n+\t\t\t\t(item, (const uint8_t *)mask,\n+\t\t\t\t (const uint8_t *)&nic_mask,\n+\t\t\t\t sizeof(struct rte_flow_item_ipv6_frag_ext),\n+\t\t\t\t MLX5_ITEM_RANGE_ACCEPTED, error);\n+\tif (ret)\n+\t\treturn ret;\n+\t/* spec and last are valid, validate the specified range. */\n+\tfrag_data_last = last->hdr.frag_data & mask->hdr.frag_data;\n+\t/*\n+\t * Match on frag_data spec 0x0009 and last 0xfff9\n+\t * means M is 1 and frag-offset is > 0.\n+\t * This packet is fragment 2nd and onward, excluding last.\n+\t * This is not yet supported in MLX5, return appropriate\n+\t * error message.\n+\t */\n+\tif (frag_data_spec == RTE_BE16(RTE_IPV6_EHDR_FO_ALIGN |\n+\t\t\t\t RTE_IPV6_EHDR_MF_MASK) &&\n+\t frag_data_last == RTE_BE16(RTE_IPV6_FRAG_USED_MASK))\n+\t\treturn rte_flow_error_set(error, ENOTSUP,\n+\t\t\t\t\t RTE_FLOW_ERROR_TYPE_ITEM_LAST,\n+\t\t\t\t\t last, \"match on following \"\n+\t\t\t\t\t \"fragments not supported\");\n+\t/*\n+\t * Match on frag_data spec 0x0008 and last 0xfff8\n+\t * means M is 0 and frag-offset is > 0.\n+\t * This packet is last fragment of fragmented packet.\n+\t * This is not yet supported in MLX5, return appropriate\n+\t * error message.\n+\t */\n+\tif (frag_data_spec == RTE_BE16(RTE_IPV6_EHDR_FO_ALIGN) &&\n+\t frag_data_last == RTE_BE16(RTE_IPV6_EHDR_FO_MASK))\n+\t\treturn rte_flow_error_set(error, ENOTSUP,\n+\t\t\t\t\t RTE_FLOW_ERROR_TYPE_ITEM_LAST,\n+\t\t\t\t\t last, \"match on last \"\n+\t\t\t\t\t \"fragment not supported\");\n+\t/* Other range values are invalid and rejected. */\n+\treturn rte_flow_error_set(error, EINVAL,\n+\t\t\t\t RTE_FLOW_ERROR_TYPE_ITEM_LAST, last,\n+\t\t\t\t \"specified range not supported\");\n+}\n+\n+/**\n * Validate the pop VLAN action.\n *\n * @param[in] dev\n@@ -5349,6 +5463,29 @@ struct field_modify_info modify_tcp[] = {\n \t\t\t\tnext_protocol = 0xff;\n \t\t\t}\n \t\t\tbreak;\n+\t\tcase RTE_FLOW_ITEM_TYPE_IPV6_FRAG_EXT:\n+\t\t\tret = flow_dv_validate_item_ipv6_frag_ext(items,\n+\t\t\t\t\t\t\t\t item_flags,\n+\t\t\t\t\t\t\t\t error);\n+\t\t\tif (ret < 0)\n+\t\t\t\treturn ret;\n+\t\t\tlast_item = tunnel ?\n+\t\t\t\t\tMLX5_FLOW_LAYER_INNER_L3_IPV6_FRAG_EXT :\n+\t\t\t\t\tMLX5_FLOW_LAYER_OUTER_L3_IPV6_FRAG_EXT;\n+\t\t\tif (items->mask != NULL &&\n+\t\t\t ((const struct rte_flow_item_ipv6_frag_ext *)\n+\t\t\t items->mask)->hdr.next_header) {\n+\t\t\t\tnext_protocol =\n+\t\t\t\t((const struct rte_flow_item_ipv6_frag_ext *)\n+\t\t\t\t items->spec)->hdr.next_header;\n+\t\t\t\tnext_protocol &=\n+\t\t\t\t((const struct rte_flow_item_ipv6_frag_ext *)\n+\t\t\t\t items->mask)->hdr.next_header;\n+\t\t\t} else {\n+\t\t\t\t/* Reset for inner layer. */\n+\t\t\t\tnext_protocol = 0xff;\n+\t\t\t}\n+\t\t\tbreak;\n \t\tcase RTE_FLOW_ITEM_TYPE_TCP:\n \t\t\tret = mlx5_flow_validate_item_tcp\n \t\t\t\t\t\t(items, item_flags,\n@@ -6527,6 +6664,57 @@ struct field_modify_info modify_tcp[] = {\n }\n \n /**\n+ * Add IPV6 fragment extension item to matcher and to the value.\n+ *\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[in] inner\n+ * Item is inner pattern.\n+ */\n+static void\n+flow_dv_translate_item_ipv6_frag_ext(void *matcher, void *key,\n+\t\t\t\t const struct rte_flow_item *item,\n+\t\t\t\t int inner)\n+{\n+\tconst struct rte_flow_item_ipv6_frag_ext *ipv6_frag_ext_m = item->mask;\n+\tconst struct rte_flow_item_ipv6_frag_ext *ipv6_frag_ext_v = item->spec;\n+\tconst struct rte_flow_item_ipv6_frag_ext nic_mask = {\n+\t\t.hdr = {\n+\t\t\t.next_header = 0xff,\n+\t\t\t.frag_data = RTE_BE16(0xffff),\n+\t\t},\n+\t};\n+\tvoid *headers_m;\n+\tvoid *headers_v;\n+\n+\tif (inner) {\n+\t\theaders_m = MLX5_ADDR_OF(fte_match_param, matcher,\n+\t\t\t\t\t inner_headers);\n+\t\theaders_v = MLX5_ADDR_OF(fte_match_param, key, inner_headers);\n+\t} else {\n+\t\theaders_m = MLX5_ADDR_OF(fte_match_param, matcher,\n+\t\t\t\t\t outer_headers);\n+\t\theaders_v = MLX5_ADDR_OF(fte_match_param, key, outer_headers);\n+\t}\n+\t/* IPv6 fragment extension item exists, so packet is IP fragment. */\n+\tMLX5_SET(fte_match_set_lyr_2_4, headers_m, frag, 1);\n+\tMLX5_SET(fte_match_set_lyr_2_4, headers_v, frag, 1);\n+\tif (!ipv6_frag_ext_v)\n+\t\treturn;\n+\tif (!ipv6_frag_ext_m)\n+\t\tipv6_frag_ext_m = &nic_mask;\n+\tMLX5_SET(fte_match_set_lyr_2_4, headers_m, ip_protocol,\n+\t\t ipv6_frag_ext_m->hdr.next_header);\n+\tMLX5_SET(fte_match_set_lyr_2_4, headers_v, ip_protocol,\n+\t\t ipv6_frag_ext_v->hdr.next_header &\n+\t\t ipv6_frag_ext_m->hdr.next_header);\n+}\n+\n+/**\n * Add TCP item to matcher and to the value.\n *\n * @param[in, out] matcher\n@@ -8868,6 +9056,27 @@ struct field_modify_info modify_tcp[] = {\n \t\t\t\tnext_protocol = 0xff;\n \t\t\t}\n \t\t\tbreak;\n+\t\tcase RTE_FLOW_ITEM_TYPE_IPV6_FRAG_EXT:\n+\t\t\tflow_dv_translate_item_ipv6_frag_ext(match_mask,\n+\t\t\t\t\t\t\t match_value,\n+\t\t\t\t\t\t\t items, tunnel);\n+\t\t\tlast_item = tunnel ?\n+\t\t\t\t\tMLX5_FLOW_LAYER_INNER_L3_IPV6_FRAG_EXT :\n+\t\t\t\t\tMLX5_FLOW_LAYER_OUTER_L3_IPV6_FRAG_EXT;\n+\t\t\tif (items->mask != NULL &&\n+\t\t\t ((const struct rte_flow_item_ipv6_frag_ext *)\n+\t\t\t items->mask)->hdr.next_header) {\n+\t\t\t\tnext_protocol =\n+\t\t\t\t((const struct rte_flow_item_ipv6_frag_ext *)\n+\t\t\t\t items->spec)->hdr.next_header;\n+\t\t\t\tnext_protocol &=\n+\t\t\t\t((const struct rte_flow_item_ipv6_frag_ext *)\n+\t\t\t\t items->mask)->hdr.next_header;\n+\t\t\t} else {\n+\t\t\t\t/* Reset for inner layer. */\n+\t\t\t\tnext_protocol = 0xff;\n+\t\t\t}\n+\t\t\tbreak;\n \t\tcase RTE_FLOW_ITEM_TYPE_TCP:\n \t\t\tflow_dv_translate_item_tcp(match_mask, match_value,\n \t\t\t\t\t\t items, tunnel);\n", "prefixes": [ "v3", "09/11" ] }{ "id": 79607, "url": "