Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/65291/?format=api
http://patches.dpdk.org/api/patches/65291/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/1580292549-27439-4-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-4-git-send-email-matan@mellanox.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1580292549-27439-4-git-send-email-matan@mellanox.com", "date": "2020-01-29T10:08:59", "name": "[v2,03/13] vdpa/mlx5: support features get operations", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "8a12a19c6aebc8cb9f3f8a358a12bb9c7465ef3b", "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-4-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/65291/comments/", "check": "fail", "checks": "http://patches.dpdk.org/api/patches/65291/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 6E439A0531;\n\tWed, 29 Jan 2020 11:09:48 +0100 (CET)", "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id C172D1BFBE;\n\tWed, 29 Jan 2020 11:09:36 +0100 (CET)", "from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129])\n by dpdk.org (Postfix) with ESMTP id 0B94F1BFBE\n for <dev@dpdk.org>; Wed, 29 Jan 2020 11:09:34 +0100 (CET)", "from Internal Mail-Server by MTLPINE2 (envelope-from\n asafp@mellanox.com)\n with ESMTPS (AES256-SHA encrypted); 29 Jan 2020 12:09:34 +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 00TA9BHJ032108;\n Wed, 29 Jan 2020 12:09:34 +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:08:59 +0000", "Message-Id": "<1580292549-27439-4-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 03/13] vdpa/mlx5: support features get\n\toperations", "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 get_features and get_protocol_features operations.\n\nPart of the features are reported by the DevX capabilities.\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 | 66 +++++++++++++++++++++++++++++++++--\n 2 files changed, 71 insertions(+), 2 deletions(-)", "diff": "diff --git a/doc/guides/vdpadevs/features/mlx5.ini b/doc/guides/vdpadevs/features/mlx5.ini\nindex d635bdf..fea491d 100644\n--- a/doc/guides/vdpadevs/features/mlx5.ini\n+++ b/doc/guides/vdpadevs/features/mlx5.ini\n@@ -4,6 +4,13 @@\n ; Refer to default.ini for the full list of available driver features.\n ;\n [Features]\n+\n+any layout = Y\n+guest announce = Y\n+mq = Y\n+proto mq = Y\n+proto log shmfd = Y\n+proto host notifier = Y\n Other kdrv = Y\n ARMv8 = Y\n Power8 = Y\ndiff --git a/drivers/vdpa/mlx5/mlx5_vdpa.c b/drivers/vdpa/mlx5/mlx5_vdpa.c\nindex 15e53f2..67e90fd 100644\n--- a/drivers/vdpa/mlx5/mlx5_vdpa.c\n+++ b/drivers/vdpa/mlx5/mlx5_vdpa.c\n@@ -1,6 +1,8 @@\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@@ -10,6 +12,7 @@\n #include <mlx5_glue.h>\n #include <mlx5_common.h>\n #include <mlx5_devx_cmds.h>\n+#include <mlx5_prm.h>\n \n #include \"mlx5_vdpa_utils.h\"\n \n@@ -22,6 +25,27 @@ struct mlx5_vdpa_priv {\n \tstruct mlx5_hca_vdpa_attr caps;\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) | \\\n+\t\t\t (1ULL << VIRTIO_NET_F_GUEST_ANNOUNCE) | \\\n+\t\t\t (1ULL << VIRTIO_F_ORDER_PLATFORM))\n+\n+#define MLX5_VDPA_PROTOCOL_FEATURES \\\n+\t\t\t ((1ULL << VHOST_USER_PROTOCOL_F_SLAVE_REQ) | \\\n+\t\t\t (1ULL << VHOST_USER_PROTOCOL_F_SLAVE_SEND_FD) | \\\n+\t\t\t (1ULL << VHOST_USER_PROTOCOL_F_HOST_NOTIFIER) | \\\n+\t\t\t (1ULL << VHOST_USER_PROTOCOL_F_LOG_SHMFD) | \\\n+\t\t\t (1ULL << VHOST_USER_PROTOCOL_F_MQ))\n+\n TAILQ_HEAD(mlx5_vdpa_privs, mlx5_vdpa_priv) priv_list =\n \t\t\t\t\t TAILQ_HEAD_INITIALIZER(priv_list);\n static pthread_mutex_t priv_list_lock = PTHREAD_MUTEX_INITIALIZER;\n@@ -62,10 +86,48 @@ struct mlx5_vdpa_priv {\n \treturn 0;\n }\n \n+static int\n+mlx5_vdpa_get_vdpa_features(int did, uint64_t *features)\n+{\n+\tstruct mlx5_vdpa_priv *priv = mlx5_vdpa_find_priv_resource_by_did(did);\n+\n+\tif (priv == NULL) {\n+\t\tDRV_LOG(ERR, \"Invalid device id: %d.\", did);\n+\t\treturn -1;\n+\t}\n+\t*features = MLX5_VDPA_DEFAULT_FEATURES;\n+\tif (priv->caps.virtio_queue_type & (1 << MLX5_VIRTQ_TYPE_PACKED))\n+\t\t*features |= (1ULL << VIRTIO_F_RING_PACKED);\n+\tif (priv->caps.tso_ipv4)\n+\t\t*features |= (1ULL << VIRTIO_NET_F_HOST_TSO4);\n+\tif (priv->caps.tso_ipv6)\n+\t\t*features |= (1ULL << VIRTIO_NET_F_HOST_TSO6);\n+\tif (priv->caps.tx_csum)\n+\t\t*features |= (1ULL << VIRTIO_NET_F_CSUM);\n+\tif (priv->caps.rx_csum)\n+\t\t*features |= (1ULL << VIRTIO_NET_F_GUEST_CSUM);\n+\tif (priv->caps.virtio_version_1_0)\n+\t\t*features |= (1ULL << VIRTIO_F_VERSION_1);\n+\treturn 0;\n+}\n+\n+static int\n+mlx5_vdpa_get_protocol_features(int did, uint64_t *features)\n+{\n+\tstruct mlx5_vdpa_priv *priv = mlx5_vdpa_find_priv_resource_by_did(did);\n+\n+\tif (priv == NULL) {\n+\t\tDRV_LOG(ERR, \"Invalid device id: %d.\", did);\n+\t\treturn -1;\n+\t}\n+\t*features = MLX5_VDPA_PROTOCOL_FEATURES;\n+\treturn 0;\n+}\n+\n static struct rte_vdpa_dev_ops mlx5_vdpa_ops = {\n \t.get_queue_num = mlx5_vdpa_get_queue_num,\n-\t.get_features = NULL,\n-\t.get_protocol_features = NULL,\n+\t.get_features = mlx5_vdpa_get_vdpa_features,\n+\t.get_protocol_features = mlx5_vdpa_get_protocol_features,\n \t.dev_conf = NULL,\n \t.dev_close = NULL,\n \t.set_vring_state = NULL,\n", "prefixes": [ "v2", "03/13" ] }{ "id": 65291, "url": "