Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/74097/?format=api
http://patches.dpdk.org/api/patches/74097/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/1594818621-438919-3-git-send-email-suanmingm@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": "<1594818621-438919-3-git-send-email-suanmingm@mellanox.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1594818621-438919-3-git-send-email-suanmingm@mellanox.com", "date": "2020-07-15T13:10:21", "name": "[2/2] net/mlx5: add decap enable device argument", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "9ff75cbd039e7821c74af40eb8a829b896776ddd", "submitter": { "id": 1358, "url": "http://patches.dpdk.org/api/people/1358/?format=api", "name": "Suanming Mou", "email": "suanmingm@mellanox.com" }, "delegate": { "id": 3268, "url": "http://patches.dpdk.org/api/users/3268/?format=api", "username": "rasland", "first_name": "Raslan", "last_name": "Darawsheh", "email": "rasland@nvidia.com" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/1594818621-438919-3-git-send-email-suanmingm@mellanox.com/mbox/", "series": [ { "id": 11050, "url": "http://patches.dpdk.org/api/series/11050/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=11050", "date": "2020-07-15T13:10:19", "name": "net/mlx5: scatter FCS with decapsulation", "version": 1, "mbox": "http://patches.dpdk.org/series/11050/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/74097/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/74097/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 17D88A0547;\n\tWed, 15 Jul 2020 15:10:43 +0200 (CEST)", "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 017561BEDF;\n\tWed, 15 Jul 2020 15:10:33 +0200 (CEST)", "from git-send-mailer.rdmz.labs.mlnx (unknown [37.142.13.130])\n by dpdk.org (Postfix) with ESMTP id 86D2C1BED5\n for <dev@dpdk.org>; Wed, 15 Jul 2020 15:10:30 +0200 (CEST)" ], "From": "Suanming Mou <suanmingm@mellanox.com>", "To": "viacheslavo@mellanox.com,\n\tmatan@mellanox.com", "Cc": "orika@mellanox.com,\n\trasland@mellanox.com,\n\tdev@dpdk.org", "Date": "Wed, 15 Jul 2020 21:10:21 +0800", "Message-Id": "<1594818621-438919-3-git-send-email-suanmingm@mellanox.com>", "X-Mailer": "git-send-email 1.8.3.1", "In-Reply-To": "<1594818621-438919-1-git-send-email-suanmingm@mellanox.com>", "References": "<1594818621-438919-1-git-send-email-suanmingm@mellanox.com>", "Subject": "[dpdk-dev] [PATCH 2/2] net/mlx5: add decap enable device argument", "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": "There are some limitations on the some NICs (at least on ConnectX-6DX\nand BlueField2) with supporting FCS (frame checksum) scattering for\nthe tunnel decapsulated packets.\n\nFor the case only one of the features can be supported in the same time,\nand the new devarg \"decap_en\" is introduced to provide the choice to the\nusers.\n\nIf FCS scattering feature is not supposed to be engaged by application,\nthis new devarg should be specified as \"decap_en=0\", forcing the FCS\nfeature enable and rejecting tunnel decap actions in the rte_flow engine.\nIf FCS scatter is not needed and application supposes to use tunnel\ndecapsulation in rte_flow, the devarg can be omitted or set to non-zero\nvalue (this is default settings).\n\nSigned-off-by: Suanming Mou <suanmingm@mellanox.com>\nAcked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>\n---\n doc/guides/nics/mlx5.rst | 10 ++++++++++\n drivers/net/mlx5/linux/mlx5_os.c | 12 ++++++++++--\n drivers/net/mlx5/mlx5.c | 6 ++++++\n drivers/net/mlx5/mlx5.h | 1 +\n drivers/net/mlx5/mlx5_flow_dv.c | 5 +++++\n 5 files changed, 32 insertions(+), 2 deletions(-)", "diff": "diff --git a/doc/guides/nics/mlx5.rst b/doc/guides/nics/mlx5.rst\nindex 97261d6..ccf38b6 100644\n--- a/doc/guides/nics/mlx5.rst\n+++ b/doc/guides/nics/mlx5.rst\n@@ -884,6 +884,16 @@ Driver options\n \n By default, the PMD will set this value to 0.\n \n+- ``decap_en`` parameter [int]\n+\n+ The new devarg ``decap_en`` is introduced to provide the choice to the NICs\n+ which does not support FCS (frame checksum) scattering for the tunnel\n+ decapsulated packets. By set the devarg value 0 to force the FCS feature\n+ enable and rejecting tunnel decap actions in the rte_flow engine for these\n+ special NICs.\n+\n+ By default, the PMD will set this value to 1.\n+\n .. _mlx5_firmware_config:\n \n Firmware configuration\ndiff --git a/drivers/net/mlx5/linux/mlx5_os.c b/drivers/net/mlx5/linux/mlx5_os.c\nindex 2dc57b2..37420cb 100644\n--- a/drivers/net/mlx5/linux/mlx5_os.c\n+++ b/drivers/net/mlx5/linux/mlx5_os.c\n@@ -780,8 +780,6 @@\n \t\t(config.hw_vlan_strip ? \"\" : \"not \"));\n \tconfig.hw_fcs_strip = !!(sh->device_attr.raw_packet_caps &\n \t\t\t\t IBV_RAW_PACKET_CAP_SCATTER_FCS);\n-\tDRV_LOG(DEBUG, \"FCS stripping configuration is %ssupported\",\n-\t\t(config.hw_fcs_strip ? \"\" : \"not \"));\n #if defined(HAVE_IBV_WQ_FLAG_RX_END_PADDING)\n \thw_padding = !!sh->device_attr.rx_pad_end_addr_align;\n #elif defined(HAVE_IBV_WQ_FLAGS_PCI_WRITE_END_PADDING)\n@@ -879,6 +877,15 @@\n \t\t}\n #endif\n \t}\n+\t/*\n+\t * If HW has bug working with tunnel packet decapsulation and\n+\t * scatter FCS, and decapsulation is needed, clear the hw_fcs_strip\n+\t * bit. Then DEV_RX_OFFLOAD_KEEP_CRC bit will not be set anymore.\n+\t */\n+\tif (config.hca_attr.scatter_fcs_w_decap_disable && config.decap_en)\n+\t\tconfig.hw_fcs_strip = 0;\n+\tDRV_LOG(DEBUG, \"FCS stripping configuration is %ssupported\",\n+\t\t(config.hw_fcs_strip ? \"\" : \"not \"));\n \tif (config.mprq.enabled && mprq) {\n \t\tif (config.mprq.stride_num_n &&\n \t\t (config.mprq.stride_num_n > mprq_max_stride_num_n ||\n@@ -1652,6 +1659,7 @@\n \t\t},\n \t\t.dv_esw_en = 1,\n \t\t.dv_flow_en = 1,\n+\t\t.decap_en = 1,\n \t\t.log_hp_size = MLX5_ARG_UNSET,\n \t};\n \t/* Device specific configuration. */\ndiff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c\nindex 0c654ed..9daacaf 100644\n--- a/drivers/net/mlx5/mlx5.c\n+++ b/drivers/net/mlx5/mlx5.c\n@@ -167,6 +167,9 @@\n /* Flow memory reclaim mode. */\n #define MLX5_RECLAIM_MEM \"reclaim_mem_mode\"\n \n+/* Decap will be used or not. */\n+#define MLX5_DECAP_EN \"decap_en\"\n+\n static const char *MZ_MLX5_PMD_SHARED_DATA = \"mlx5_pmd_shared_data\";\n \n /* Shared memory between primary and secondary processes. */\n@@ -1374,6 +1377,8 @@ struct mlx5_dev_ctx_shared *\n \t\t\treturn -rte_errno;\n \t\t}\n \t\tconfig->reclaim_mode = tmp;\n+\t} else if (strcmp(MLX5_DECAP_EN, key) == 0) {\n+\t\tconfig->decap_en = !!tmp;\n \t} else {\n \t\tDRV_LOG(WARNING, \"%s: unknown parameter\", key);\n \t\trte_errno = EINVAL;\n@@ -1430,6 +1435,7 @@ struct mlx5_dev_ctx_shared *\n \t\tMLX5_CLASS_ARG_NAME,\n \t\tMLX5_HP_BUF_SIZE,\n \t\tMLX5_RECLAIM_MEM,\n+\t\tMLX5_DECAP_EN,\n \t\tNULL,\n \t};\n \tstruct rte_kvargs *kvlist;\ndiff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h\nindex 46e66eb..c7b6a84 100644\n--- a/drivers/net/mlx5/mlx5.h\n+++ b/drivers/net/mlx5/mlx5.h\n@@ -216,6 +216,7 @@ struct mlx5_dev_config {\n \tunsigned int devx:1; /* Whether devx interface is available or not. */\n \tunsigned int dest_tir:1; /* Whether advanced DR API is available. */\n \tunsigned int reclaim_mode:2; /* Memory reclaim mode. */\n+\tunsigned int decap_en:1; /* Whether decap will be used or not. */\n \tstruct {\n \t\tunsigned int enabled:1; /* Whether MPRQ is enabled. */\n \t\tunsigned int stride_num_n; /* Number of strides. */\ndiff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c\nindex 8b5b683..37db7c5 100644\n--- a/drivers/net/mlx5/mlx5_flow_dv.c\n+++ b/drivers/net/mlx5/mlx5_flow_dv.c\n@@ -2428,6 +2428,11 @@ struct field_modify_info modify_tcp[] = {\n {\n \tconst struct mlx5_priv *priv = dev->data->dev_private;\n \n+\tif (priv->config.hca_attr.scatter_fcs_w_decap_disable &&\n+\t !priv->config.decap_en)\n+\t\treturn rte_flow_error_set(error, ENOTSUP,\n+\t\t\t\t\t RTE_FLOW_ERROR_TYPE_ACTION, NULL,\n+\t\t\t\t\t \"decap is not enabled\");\n \tif (action_flags & MLX5_FLOW_XCAP_ACTIONS)\n \t\treturn rte_flow_error_set(error, ENOTSUP,\n \t\t\t\t\t RTE_FLOW_ERROR_TYPE_ACTION, NULL,\n", "prefixes": [ "2/2" ] }{ "id": 74097, "url": "