get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/69340/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 69340,
    "url": "https://patches.dpdk.org/api/patches/69340/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1587902856-443267-2-git-send-email-matan@mellanox.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": "<1587902856-443267-2-git-send-email-matan@mellanox.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1587902856-443267-2-git-send-email-matan@mellanox.com",
    "date": "2020-04-26T12:07:34",
    "name": "[1/3] vdpa/mlx5: manage virtqs by array",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "b960c85a7ead261877b419122cdc61ea396f40d2",
    "submitter": {
        "id": 796,
        "url": "https://patches.dpdk.org/api/people/796/?format=api",
        "name": "Matan Azrad",
        "email": "matan@mellanox.com"
    },
    "delegate": {
        "id": 2642,
        "url": "https://patches.dpdk.org/api/users/2642/?format=api",
        "username": "mcoquelin",
        "first_name": "Maxime",
        "last_name": "Coquelin",
        "email": "maxime.coquelin@redhat.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1587902856-443267-2-git-send-email-matan@mellanox.com/mbox/",
    "series": [
        {
            "id": 9645,
            "url": "https://patches.dpdk.org/api/series/9645/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=9645",
            "date": "2020-04-26T12:07:33",
            "name": "vdpa/mlx5: recreate a virtq becoming enabled",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/9645/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/69340/comments/",
    "check": "fail",
    "checks": "https://patches.dpdk.org/api/patches/69340/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 DF248A00C5;\n\tSun, 26 Apr 2020 14:08:00 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id B9C081C042;\n\tSun, 26 Apr 2020 14:08:00 +0200 (CEST)",
            "from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129])\n by dpdk.org (Postfix) with ESMTP id E74E01BF7C\n for <dev@dpdk.org>; Sun, 26 Apr 2020 14:07:58 +0200 (CEST)",
            "from Internal Mail-Server by MTLPINE2 (envelope-from\n matan@mellanox.com)\n with ESMTPS (AES256-SHA encrypted); 26 Apr 2020 15:07:58 +0300",
            "from pegasus25.mtr.labs.mlnx. (pegasus25.mtr.labs.mlnx\n [10.210.16.10])\n by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 03QC7krB016256;\n Sun, 26 Apr 2020 15:07:58 +0300"
        ],
        "From": "Matan Azrad <matan@mellanox.com>",
        "To": "dev@dpdk.org",
        "Cc": "Viacheslav Ovsiienko <viacheslavo@mellanox.com>,\n Shahaf Shuler <shahafs@mellanox.com>,\n Maxime Coquelin <maxime.coquelin@redhat.com>",
        "Date": "Sun, 26 Apr 2020 12:07:34 +0000",
        "Message-Id": "<1587902856-443267-2-git-send-email-matan@mellanox.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "In-Reply-To": "<1587902856-443267-1-git-send-email-matan@mellanox.com>",
        "References": "<1585653143-21987-1-git-send-email-matan@mellanox.com>\n <1587902856-443267-1-git-send-email-matan@mellanox.com>",
        "Subject": "[dpdk-dev] [PATCH 1/3] vdpa/mlx5: manage virtqs by array",
        "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": "As a preparation to listen the virtqs status before the device is\nconfigured, manage the virtqs structures in array instead of list.\n\nSigned-off-by: Matan Azrad <matan@mellanox.com>\nAcked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>\n---\n drivers/vdpa/mlx5/mlx5_vdpa.c       | 43 ++++++++++++++++------------------\n drivers/vdpa/mlx5/mlx5_vdpa.h       |  2 +-\n drivers/vdpa/mlx5/mlx5_vdpa_lm.c    | 43 ++++++++++++++++------------------\n drivers/vdpa/mlx5/mlx5_vdpa_steer.c | 18 +++++++--------\n drivers/vdpa/mlx5/mlx5_vdpa_virtq.c | 46 +++++++++++++++----------------------\n 5 files changed, 68 insertions(+), 84 deletions(-)",
    "diff": "diff --git a/drivers/vdpa/mlx5/mlx5_vdpa.c b/drivers/vdpa/mlx5/mlx5_vdpa.c\nindex f1bfe7a..70327df 100644\n--- a/drivers/vdpa/mlx5/mlx5_vdpa.c\n+++ b/drivers/vdpa/mlx5/mlx5_vdpa.c\n@@ -116,20 +116,18 @@\n {\n \tint did = rte_vhost_get_vdpa_device_id(vid);\n \tstruct mlx5_vdpa_priv *priv = mlx5_vdpa_find_priv_resource_by_did(did);\n-\tstruct mlx5_vdpa_virtq *virtq = NULL;\n \n \tif (priv == NULL) {\n \t\tDRV_LOG(ERR, \"Invalid device id: %d.\", did);\n \t\treturn -EINVAL;\n \t}\n-\tSLIST_FOREACH(virtq, &priv->virtq_list, next)\n-\t\tif (virtq->index == vring)\n-\t\t\tbreak;\n-\tif (!virtq) {\n+\tif (!priv->configured || vring >= RTE_MIN((int)priv->nr_virtqs,\n+\t    (int)priv->caps.max_num_virtio_queues * 2) ||\n+\t    !priv->virtqs[vring].virtq) {\n \t\tDRV_LOG(ERR, \"Invalid or unconfigured vring id: %d.\", vring);\n \t\treturn -EINVAL;\n \t}\n-\treturn mlx5_vdpa_virtq_enable(virtq, state);\n+\treturn mlx5_vdpa_virtq_enable(&priv->virtqs[vring], state);\n }\n \n static int\n@@ -482,28 +480,28 @@\n \t\trte_errno = ENODEV;\n \t\treturn -rte_errno;\n \t}\n-\tpriv = rte_zmalloc(\"mlx5 vDPA device private\", sizeof(*priv),\n-\t\t\t   RTE_CACHE_LINE_SIZE);\n-\tif (!priv) {\n-\t\tDRV_LOG(ERR, \"Failed to allocate private memory.\");\n-\t\trte_errno = ENOMEM;\n-\t\tgoto error;\n-\t}\n \tret = mlx5_devx_cmd_query_hca_attr(ctx, &attr);\n \tif (ret) {\n \t\tDRV_LOG(ERR, \"Unable to read HCA capabilities.\");\n \t\trte_errno = ENOTSUP;\n \t\tgoto error;\n-\t} else {\n-\t\tif (!attr.vdpa.valid || !attr.vdpa.max_num_virtio_queues) {\n-\t\t\tDRV_LOG(ERR, \"Not enough capabilities to support vdpa,\"\n-\t\t\t\t\" maybe old FW/OFED version?\");\n-\t\t\trte_errno = ENOTSUP;\n-\t\t\tgoto error;\n-\t\t}\n-\t\tpriv->caps = attr.vdpa;\n-\t\tpriv->log_max_rqt_size = attr.log_max_rqt_size;\n+\t} else if (!attr.vdpa.valid || !attr.vdpa.max_num_virtio_queues) {\n+\t\tDRV_LOG(ERR, \"Not enough capabilities to support vdpa, maybe \"\n+\t\t\t\"old FW/OFED version?\");\n+\t\trte_errno = ENOTSUP;\n+\t\tgoto error;\n+\t}\n+\tpriv = rte_zmalloc(\"mlx5 vDPA device private\", sizeof(*priv) +\n+\t\t\t   sizeof(struct mlx5_vdpa_virtq) *\n+\t\t\t   attr.vdpa.max_num_virtio_queues * 2,\n+\t\t\t   RTE_CACHE_LINE_SIZE);\n+\tif (!priv) {\n+\t\tDRV_LOG(ERR, \"Failed to allocate private memory.\");\n+\t\trte_errno = ENOMEM;\n+\t\tgoto error;\n \t}\n+\tpriv->caps = attr.vdpa;\n+\tpriv->log_max_rqt_size = attr.log_max_rqt_size;\n \tpriv->ctx = ctx;\n \tpriv->dev_addr.pci_addr = pci_dev->addr;\n \tpriv->dev_addr.type = VDPA_ADDR_PCI;\n@@ -519,7 +517,6 @@\n \t\tgoto error;\n \t}\n \tSLIST_INIT(&priv->mr_list);\n-\tSLIST_INIT(&priv->virtq_list);\n \tpthread_mutex_lock(&priv_list_lock);\n \tTAILQ_INSERT_TAIL(&priv_list, priv, next);\n \tpthread_mutex_unlock(&priv_list_lock);\ndiff --git a/drivers/vdpa/mlx5/mlx5_vdpa.h b/drivers/vdpa/mlx5/mlx5_vdpa.h\nindex 75af410..baec106 100644\n--- a/drivers/vdpa/mlx5/mlx5_vdpa.h\n+++ b/drivers/vdpa/mlx5/mlx5_vdpa.h\n@@ -120,11 +120,11 @@ struct mlx5_vdpa_priv {\n \tuint16_t nr_virtqs;\n \tuint64_t features; /* Negotiated features. */\n \tuint16_t log_max_rqt_size;\n-\tSLIST_HEAD(virtq_list, mlx5_vdpa_virtq) virtq_list;\n \tstruct mlx5_vdpa_steer steer;\n \tstruct mlx5dv_var *var;\n \tvoid *virtq_db_addr;\n \tSLIST_HEAD(mr_list, mlx5_vdpa_query_mr) mr_list;\n+\tstruct mlx5_vdpa_virtq virtqs[];\n };\n \n /**\ndiff --git a/drivers/vdpa/mlx5/mlx5_vdpa_lm.c b/drivers/vdpa/mlx5/mlx5_vdpa_lm.c\nindex 4457760..77f2eda 100644\n--- a/drivers/vdpa/mlx5/mlx5_vdpa_lm.c\n+++ b/drivers/vdpa/mlx5/mlx5_vdpa_lm.c\n@@ -15,13 +15,12 @@\n \t\t.type = MLX5_VIRTQ_MODIFY_TYPE_DIRTY_BITMAP_DUMP_ENABLE,\n \t\t.dirty_bitmap_dump_enable = enable,\n \t};\n-\tstruct mlx5_vdpa_virtq *virtq;\n+\tint i;\n \n-\tSLIST_FOREACH(virtq, &priv->virtq_list, next) {\n-\t\tattr.queue_index = virtq->index;\n-\t\tif (mlx5_devx_cmd_modify_virtq(virtq->virtq, &attr)) {\n-\t\t\tDRV_LOG(ERR, \"Failed to modify virtq %d logging.\",\n-\t\t\t\tvirtq->index);\n+\tfor (i = 0; i < priv->nr_virtqs; ++i) {\n+\t\tattr.queue_index = i;\n+\t\tif (mlx5_devx_cmd_modify_virtq(priv->virtqs[i].virtq, &attr)) {\n+\t\t\tDRV_LOG(ERR, \"Failed to modify virtq %d logging.\", i);\n \t\t\treturn -1;\n \t\t}\n \t}\n@@ -47,7 +46,7 @@\n \t\t.dirty_bitmap_size = log_size,\n \t};\n \tstruct mlx5_vdpa_query_mr *mr = rte_malloc(__func__, sizeof(*mr), 0);\n-\tstruct mlx5_vdpa_virtq *virtq;\n+\tint i;\n \n \tif (!mr) {\n \t\tDRV_LOG(ERR, \"Failed to allocate mem for lm mr.\");\n@@ -67,11 +66,10 @@\n \t\tgoto err;\n \t}\n \tattr.dirty_bitmap_mkey = mr->mkey->id;\n-\tSLIST_FOREACH(virtq, &priv->virtq_list, next) {\n-\t\tattr.queue_index = virtq->index;\n-\t\tif (mlx5_devx_cmd_modify_virtq(virtq->virtq, &attr)) {\n-\t\t\tDRV_LOG(ERR, \"Failed to modify virtq %d for lm.\",\n-\t\t\t\tvirtq->index);\n+\tfor (i = 0; i < priv->nr_virtqs; ++i) {\n+\t\tattr.queue_index = i;\n+\t\tif (mlx5_devx_cmd_modify_virtq(priv->virtqs[i].virtq, &attr)) {\n+\t\t\tDRV_LOG(ERR, \"Failed to modify virtq %d for lm.\", i);\n \t\t\tgoto err;\n \t\t}\n \t}\n@@ -94,9 +92,9 @@\n mlx5_vdpa_lm_log(struct mlx5_vdpa_priv *priv)\n {\n \tstruct mlx5_devx_virtq_attr attr = {0};\n-\tstruct mlx5_vdpa_virtq *virtq;\n \tuint64_t features;\n \tint ret = rte_vhost_get_negotiated_features(priv->vid, &features);\n+\tint i;\n \n \tif (ret) {\n \t\tDRV_LOG(ERR, \"Failed to get negotiated features.\");\n@@ -104,27 +102,26 @@\n \t}\n \tif (!RTE_VHOST_NEED_LOG(features))\n \t\treturn 0;\n-\tSLIST_FOREACH(virtq, &priv->virtq_list, next) {\n-\t\tret = mlx5_vdpa_virtq_modify(virtq, 0);\n+\tfor (i = 0; i < priv->nr_virtqs; ++i) {\n+\t\tret = mlx5_vdpa_virtq_modify(&priv->virtqs[i], 0);\n \t\tif (ret)\n \t\t\treturn -1;\n-\t\tif (mlx5_devx_cmd_query_virtq(virtq->virtq, &attr)) {\n-\t\t\tDRV_LOG(ERR, \"Failed to query virtq %d.\", virtq->index);\n+\t\tif (mlx5_devx_cmd_query_virtq(priv->virtqs[i].virtq, &attr)) {\n+\t\t\tDRV_LOG(ERR, \"Failed to query virtq %d.\", i);\n \t\t\treturn -1;\n \t\t}\n \t\tDRV_LOG(INFO, \"Query vid %d vring %d: hw_available_idx=%d, \"\n-\t\t\t\"hw_used_index=%d\", priv->vid, virtq->index,\n+\t\t\t\"hw_used_index=%d\", priv->vid, i,\n \t\t\tattr.hw_available_index, attr.hw_used_index);\n-\t\tret = rte_vhost_set_vring_base(priv->vid, virtq->index,\n+\t\tret = rte_vhost_set_vring_base(priv->vid, i,\n \t\t\t\t\t       attr.hw_available_index,\n \t\t\t\t\t       attr.hw_used_index);\n \t\tif (ret) {\n-\t\t\tDRV_LOG(ERR, \"Failed to set virtq %d base.\",\n-\t\t\t\tvirtq->index);\n+\t\t\tDRV_LOG(ERR, \"Failed to set virtq %d base.\", i);\n \t\t\treturn -1;\n \t\t}\n-\t\trte_vhost_log_used_vring(priv->vid, virtq->index, 0,\n-\t\t\t\t       MLX5_VDPA_USED_RING_LEN(virtq->vq_size));\n+\t\trte_vhost_log_used_vring(priv->vid, i, 0,\n+\t\t\t      MLX5_VDPA_USED_RING_LEN(priv->virtqs[i].vq_size));\n \t}\n \treturn 0;\n }\ndiff --git a/drivers/vdpa/mlx5/mlx5_vdpa_steer.c b/drivers/vdpa/mlx5/mlx5_vdpa_steer.c\nindex 9c11452..96ffc21 100644\n--- a/drivers/vdpa/mlx5/mlx5_vdpa_steer.c\n+++ b/drivers/vdpa/mlx5/mlx5_vdpa_steer.c\n@@ -76,13 +76,13 @@\n static int\n mlx5_vdpa_rqt_prepare(struct mlx5_vdpa_priv *priv)\n {\n-\tstruct mlx5_vdpa_virtq *virtq;\n+\tint i;\n \tuint32_t rqt_n = RTE_MIN(MLX5_VDPA_DEFAULT_RQT_SIZE,\n \t\t\t\t 1 << priv->log_max_rqt_size);\n \tstruct mlx5_devx_rqt_attr *attr = rte_zmalloc(__func__, sizeof(*attr)\n \t\t\t\t\t\t      + rqt_n *\n \t\t\t\t\t\t      sizeof(uint32_t), 0);\n-\tuint32_t i = 0, j;\n+\tuint32_t k = 0, j;\n \tint ret = 0;\n \n \tif (!attr) {\n@@ -90,15 +90,15 @@\n \t\trte_errno = ENOMEM;\n \t\treturn -ENOMEM;\n \t}\n-\tSLIST_FOREACH(virtq, &priv->virtq_list, next) {\n-\t\tif (is_virtq_recvq(virtq->index, priv->nr_virtqs) &&\n-\t\t    virtq->enable) {\n-\t\t\tattr->rq_list[i] = virtq->virtq->id;\n-\t\t\ti++;\n+\tfor (i = 0; i < priv->nr_virtqs; i++) {\n+\t\tif (is_virtq_recvq(i, priv->nr_virtqs) &&\n+\t\t    priv->virtqs[i].enable) {\n+\t\t\tattr->rq_list[k] = priv->virtqs[i].virtq->id;\n+\t\t\tk++;\n \t\t}\n \t}\n-\tfor (j = 0; i != rqt_n; ++i, ++j)\n-\t\tattr->rq_list[i] = attr->rq_list[j];\n+\tfor (j = 0; k != rqt_n; ++k, ++j)\n+\t\tattr->rq_list[k] = attr->rq_list[j];\n \tattr->rq_type = MLX5_INLINE_Q_TYPE_VIRTQ;\n \tattr->rqt_max_size = rqt_n;\n \tattr->rqt_actual_size = rqt_n;\ndiff --git a/drivers/vdpa/mlx5/mlx5_vdpa_virtq.c b/drivers/vdpa/mlx5/mlx5_vdpa_virtq.c\nindex e59c172..e07c826 100644\n--- a/drivers/vdpa/mlx5/mlx5_vdpa_virtq.c\n+++ b/drivers/vdpa/mlx5/mlx5_vdpa_virtq.c\n@@ -59,12 +59,9 @@\n \t\t\t\tusleep(MLX5_VDPA_INTR_RETRIES_USEC);\n \t\t\t}\n \t\t}\n-\t\tvirtq->intr_handle.fd = -1;\n \t}\n-\tif (virtq->virtq) {\n+\tif (virtq->virtq)\n \t\tclaim_zero(mlx5_devx_cmd_destroy(virtq->virtq));\n-\t\tvirtq->virtq = NULL;\n-\t}\n \tfor (i = 0; i < RTE_DIM(virtq->umems); ++i) {\n \t\tif (virtq->umems[i].obj)\n \t\t\tclaim_zero(mlx5_glue->devx_umem_dereg\n@@ -72,27 +69,20 @@\n \t\tif (virtq->umems[i].buf)\n \t\t\trte_free(virtq->umems[i].buf);\n \t}\n-\tmemset(&virtq->umems, 0, sizeof(virtq->umems));\n \tif (virtq->eqp.fw_qp)\n \t\tmlx5_vdpa_event_qp_destroy(&virtq->eqp);\n+\tmemset(virtq, 0, sizeof(*virtq));\n+\tvirtq->intr_handle.fd = -1;\n \treturn 0;\n }\n \n void\n mlx5_vdpa_virtqs_release(struct mlx5_vdpa_priv *priv)\n {\n-\tstruct mlx5_vdpa_virtq *entry;\n-\tstruct mlx5_vdpa_virtq *next;\n+\tint i;\n \n-\tentry = SLIST_FIRST(&priv->virtq_list);\n-\twhile (entry) {\n-\t\tnext = SLIST_NEXT(entry, next);\n-\t\tmlx5_vdpa_virtq_unset(entry);\n-\t\tSLIST_REMOVE(&priv->virtq_list, entry, mlx5_vdpa_virtq, next);\n-\t\trte_free(entry);\n-\t\tentry = next;\n-\t}\n-\tSLIST_INIT(&priv->virtq_list);\n+\tfor (i = 0; i < priv->nr_virtqs; i++)\n+\t\tmlx5_vdpa_virtq_unset(&priv->virtqs[i]);\n \tif (priv->tis) {\n \t\tclaim_zero(mlx5_devx_cmd_destroy(priv->tis));\n \t\tpriv->tis = NULL;\n@@ -106,6 +96,7 @@\n \t\tpriv->virtq_db_addr = NULL;\n \t}\n \tpriv->features = 0;\n+\tpriv->nr_virtqs = 0;\n }\n \n int\n@@ -140,9 +131,9 @@\n }\n \n static int\n-mlx5_vdpa_virtq_setup(struct mlx5_vdpa_priv *priv,\n-\t\t      struct mlx5_vdpa_virtq *virtq, int index)\n+mlx5_vdpa_virtq_setup(struct mlx5_vdpa_priv *priv, int index)\n {\n+\tstruct mlx5_vdpa_virtq *virtq = &priv->virtqs[index];\n \tstruct rte_vhost_vring vq;\n \tstruct mlx5_devx_virtq_attr attr = {0};\n \tuint64_t gpa;\n@@ -347,7 +338,6 @@\n mlx5_vdpa_virtqs_prepare(struct mlx5_vdpa_priv *priv)\n {\n \tstruct mlx5_devx_tis_attr tis_attr = {0};\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@@ -356,6 +346,12 @@\n \t\tDRV_LOG(ERR, \"Failed to configure negotiated features.\");\n \t\treturn -1;\n \t}\n+\tif (nr_vring > priv->caps.max_num_virtio_queues * 2) {\n+\t\tDRV_LOG(ERR, \"Do not support more than %d virtqs(%d).\",\n+\t\t\t(int)priv->caps.max_num_virtio_queues * 2,\n+\t\t\t(int)nr_vring);\n+\t\treturn -1;\n+\t}\n \t/* Always map the entire page. */\n \tpriv->virtq_db_addr = mmap(NULL, priv->var->length, PROT_READ |\n \t\t\t\t   PROT_WRITE, MAP_SHARED, priv->ctx->cmd_fd,\n@@ -379,16 +375,10 @@\n \t\tDRV_LOG(ERR, \"Failed to create TIS.\");\n \t\tgoto error;\n \t}\n-\tfor (i = 0; i < nr_vring; i++) {\n-\t\tvirtq = rte_zmalloc(__func__, sizeof(*virtq), 0);\n-\t\tif (!virtq || mlx5_vdpa_virtq_setup(priv, virtq, i)) {\n-\t\t\tif (virtq)\n-\t\t\t\trte_free(virtq);\n-\t\t\tgoto error;\n-\t\t}\n-\t\tSLIST_INSERT_HEAD(&priv->virtq_list, virtq, next);\n-\t}\n \tpriv->nr_virtqs = nr_vring;\n+\tfor (i = 0; i < nr_vring; i++)\n+\t\tif (mlx5_vdpa_virtq_setup(priv, i))\n+\t\t\tgoto error;\n \treturn 0;\n error:\n \tmlx5_vdpa_virtqs_release(priv);\n",
    "prefixes": [
        "1/3"
    ]
}