Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/65295/?format=api
http://patches.dpdk.org/api/patches/65295/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/1580292549-27439-8-git-send-email-matan@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": "<1580292549-27439-8-git-send-email-matan@mellanox.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1580292549-27439-8-git-send-email-matan@mellanox.com", "date": "2020-01-29T10:09:03", "name": "[v2,07/13] vdpa/mlx5: support stateless offloads", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "d7a927bca2df064aa194dd8c67fe1ac9f6838f5a", "submitter": { "id": 796, "url": "http://patches.dpdk.org/api/people/796/?format=api", "name": "Matan Azrad", "email": "matan@mellanox.com" }, "delegate": { "id": 2642, "url": "http://patches.dpdk.org/api/users/2642/?format=api", "username": "mcoquelin", "first_name": "Maxime", "last_name": "Coquelin", "email": "maxime.coquelin@redhat.com" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/1580292549-27439-8-git-send-email-matan@mellanox.com/mbox/", "series": [ { "id": 8335, "url": "http://patches.dpdk.org/api/series/8335/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=8335", "date": "2020-01-29T10:08:56", "name": "Introduce mlx5 vDPA driver", "version": 2, "mbox": "http://patches.dpdk.org/series/8335/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/65295/comments/", "check": "fail", "checks": "http://patches.dpdk.org/api/patches/65295/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 107AEA0531;\n\tWed, 29 Jan 2020 11:10:35 +0100 (CET)", "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 36F4D1BFB0;\n\tWed, 29 Jan 2020 11:10:07 +0100 (CET)", "from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129])\n by dpdk.org (Postfix) with ESMTP id 3AB6F1BFAF\n for <dev@dpdk.org>; Wed, 29 Jan 2020 11:10:05 +0100 (CET)", "from Internal Mail-Server by MTLPINE2 (envelope-from\n asafp@mellanox.com)\n with ESMTPS (AES256-SHA encrypted); 29 Jan 2020 12:10:00 +0200", "from pegasus07.mtr.labs.mlnx (pegasus07.mtr.labs.mlnx\n [10.210.16.112])\n by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 00TA9BHN032108;\n Wed, 29 Jan 2020 12:10:00 +0200" ], "From": "Matan Azrad <matan@mellanox.com>", "To": "dev@dpdk.org, Viacheslav Ovsiienko <viacheslavo@mellanox.com>", "Cc": "Maxime Coquelin <maxime.coquelin@redhat.com>", "Date": "Wed, 29 Jan 2020 10:09:03 +0000", "Message-Id": "<1580292549-27439-8-git-send-email-matan@mellanox.com>", "X-Mailer": "git-send-email 1.8.3.1", "In-Reply-To": "<1580292549-27439-1-git-send-email-matan@mellanox.com>", "References": "<1579539790-3882-1-git-send-email-matan@mellanox.com>\n <1580292549-27439-1-git-send-email-matan@mellanox.com>", "Subject": "[dpdk-dev] [PATCH v2 07/13] vdpa/mlx5: support stateless offloads", "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": "Add support for the next features in virtq configuration:\n\tVIRTIO_F_RING_PACKED,\n\tVIRTIO_NET_F_HOST_TSO4,\n\tVIRTIO_NET_F_HOST_TSO6,\n\tVIRTIO_NET_F_CSUM,\n\tVIRTIO_NET_F_GUEST_CSUM,\n\tVIRTIO_F_VERSION_1,\n\nThese features support depends in the DevX capabilities reported by the\ndevice.\n\nSigned-off-by: Matan Azrad <matan@mellanox.com>\nAcked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>\n---\n doc/guides/vdpadevs/features/mlx5.ini | 7 ++-\n drivers/vdpa/mlx5/mlx5_vdpa.c | 10 ----\n drivers/vdpa/mlx5/mlx5_vdpa.h | 10 ++++\n drivers/vdpa/mlx5/mlx5_vdpa_virtq.c | 108 ++++++++++++++++++++++++++++------\n 4 files changed, 107 insertions(+), 28 deletions(-)", "diff": "diff --git a/doc/guides/vdpadevs/features/mlx5.ini b/doc/guides/vdpadevs/features/mlx5.ini\nindex fea491d..e4ee34b 100644\n--- a/doc/guides/vdpadevs/features/mlx5.ini\n+++ b/doc/guides/vdpadevs/features/mlx5.ini\n@@ -4,10 +4,15 @@\n ; Refer to default.ini for the full list of available driver features.\n ;\n [Features]\n-\n+csum = Y\n+guest csum = Y\n+host tso4 = Y\n+host tso6 = Y\n+version 1 = Y\n any layout = Y\n guest announce = Y\n mq = Y\n+packed = Y\n proto mq = Y\n proto log shmfd = Y\n proto host notifier = Y\ndiff --git a/drivers/vdpa/mlx5/mlx5_vdpa.c b/drivers/vdpa/mlx5/mlx5_vdpa.c\nindex 4d30b35..dfbd0af 100644\n--- a/drivers/vdpa/mlx5/mlx5_vdpa.c\n+++ b/drivers/vdpa/mlx5/mlx5_vdpa.c\n@@ -1,8 +1,6 @@\n /* SPDX-License-Identifier: BSD-3-Clause\n * Copyright 2019 Mellanox Technologies, Ltd\n */\n-#include <linux/virtio_net.h>\n-\n #include <rte_malloc.h>\n #include <rte_log.h>\n #include <rte_errno.h>\n@@ -17,14 +15,6 @@\n #include \"mlx5_vdpa.h\"\n \n \n-#ifndef VIRTIO_F_ORDER_PLATFORM\n-#define VIRTIO_F_ORDER_PLATFORM 36\n-#endif\n-\n-#ifndef VIRTIO_F_RING_PACKED\n-#define VIRTIO_F_RING_PACKED 34\n-#endif\n-\n #define MLX5_VDPA_DEFAULT_FEATURES ((1ULL << VHOST_USER_F_PROTOCOL_FEATURES) | \\\n \t\t\t (1ULL << VIRTIO_F_ANY_LAYOUT) | \\\n \t\t\t (1ULL << VIRTIO_NET_F_MQ) | \\\ndiff --git a/drivers/vdpa/mlx5/mlx5_vdpa.h b/drivers/vdpa/mlx5/mlx5_vdpa.h\nindex a7e2185..e530058 100644\n--- a/drivers/vdpa/mlx5/mlx5_vdpa.h\n+++ b/drivers/vdpa/mlx5/mlx5_vdpa.h\n@@ -5,6 +5,7 @@\n #ifndef RTE_PMD_MLX5_VDPA_H_\n #define RTE_PMD_MLX5_VDPA_H_\n \n+#include <linux/virtio_net.h>\n #include <sys/queue.h>\n \n #include <rte_vdpa.h>\n@@ -20,6 +21,14 @@\n #define MLX5_VDPA_INTR_RETRIES 256\n #define MLX5_VDPA_INTR_RETRIES_USEC 1000\n \n+#ifndef VIRTIO_F_ORDER_PLATFORM\n+#define VIRTIO_F_ORDER_PLATFORM 36\n+#endif\n+\n+#ifndef VIRTIO_F_RING_PACKED\n+#define VIRTIO_F_RING_PACKED 34\n+#endif\n+\n struct mlx5_vdpa_cq {\n \tuint16_t log_desc_n;\n \tuint32_t cq_ci:24;\n@@ -85,6 +94,7 @@ struct mlx5_vdpa_priv {\n \tstruct mlx5_devx_obj *td;\n \tstruct mlx5_devx_obj *tis;\n \tuint16_t nr_virtqs;\n+\tuint64_t features; /* Negotiated features. */\n \tSLIST_HEAD(virtq_list, mlx5_vdpa_virtq) virtq_list;\n \tSLIST_HEAD(mr_list, mlx5_vdpa_query_mr) mr_list;\n };\ndiff --git a/drivers/vdpa/mlx5/mlx5_vdpa_virtq.c b/drivers/vdpa/mlx5/mlx5_vdpa_virtq.c\nindex 781bccf..e27af28 100644\n--- a/drivers/vdpa/mlx5/mlx5_vdpa_virtq.c\n+++ b/drivers/vdpa/mlx5/mlx5_vdpa_virtq.c\n@@ -57,6 +57,7 @@\n \t\tclaim_zero(mlx5_devx_cmd_destroy(priv->td));\n \t\tpriv->td = NULL;\n \t}\n+\tpriv->features = 0;\n }\n \n static uint64_t\n@@ -94,6 +95,14 @@\n \t\treturn -1;\n \tvirtq->index = index;\n \tvirtq->vq_size = vq.size;\n+\tattr.tso_ipv4 = !!(priv->features & (1ULL << VIRTIO_NET_F_HOST_TSO4));\n+\tattr.tso_ipv6 = !!(priv->features & (1ULL << VIRTIO_NET_F_HOST_TSO6));\n+\tattr.tx_csum = !!(priv->features & (1ULL << VIRTIO_NET_F_CSUM));\n+\tattr.rx_csum = !!(priv->features & (1ULL << VIRTIO_NET_F_GUEST_CSUM));\n+\tattr.virtio_version_1_0 = !!(priv->features & (1ULL <<\n+\t\t\t\t\t\t\tVIRTIO_F_VERSION_1));\n+\tattr.type = (priv->features & (1ULL << VIRTIO_F_RING_PACKED)) ?\n+\t\t\tMLX5_VIRTQ_TYPE_PACKED : MLX5_VIRTQ_TYPE_SPLIT;\n \t/*\n \t * No need event QPs creation when the guest in poll mode or when the\n \t * capability allows it.\n@@ -139,24 +148,29 @@\n \t\tattr.umems[i].offset = 0;\n \t\tattr.umems[i].size = virtq->umems[i].size;\n \t}\n-\tgpa = mlx5_vdpa_hva_to_gpa(priv->vmem, (uint64_t)(uintptr_t)vq.desc);\n-\tif (!gpa) {\n-\t\tDRV_LOG(ERR, \"Fail to get GPA for descriptor ring.\");\n-\t\tgoto error;\n-\t}\n-\tattr.desc_addr = gpa;\n-\tgpa = mlx5_vdpa_hva_to_gpa(priv->vmem, (uint64_t)(uintptr_t)vq.used);\n-\tif (!gpa) {\n-\t\tDRV_LOG(ERR, \"Fail to get GPA for used ring.\");\n-\t\tgoto error;\n-\t}\n-\tattr.used_addr = gpa;\n-\tgpa = mlx5_vdpa_hva_to_gpa(priv->vmem, (uint64_t)(uintptr_t)vq.avail);\n-\tif (!gpa) {\n-\t\tDRV_LOG(ERR, \"Fail to get GPA for available ring.\");\n-\t\tgoto error;\n+\tif (attr.type == MLX5_VIRTQ_TYPE_SPLIT) {\n+\t\tgpa = mlx5_vdpa_hva_to_gpa(priv->vmem,\n+\t\t\t\t\t (uint64_t)(uintptr_t)vq.desc);\n+\t\tif (!gpa) {\n+\t\t\tDRV_LOG(ERR, \"Failed to get descriptor ring GPA.\");\n+\t\t\tgoto error;\n+\t\t}\n+\t\tattr.desc_addr = gpa;\n+\t\tgpa = mlx5_vdpa_hva_to_gpa(priv->vmem,\n+\t\t\t\t\t (uint64_t)(uintptr_t)vq.used);\n+\t\tif (!gpa) {\n+\t\t\tDRV_LOG(ERR, \"Failed to get GPA for used ring.\");\n+\t\t\tgoto error;\n+\t\t}\n+\t\tattr.used_addr = gpa;\n+\t\tgpa = mlx5_vdpa_hva_to_gpa(priv->vmem,\n+\t\t\t\t\t (uint64_t)(uintptr_t)vq.avail);\n+\t\tif (!gpa) {\n+\t\t\tDRV_LOG(ERR, \"Failed to get GPA for available ring.\");\n+\t\t\tgoto error;\n+\t\t}\n+\t\tattr.available_addr = gpa;\n \t}\n-\tattr.available_addr = gpa;\n \trte_vhost_get_vring_base(priv->vid, index, &last_avail_idx,\n \t\t\t\t &last_used_idx);\n \tDRV_LOG(INFO, \"vid %d: Init last_avail_idx=%d, last_used_idx=%d for \"\n@@ -176,6 +190,61 @@\n \treturn -1;\n }\n \n+static int\n+mlx5_vdpa_features_validate(struct mlx5_vdpa_priv *priv)\n+{\n+\tif (priv->features & (1ULL << VIRTIO_F_RING_PACKED)) {\n+\t\tif (!(priv->caps.virtio_queue_type & (1 <<\n+\t\t\t\t\t\t MLX5_VIRTQ_TYPE_PACKED))) {\n+\t\t\tDRV_LOG(ERR, \"Failed to configur PACKED mode for vdev \"\n+\t\t\t\t\"%d - it was not reported by HW/driver\"\n+\t\t\t\t\" capability.\", priv->vid);\n+\t\t\treturn -ENOTSUP;\n+\t\t}\n+\t}\n+\tif (priv->features & (1ULL << VIRTIO_NET_F_HOST_TSO4)) {\n+\t\tif (!priv->caps.tso_ipv4) {\n+\t\t\tDRV_LOG(ERR, \"Failed to enable TSO4 for vdev %d - TSO4\"\n+\t\t\t\t\" was not reported by HW/driver capability.\",\n+\t\t\t\tpriv->vid);\n+\t\t\treturn -ENOTSUP;\n+\t\t}\n+\t}\n+\tif (priv->features & (1ULL << VIRTIO_NET_F_HOST_TSO6)) {\n+\t\tif (!priv->caps.tso_ipv6) {\n+\t\t\tDRV_LOG(ERR, \"Failed to enable TSO6 for vdev %d - TSO6\"\n+\t\t\t\t\" was not reported by HW/driver capability.\",\n+\t\t\t\tpriv->vid);\n+\t\t\treturn -ENOTSUP;\n+\t\t}\n+\t}\n+\tif (priv->features & (1ULL << VIRTIO_NET_F_CSUM)) {\n+\t\tif (!priv->caps.tx_csum) {\n+\t\t\tDRV_LOG(ERR, \"Failed to enable CSUM for vdev %d - CSUM\"\n+\t\t\t\t\" was not reported by HW/driver capability.\",\n+\t\t\t\tpriv->vid);\n+\t\t\treturn -ENOTSUP;\n+\t\t}\n+\t}\n+\tif (priv->features & (1ULL << VIRTIO_NET_F_GUEST_CSUM)) {\n+\t\tif (!priv->caps.rx_csum) {\n+\t\t\tDRV_LOG(ERR, \"Failed to enable GUEST CSUM for vdev %d\"\n+\t\t\t\t\" GUEST CSUM was not reported by HW/driver \"\n+\t\t\t\t\"capability.\", priv->vid);\n+\t\t\treturn -ENOTSUP;\n+\t\t}\n+\t}\n+\tif (priv->features & (1ULL << VIRTIO_F_VERSION_1)) {\n+\t\tif (!priv->caps.virtio_version_1_0) {\n+\t\t\tDRV_LOG(ERR, \"Failed to enable version 1 for vdev %d \"\n+\t\t\t\t\"version 1 was not reported by HW/driver\"\n+\t\t\t\t\" capability.\", priv->vid);\n+\t\t\treturn -ENOTSUP;\n+\t\t}\n+\t}\n+\treturn 0;\n+}\n+\n int\n mlx5_vdpa_virtqs_prepare(struct mlx5_vdpa_priv *priv)\n {\n@@ -183,7 +252,12 @@\n \tstruct mlx5_vdpa_virtq *virtq;\n \tuint32_t i;\n \tuint16_t nr_vring = rte_vhost_get_vring_num(priv->vid);\n+\tint ret = rte_vhost_get_negotiated_features(priv->vid, &priv->features);\n \n+\tif (ret || mlx5_vdpa_features_validate(priv)) {\n+\t\tDRV_LOG(ERR, \"Failed to configure negotiated features.\");\n+\t\treturn -1;\n+\t}\n \tpriv->td = mlx5_devx_cmd_create_td(priv->ctx);\n \tif (!priv->td) {\n \t\tDRV_LOG(ERR, \"Failed to create transport domain.\");\n", "prefixes": [ "v2", "07/13" ] }{ "id": 65295, "url": "