get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 123220,
    "url": "http://patchwork.dpdk.org/api/patches/123220/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20230207104532.2370869-8-david.marchand@redhat.com/",
    "project": {
        "id": 1,
        "url": "http://patchwork.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": "<20230207104532.2370869-8-david.marchand@redhat.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230207104532.2370869-8-david.marchand@redhat.com",
    "date": "2023-02-07T10:45:30",
    "name": "[v6,7/9] vhost: annotate IOTLB lock",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "e59b7b1a069a8d27efdb1b8e06090fb35e8f2b91",
    "submitter": {
        "id": 1173,
        "url": "http://patchwork.dpdk.org/api/people/1173/?format=api",
        "name": "David Marchand",
        "email": "david.marchand@redhat.com"
    },
    "delegate": {
        "id": 1,
        "url": "http://patchwork.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20230207104532.2370869-8-david.marchand@redhat.com/mbox/",
    "series": [
        {
            "id": 26843,
            "url": "http://patchwork.dpdk.org/api/series/26843/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=26843",
            "date": "2023-02-07T10:45:23",
            "name": "Lock annotations",
            "version": 6,
            "mbox": "http://patchwork.dpdk.org/series/26843/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/123220/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/123220/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 mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id E536141C2D;\n\tTue,  7 Feb 2023 11:46:37 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 547B342D53;\n\tTue,  7 Feb 2023 11:46:16 +0100 (CET)",
            "from us-smtp-delivery-124.mimecast.com\n (us-smtp-delivery-124.mimecast.com [170.10.133.124])\n by mails.dpdk.org (Postfix) with ESMTP id 14AAE42D53\n for <dev@dpdk.org>; Tue,  7 Feb 2023 11:46:14 +0100 (CET)",
            "from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com\n [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS\n (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id\n us-mta-606-quKTJ2voMZi3BL0nuiyr5A-1; Tue, 07 Feb 2023 05:46:08 -0500",
            "from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com\n [10.11.54.10])\n (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n (No client certificate requested)\n by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6661A101A521;\n Tue,  7 Feb 2023 10:46:08 +0000 (UTC)",
            "from dmarchan.redhat.com (ovpn-195-46.brq.redhat.com [10.40.195.46])\n by smtp.corp.redhat.com (Postfix) with ESMTP id 50279492B22;\n Tue,  7 Feb 2023 10:46:06 +0000 (UTC)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1675766774;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:cc:mime-version:mime-version:content-type:content-type:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=GAR1EbyfPZfteXTs+lXEbIhqMebYNFWP+Jl3RzKsDms=;\n b=Yr8VuhgV2HBStCzo7Q/JwCFqyDa90VOkAiU305ocIV5msNhGy/c3TsmPqO+hMpoYO8AT88\n mC80FabRyvU7k/X69LlcVlLU5c4mgZCvuK7UcGhcCwuhoG20mwLlYqBFketkxvIQgpkgou\n 3eSrzkMd9DPQhJrOxvRZoPeBWJczRZ4=",
        "X-MC-Unique": "quKTJ2voMZi3BL0nuiyr5A-1",
        "From": "David Marchand <david.marchand@redhat.com>",
        "To": "dev@dpdk.org",
        "Cc": "maxime.coquelin@redhat.com, stephen@networkplumber.org,\n chenbo.xia@intel.com, jiayu.hu@intel.com, yuanx.wang@intel.com,\n xuan.ding@intel.com, mb@smartsharesystems.com",
        "Subject": "[PATCH v6 7/9] vhost: annotate IOTLB lock",
        "Date": "Tue,  7 Feb 2023 11:45:30 +0100",
        "Message-Id": "<20230207104532.2370869-8-david.marchand@redhat.com>",
        "In-Reply-To": "<20230207104532.2370869-1-david.marchand@redhat.com>",
        "References": "<20220328121758.26632-1-david.marchand@redhat.com>\n <20230207104532.2370869-1-david.marchand@redhat.com>",
        "MIME-Version": "1.0",
        "X-Scanned-By": "MIMEDefang 3.1 on 10.11.54.10",
        "X-Mimecast-Spam-Score": "0",
        "X-Mimecast-Originator": "redhat.com",
        "Content-Type": "text/plain; charset=UTF-8",
        "Content-Transfer-Encoding": "8bit",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "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"
    },
    "content": "The starting point for this is __vhost_iova_to_vva() which requires the\nlock to be taken. Annotate all the code leading to a call to it.\n\nvdpa and vhost_crypto code are annotated but they end up not taking\na IOTLB lock and have been marked with a FIXME at the top level.\n\nSigned-off-by: David Marchand <david.marchand@redhat.com>\nAcked-by: Morten Brørup <mb@smartsharesystems.com>\nReviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>\n---\nChanges since v5:\n- rebased after packed support was added to async code,\n\nChanges since RFC v3:\n- rebased,\n- moved unconditionnal lock acquire in separate patch,\n- fixed annotations,\n\n---\n lib/vhost/iotlb.h        |  4 ++++\n lib/vhost/vdpa.c         |  1 +\n lib/vhost/vhost.c        |  8 +++-----\n lib/vhost/vhost.h        | 22 ++++++++++++++------\n lib/vhost/vhost_crypto.c |  8 ++++++++\n lib/vhost/virtio_net.c   | 43 ++++++++++++++++++++++++++++++++++++++++\n 6 files changed, 75 insertions(+), 11 deletions(-)",
    "diff": "diff --git a/lib/vhost/iotlb.h b/lib/vhost/iotlb.h\nindex e27ebebcf5..be079a8aa7 100644\n--- a/lib/vhost/iotlb.h\n+++ b/lib/vhost/iotlb.h\n@@ -11,24 +11,28 @@\n \n static __rte_always_inline void\n vhost_user_iotlb_rd_lock(struct vhost_virtqueue *vq)\n+\t__rte_shared_lock_function(&vq->iotlb_lock)\n {\n \trte_rwlock_read_lock(&vq->iotlb_lock);\n }\n \n static __rte_always_inline void\n vhost_user_iotlb_rd_unlock(struct vhost_virtqueue *vq)\n+\t__rte_unlock_function(&vq->iotlb_lock)\n {\n \trte_rwlock_read_unlock(&vq->iotlb_lock);\n }\n \n static __rte_always_inline void\n vhost_user_iotlb_wr_lock(struct vhost_virtqueue *vq)\n+\t__rte_exclusive_lock_function(&vq->iotlb_lock)\n {\n \trte_rwlock_write_lock(&vq->iotlb_lock);\n }\n \n static __rte_always_inline void\n vhost_user_iotlb_wr_unlock(struct vhost_virtqueue *vq)\n+\t__rte_unlock_function(&vq->iotlb_lock)\n {\n \trte_rwlock_write_unlock(&vq->iotlb_lock);\n }\ndiff --git a/lib/vhost/vdpa.c b/lib/vhost/vdpa.c\nindex 577cb00a43..a430a66970 100644\n--- a/lib/vhost/vdpa.c\n+++ b/lib/vhost/vdpa.c\n@@ -146,6 +146,7 @@ rte_vdpa_unregister_device(struct rte_vdpa_device *dev)\n \n int\n rte_vdpa_relay_vring_used(int vid, uint16_t qid, void *vring_m)\n+\t__rte_no_thread_safety_analysis /* FIXME: requires iotlb_lock? */\n {\n \tstruct virtio_net *dev = get_device(vid);\n \tuint16_t idx, idx_m, desc_id;\ndiff --git a/lib/vhost/vhost.c b/lib/vhost/vhost.c\nindex 1e0c30791e..c36dc06a0a 100644\n--- a/lib/vhost/vhost.c\n+++ b/lib/vhost/vhost.c\n@@ -52,7 +52,6 @@ static const struct vhost_vq_stats_name_off vhost_vq_stat_strings[] = {\n \n #define VHOST_NB_VQ_STATS RTE_DIM(vhost_vq_stat_strings)\n \n-/* Called with iotlb_lock read-locked */\n uint64_t\n __vhost_iova_to_vva(struct virtio_net *dev, struct vhost_virtqueue *vq,\n \t\t    uint64_t iova, uint64_t *size, uint8_t perm)\n@@ -419,6 +418,7 @@ free_device(struct virtio_net *dev)\n \n static __rte_always_inline int\n log_translate(struct virtio_net *dev, struct vhost_virtqueue *vq)\n+\t__rte_shared_locks_required(&vq->iotlb_lock)\n {\n \tif (likely(!(vq->ring_addrs.flags & (1 << VHOST_VRING_F_LOG))))\n \t\treturn 0;\n@@ -435,8 +435,6 @@ log_translate(struct virtio_net *dev, struct vhost_virtqueue *vq)\n  * Converts vring log address to GPA\n  * If IOMMU is enabled, the log address is IOVA\n  * If IOMMU not enabled, the log address is already GPA\n- *\n- * Caller should have iotlb_lock read-locked\n  */\n uint64_t\n translate_log_addr(struct virtio_net *dev, struct vhost_virtqueue *vq,\n@@ -467,9 +465,9 @@ translate_log_addr(struct virtio_net *dev, struct vhost_virtqueue *vq,\n \t\treturn log_addr;\n }\n \n-/* Caller should have iotlb_lock read-locked */\n static int\n vring_translate_split(struct virtio_net *dev, struct vhost_virtqueue *vq)\n+\t__rte_shared_locks_required(&vq->iotlb_lock)\n {\n \tuint64_t req_size, size;\n \n@@ -506,9 +504,9 @@ vring_translate_split(struct virtio_net *dev, struct vhost_virtqueue *vq)\n \treturn 0;\n }\n \n-/* Caller should have iotlb_lock read-locked */\n static int\n vring_translate_packed(struct virtio_net *dev, struct vhost_virtqueue *vq)\n+\t__rte_shared_locks_required(&vq->iotlb_lock)\n {\n \tuint64_t req_size, size;\n \ndiff --git a/lib/vhost/vhost.h b/lib/vhost/vhost.h\nindex c05313cf37..5750f0c005 100644\n--- a/lib/vhost/vhost.h\n+++ b/lib/vhost/vhost.h\n@@ -563,12 +563,15 @@ void __vhost_log_cache_write(struct virtio_net *dev,\n \t\tuint64_t addr, uint64_t len);\n void __vhost_log_cache_write_iova(struct virtio_net *dev,\n \t\tstruct vhost_virtqueue *vq,\n-\t\tuint64_t iova, uint64_t len);\n+\t\tuint64_t iova, uint64_t len)\n+\t__rte_shared_locks_required(&vq->iotlb_lock);\n void __vhost_log_cache_sync(struct virtio_net *dev,\n \t\tstruct vhost_virtqueue *vq);\n+\n void __vhost_log_write(struct virtio_net *dev, uint64_t addr, uint64_t len);\n void __vhost_log_write_iova(struct virtio_net *dev, struct vhost_virtqueue *vq,\n-\t\t\t    uint64_t iova, uint64_t len);\n+\t\t\t    uint64_t iova, uint64_t len)\n+\t__rte_shared_locks_required(&vq->iotlb_lock);\n \n static __rte_always_inline void\n vhost_log_write(struct virtio_net *dev, uint64_t addr, uint64_t len)\n@@ -618,6 +621,7 @@ vhost_log_used_vring(struct virtio_net *dev, struct vhost_virtqueue *vq,\n static __rte_always_inline void\n vhost_log_cache_write_iova(struct virtio_net *dev, struct vhost_virtqueue *vq,\n \t\t\t   uint64_t iova, uint64_t len)\n+\t__rte_shared_locks_required(&vq->iotlb_lock)\n {\n \tif (likely(!(dev->features & (1ULL << VHOST_F_LOG_ALL))))\n \t\treturn;\n@@ -631,6 +635,7 @@ vhost_log_cache_write_iova(struct virtio_net *dev, struct vhost_virtqueue *vq,\n static __rte_always_inline void\n vhost_log_write_iova(struct virtio_net *dev, struct vhost_virtqueue *vq,\n \t\t\t   uint64_t iova, uint64_t len)\n+\t__rte_shared_locks_required(&vq->iotlb_lock)\n {\n \tif (likely(!(dev->features & (1ULL << VHOST_F_LOG_ALL))))\n \t\treturn;\n@@ -834,18 +839,23 @@ struct rte_vhost_device_ops const *vhost_driver_callback_get(const char *path);\n void vhost_backend_cleanup(struct virtio_net *dev);\n \n uint64_t __vhost_iova_to_vva(struct virtio_net *dev, struct vhost_virtqueue *vq,\n-\t\t\tuint64_t iova, uint64_t *len, uint8_t perm);\n+\t\t\tuint64_t iova, uint64_t *len, uint8_t perm)\n+\t__rte_shared_locks_required(&vq->iotlb_lock);\n void *vhost_alloc_copy_ind_table(struct virtio_net *dev,\n \t\t\tstruct vhost_virtqueue *vq,\n-\t\t\tuint64_t desc_addr, uint64_t desc_len);\n-int vring_translate(struct virtio_net *dev, struct vhost_virtqueue *vq);\n+\t\t\tuint64_t desc_addr, uint64_t desc_len)\n+\t__rte_shared_locks_required(&vq->iotlb_lock);\n+int vring_translate(struct virtio_net *dev, struct vhost_virtqueue *vq)\n+\t__rte_shared_locks_required(&vq->iotlb_lock);\n uint64_t translate_log_addr(struct virtio_net *dev, struct vhost_virtqueue *vq,\n-\t\tuint64_t log_addr);\n+\t\tuint64_t log_addr)\n+\t__rte_shared_locks_required(&vq->iotlb_lock);\n void vring_invalidate(struct virtio_net *dev, struct vhost_virtqueue *vq);\n \n static __rte_always_inline uint64_t\n vhost_iova_to_vva(struct virtio_net *dev, struct vhost_virtqueue *vq,\n \t\t\tuint64_t iova, uint64_t *len, uint8_t perm)\n+\t__rte_shared_locks_required(&vq->iotlb_lock)\n {\n \tif (!(dev->features & (1ULL << VIRTIO_F_IOMMU_PLATFORM)))\n \t\treturn rte_vhost_va_from_guest_pa(dev->mem, iova, len);\ndiff --git a/lib/vhost/vhost_crypto.c b/lib/vhost/vhost_crypto.c\nindex b448b6685d..f02bf865c3 100644\n--- a/lib/vhost/vhost_crypto.c\n+++ b/lib/vhost/vhost_crypto.c\n@@ -490,6 +490,7 @@ static __rte_always_inline struct virtio_crypto_inhdr *\n reach_inhdr(struct vhost_crypto_data_req *vc_req,\n \t\tstruct vhost_crypto_desc *head,\n \t\tuint32_t max_n_descs)\n+\t__rte_shared_locks_required(&vc_req->vq->iotlb_lock)\n {\n \tstruct virtio_crypto_inhdr *inhdr;\n \tstruct vhost_crypto_desc *last = head + (max_n_descs - 1);\n@@ -536,6 +537,7 @@ static __rte_always_inline void *\n get_data_ptr(struct vhost_crypto_data_req *vc_req,\n \t\tstruct vhost_crypto_desc *cur_desc,\n \t\tuint8_t perm)\n+\t__rte_shared_locks_required(&vc_req->vq->iotlb_lock)\n {\n \tvoid *data;\n \tuint64_t dlen = cur_desc->len;\n@@ -552,6 +554,7 @@ get_data_ptr(struct vhost_crypto_data_req *vc_req,\n static __rte_always_inline uint32_t\n copy_data_from_desc(void *dst, struct vhost_crypto_data_req *vc_req,\n \tstruct vhost_crypto_desc *desc, uint32_t size)\n+\t__rte_shared_locks_required(&vc_req->vq->iotlb_lock)\n {\n \tuint64_t remain;\n \tuint64_t addr;\n@@ -582,6 +585,7 @@ static __rte_always_inline int\n copy_data(void *data, struct vhost_crypto_data_req *vc_req,\n \tstruct vhost_crypto_desc *head, struct vhost_crypto_desc **cur_desc,\n \tuint32_t size, uint32_t max_n_descs)\n+\t__rte_shared_locks_required(&vc_req->vq->iotlb_lock)\n {\n \tstruct vhost_crypto_desc *desc = *cur_desc;\n \tuint32_t left = size;\n@@ -665,6 +669,7 @@ prepare_write_back_data(struct vhost_crypto_data_req *vc_req,\n \t\tuint32_t offset,\n \t\tuint64_t write_back_len,\n \t\tuint32_t max_n_descs)\n+\t__rte_shared_locks_required(&vc_req->vq->iotlb_lock)\n {\n \tstruct vhost_crypto_writeback_data *wb_data, *head;\n \tstruct vhost_crypto_desc *desc = *cur_desc;\n@@ -785,6 +790,7 @@ prepare_sym_cipher_op(struct vhost_crypto *vcrypto, struct rte_crypto_op *op,\n \t\tstruct virtio_crypto_cipher_data_req *cipher,\n \t\tstruct vhost_crypto_desc *head,\n \t\tuint32_t max_n_descs)\n+\t__rte_shared_locks_required(&vc_req->vq->iotlb_lock)\n {\n \tstruct vhost_crypto_desc *desc = head;\n \tstruct vhost_crypto_writeback_data *ewb = NULL;\n@@ -938,6 +944,7 @@ prepare_sym_chain_op(struct vhost_crypto *vcrypto, struct rte_crypto_op *op,\n \t\tstruct virtio_crypto_alg_chain_data_req *chain,\n \t\tstruct vhost_crypto_desc *head,\n \t\tuint32_t max_n_descs)\n+\t__rte_shared_locks_required(&vc_req->vq->iotlb_lock)\n {\n \tstruct vhost_crypto_desc *desc = head, *digest_desc;\n \tstruct vhost_crypto_writeback_data *ewb = NULL, *ewb2 = NULL;\n@@ -1123,6 +1130,7 @@ vhost_crypto_process_one_req(struct vhost_crypto *vcrypto,\n \t\tstruct vhost_virtqueue *vq, struct rte_crypto_op *op,\n \t\tstruct vring_desc *head, struct vhost_crypto_desc *descs,\n \t\tuint16_t desc_idx)\n+\t__rte_no_thread_safety_analysis /* FIXME: requires iotlb_lock? */\n {\n \tstruct vhost_crypto_data_req *vc_req = rte_mbuf_to_priv(op->sym->m_src);\n \tstruct rte_cryptodev_sym_session *session;\ndiff --git a/lib/vhost/virtio_net.c b/lib/vhost/virtio_net.c\nindex 49fc46e127..51dc3c96d3 100644\n--- a/lib/vhost/virtio_net.c\n+++ b/lib/vhost/virtio_net.c\n@@ -233,6 +233,7 @@ vhost_async_dma_check_completed(struct virtio_net *dev, int16_t dma_id, uint16_t\n \n static inline void\n do_data_copy_enqueue(struct virtio_net *dev, struct vhost_virtqueue *vq)\n+\t__rte_shared_locks_required(&vq->iotlb_lock)\n {\n \tstruct batch_copy_elem *elem = vq->batch_copy_elems;\n \tuint16_t count = vq->batch_copy_nb_elems;\n@@ -637,6 +638,7 @@ vhost_shadow_enqueue_single_packed(struct virtio_net *dev,\n \t\t\t\t   uint16_t *id,\n \t\t\t\t   uint16_t *count,\n \t\t\t\t   uint16_t num_buffers)\n+\t__rte_shared_locks_required(&vq->iotlb_lock)\n {\n \tvhost_shadow_enqueue_packed(vq, len, id, count, num_buffers);\n \n@@ -728,6 +730,7 @@ static __rte_always_inline int\n map_one_desc(struct virtio_net *dev, struct vhost_virtqueue *vq,\n \t\tstruct buf_vector *buf_vec, uint16_t *vec_idx,\n \t\tuint64_t desc_iova, uint64_t desc_len, uint8_t perm)\n+\t__rte_shared_locks_required(&vq->iotlb_lock)\n {\n \tuint16_t vec_id = *vec_idx;\n \n@@ -765,6 +768,7 @@ fill_vec_buf_split(struct virtio_net *dev, struct vhost_virtqueue *vq,\n \t\t\t uint32_t avail_idx, uint16_t *vec_idx,\n \t\t\t struct buf_vector *buf_vec, uint16_t *desc_chain_head,\n \t\t\t uint32_t *desc_chain_len, uint8_t perm)\n+\t__rte_shared_locks_required(&vq->iotlb_lock)\n {\n \tuint16_t idx = vq->avail->ring[avail_idx & (vq->size - 1)];\n \tuint16_t vec_id = *vec_idx;\n@@ -848,6 +852,7 @@ reserve_avail_buf_split(struct virtio_net *dev, struct vhost_virtqueue *vq,\n \t\t\t\tuint64_t size, struct buf_vector *buf_vec,\n \t\t\t\tuint16_t *num_buffers, uint16_t avail_head,\n \t\t\t\tuint16_t *nr_vec)\n+\t__rte_shared_locks_required(&vq->iotlb_lock)\n {\n \tuint16_t cur_idx;\n \tuint16_t vec_idx = 0;\n@@ -898,6 +903,7 @@ fill_vec_buf_packed_indirect(struct virtio_net *dev,\n \t\t\tstruct vhost_virtqueue *vq,\n \t\t\tstruct vring_packed_desc *desc, uint16_t *vec_idx,\n \t\t\tstruct buf_vector *buf_vec, uint32_t *len, uint8_t perm)\n+\t__rte_shared_locks_required(&vq->iotlb_lock)\n {\n \tuint16_t i;\n \tuint32_t nr_descs;\n@@ -956,6 +962,7 @@ fill_vec_buf_packed(struct virtio_net *dev, struct vhost_virtqueue *vq,\n \t\t\t\tuint16_t avail_idx, uint16_t *desc_count,\n \t\t\t\tstruct buf_vector *buf_vec, uint16_t *vec_idx,\n \t\t\t\tuint16_t *buf_id, uint32_t *len, uint8_t perm)\n+\t__rte_shared_locks_required(&vq->iotlb_lock)\n {\n \tbool wrap_counter = vq->avail_wrap_counter;\n \tstruct vring_packed_desc *descs = vq->desc_packed;\n@@ -1021,6 +1028,7 @@ static __rte_noinline void\n copy_vnet_hdr_to_desc(struct virtio_net *dev, struct vhost_virtqueue *vq,\n \t\tstruct buf_vector *buf_vec,\n \t\tstruct virtio_net_hdr_mrg_rxbuf *hdr)\n+\t__rte_shared_locks_required(&vq->iotlb_lock)\n {\n \tuint64_t len;\n \tuint64_t remain = dev->vhost_hlen;\n@@ -1124,6 +1132,7 @@ async_fill_seg(struct virtio_net *dev, struct vhost_virtqueue *vq,\n \t\tstruct rte_mbuf *m, uint32_t mbuf_offset,\n \t\tuint64_t buf_iova, uint32_t cpy_len, bool to_desc)\n \t__rte_exclusive_locks_required(&vq->access_lock)\n+\t__rte_shared_locks_required(&vq->iotlb_lock)\n {\n \tstruct vhost_async *async = vq->async;\n \tuint64_t mapped_len;\n@@ -1164,6 +1173,7 @@ static __rte_always_inline void\n sync_fill_seg(struct virtio_net *dev, struct vhost_virtqueue *vq,\n \t\tstruct rte_mbuf *m, uint32_t mbuf_offset,\n \t\tuint64_t buf_addr, uint64_t buf_iova, uint32_t cpy_len, bool to_desc)\n+\t__rte_shared_locks_required(&vq->iotlb_lock)\n {\n \tstruct batch_copy_elem *batch_copy = vq->batch_copy_elems;\n \n@@ -1202,6 +1212,7 @@ mbuf_to_desc(struct virtio_net *dev, struct vhost_virtqueue *vq,\n \t\tstruct rte_mbuf *m, struct buf_vector *buf_vec,\n \t\tuint16_t nr_vec, uint16_t num_buffers, bool is_async)\n \t__rte_exclusive_locks_required(&vq->access_lock)\n+\t__rte_shared_locks_required(&vq->iotlb_lock)\n {\n \tuint32_t vec_idx = 0;\n \tuint32_t mbuf_offset, mbuf_avail;\n@@ -1331,6 +1342,7 @@ vhost_enqueue_single_packed(struct virtio_net *dev,\n \t\t\t    struct buf_vector *buf_vec,\n \t\t\t    uint16_t *nr_descs)\n \t__rte_exclusive_locks_required(&vq->access_lock)\n+\t__rte_shared_locks_required(&vq->iotlb_lock)\n {\n \tuint16_t nr_vec = 0;\n \tuint16_t avail_idx = vq->last_avail_idx;\n@@ -1392,6 +1404,7 @@ static __rte_noinline uint32_t\n virtio_dev_rx_split(struct virtio_net *dev, struct vhost_virtqueue *vq,\n \tstruct rte_mbuf **pkts, uint32_t count)\n \t__rte_exclusive_locks_required(&vq->access_lock)\n+\t__rte_shared_locks_required(&vq->iotlb_lock)\n {\n \tuint32_t pkt_idx = 0;\n \tuint16_t num_buffers;\n@@ -1448,6 +1461,7 @@ virtio_dev_rx_sync_batch_check(struct virtio_net *dev,\n \t\t\t   struct rte_mbuf **pkts,\n \t\t\t   uint64_t *desc_addrs,\n \t\t\t   uint64_t *lens)\n+\t__rte_shared_locks_required(&vq->iotlb_lock)\n {\n \tbool wrap_counter = vq->avail_wrap_counter;\n \tstruct vring_packed_desc *descs = vq->desc_packed;\n@@ -1551,6 +1565,7 @@ virtio_dev_rx_batch_packed_copy(struct virtio_net *dev,\n \t\t\t   struct rte_mbuf **pkts,\n \t\t\t   uint64_t *desc_addrs,\n \t\t\t   uint64_t *lens)\n+\t__rte_shared_locks_required(&vq->iotlb_lock)\n {\n \tuint32_t buf_offset = sizeof(struct virtio_net_hdr_mrg_rxbuf);\n \tstruct virtio_net_hdr_mrg_rxbuf *hdrs[PACKED_BATCH_SIZE];\n@@ -1598,6 +1613,7 @@ static __rte_always_inline int\n virtio_dev_rx_sync_batch_packed(struct virtio_net *dev,\n \t\t\t   struct vhost_virtqueue *vq,\n \t\t\t   struct rte_mbuf **pkts)\n+\t__rte_shared_locks_required(&vq->iotlb_lock)\n {\n \tuint64_t desc_addrs[PACKED_BATCH_SIZE];\n \tuint64_t lens[PACKED_BATCH_SIZE];\n@@ -1620,6 +1636,7 @@ virtio_dev_rx_single_packed(struct virtio_net *dev,\n \t\t\t    struct vhost_virtqueue *vq,\n \t\t\t    struct rte_mbuf *pkt)\n \t__rte_exclusive_locks_required(&vq->access_lock)\n+\t__rte_shared_locks_required(&vq->iotlb_lock)\n {\n \tstruct buf_vector buf_vec[BUF_VECTOR_MAX];\n \tuint16_t nr_descs = 0;\n@@ -1645,6 +1662,7 @@ virtio_dev_rx_packed(struct virtio_net *dev,\n \t\t     struct rte_mbuf **__rte_restrict pkts,\n \t\t     uint32_t count)\n \t__rte_exclusive_locks_required(&vq->access_lock)\n+\t__rte_shared_locks_required(&vq->iotlb_lock)\n {\n \tuint32_t pkt_idx = 0;\n \n@@ -1772,6 +1790,7 @@ static __rte_noinline uint32_t\n virtio_dev_rx_async_submit_split(struct virtio_net *dev, struct vhost_virtqueue *vq,\n \tstruct rte_mbuf **pkts, uint32_t count, int16_t dma_id, uint16_t vchan_id)\n \t__rte_exclusive_locks_required(&vq->access_lock)\n+\t__rte_shared_locks_required(&vq->iotlb_lock)\n {\n \tstruct buf_vector buf_vec[BUF_VECTOR_MAX];\n \tuint32_t pkt_idx = 0;\n@@ -1879,6 +1898,7 @@ vhost_enqueue_async_packed(struct virtio_net *dev,\n \t\t\t    uint16_t *nr_descs,\n \t\t\t    uint16_t *nr_buffers)\n \t__rte_exclusive_locks_required(&vq->access_lock)\n+\t__rte_shared_locks_required(&vq->iotlb_lock)\n {\n \tuint16_t nr_vec = 0;\n \tuint16_t avail_idx = vq->last_avail_idx;\n@@ -1938,6 +1958,7 @@ static __rte_always_inline int16_t\n virtio_dev_rx_async_packed(struct virtio_net *dev, struct vhost_virtqueue *vq,\n \t\t\t    struct rte_mbuf *pkt, uint16_t *nr_descs, uint16_t *nr_buffers)\n \t__rte_exclusive_locks_required(&vq->access_lock)\n+\t__rte_shared_locks_required(&vq->iotlb_lock)\n {\n \tstruct buf_vector buf_vec[BUF_VECTOR_MAX];\n \n@@ -1961,6 +1982,7 @@ virtio_dev_rx_async_packed_batch_enqueue(struct virtio_net *dev,\n \t\t\t   uint64_t *desc_addrs,\n \t\t\t   uint64_t *lens)\n \t__rte_exclusive_locks_required(&vq->access_lock)\n+\t__rte_shared_locks_required(&vq->iotlb_lock)\n {\n \tuint32_t buf_offset = sizeof(struct virtio_net_hdr_mrg_rxbuf);\n \tstruct virtio_net_hdr_mrg_rxbuf *hdrs[PACKED_BATCH_SIZE];\n@@ -2022,6 +2044,7 @@ virtio_dev_rx_async_packed_batch(struct virtio_net *dev,\n \t\t\t   struct rte_mbuf **pkts,\n \t\t\t   int16_t dma_id, uint16_t vchan_id)\n \t__rte_exclusive_locks_required(&vq->access_lock)\n+\t__rte_shared_locks_required(&vq->iotlb_lock)\n {\n \tuint64_t desc_addrs[PACKED_BATCH_SIZE];\n \tuint64_t lens[PACKED_BATCH_SIZE];\n@@ -2069,6 +2092,7 @@ static __rte_noinline uint32_t\n virtio_dev_rx_async_submit_packed(struct virtio_net *dev, struct vhost_virtqueue *vq,\n \tstruct rte_mbuf **pkts, uint32_t count, int16_t dma_id, uint16_t vchan_id)\n \t__rte_exclusive_locks_required(&vq->access_lock)\n+\t__rte_shared_locks_required(&vq->iotlb_lock)\n {\n \tuint32_t pkt_idx = 0;\n \tuint16_t n_xfer;\n@@ -2843,6 +2867,7 @@ desc_to_mbuf(struct virtio_net *dev, struct vhost_virtqueue *vq,\n \t\t  struct rte_mbuf *m, struct rte_mempool *mbuf_pool,\n \t\t  bool legacy_ol_flags, uint16_t slot_idx, bool is_async)\n \t__rte_exclusive_locks_required(&vq->access_lock)\n+\t__rte_shared_locks_required(&vq->iotlb_lock)\n {\n \tuint32_t buf_avail, buf_offset, buf_len;\n \tuint64_t buf_addr, buf_iova;\n@@ -3049,6 +3074,7 @@ virtio_dev_tx_split(struct virtio_net *dev, struct vhost_virtqueue *vq,\n \tstruct rte_mempool *mbuf_pool, struct rte_mbuf **pkts, uint16_t count,\n \tbool legacy_ol_flags)\n \t__rte_exclusive_locks_required(&vq->access_lock)\n+\t__rte_shared_locks_required(&vq->iotlb_lock)\n {\n \tuint16_t i;\n \tuint16_t avail_entries;\n@@ -3153,6 +3179,7 @@ virtio_dev_tx_split_legacy(struct virtio_net *dev,\n \tstruct vhost_virtqueue *vq, struct rte_mempool *mbuf_pool,\n \tstruct rte_mbuf **pkts, uint16_t count)\n \t__rte_exclusive_locks_required(&vq->access_lock)\n+\t__rte_shared_locks_required(&vq->iotlb_lock)\n {\n \treturn virtio_dev_tx_split(dev, vq, mbuf_pool, pkts, count, true);\n }\n@@ -3163,6 +3190,7 @@ virtio_dev_tx_split_compliant(struct virtio_net *dev,\n \tstruct vhost_virtqueue *vq, struct rte_mempool *mbuf_pool,\n \tstruct rte_mbuf **pkts, uint16_t count)\n \t__rte_exclusive_locks_required(&vq->access_lock)\n+\t__rte_shared_locks_required(&vq->iotlb_lock)\n {\n \treturn virtio_dev_tx_split(dev, vq, mbuf_pool, pkts, count, false);\n }\n@@ -3174,6 +3202,7 @@ vhost_reserve_avail_batch_packed(struct virtio_net *dev,\n \t\t\t\t uint16_t avail_idx,\n \t\t\t\t uintptr_t *desc_addrs,\n \t\t\t\t uint16_t *ids)\n+\t__rte_shared_locks_required(&vq->iotlb_lock)\n {\n \tbool wrap = vq->avail_wrap_counter;\n \tstruct vring_packed_desc *descs = vq->desc_packed;\n@@ -3317,6 +3346,7 @@ virtio_dev_tx_batch_packed(struct virtio_net *dev,\n \t\t\t   struct vhost_virtqueue *vq,\n \t\t\t   struct rte_mbuf **pkts,\n \t\t\t   bool legacy_ol_flags)\n+\t__rte_shared_locks_required(&vq->iotlb_lock)\n {\n \tuint16_t avail_idx = vq->last_avail_idx;\n \tuint32_t buf_offset = sizeof(struct virtio_net_hdr_mrg_rxbuf);\n@@ -3364,6 +3394,7 @@ vhost_dequeue_single_packed(struct virtio_net *dev,\n \t\t\t    uint16_t *desc_count,\n \t\t\t    bool legacy_ol_flags)\n \t__rte_exclusive_locks_required(&vq->access_lock)\n+\t__rte_shared_locks_required(&vq->iotlb_lock)\n {\n \tstruct buf_vector buf_vec[BUF_VECTOR_MAX];\n \tuint32_t buf_len;\n@@ -3413,6 +3444,7 @@ virtio_dev_tx_single_packed(struct virtio_net *dev,\n \t\t\t    struct rte_mbuf *pkts,\n \t\t\t    bool legacy_ol_flags)\n \t__rte_exclusive_locks_required(&vq->access_lock)\n+\t__rte_shared_locks_required(&vq->iotlb_lock)\n {\n \n \tuint16_t buf_id, desc_count = 0;\n@@ -3444,6 +3476,7 @@ virtio_dev_tx_packed(struct virtio_net *dev,\n \t\t     uint32_t count,\n \t\t     bool legacy_ol_flags)\n \t__rte_exclusive_locks_required(&vq->access_lock)\n+\t__rte_shared_locks_required(&vq->iotlb_lock)\n {\n \tuint32_t pkt_idx = 0;\n \n@@ -3488,6 +3521,7 @@ virtio_dev_tx_packed_legacy(struct virtio_net *dev,\n \tstruct vhost_virtqueue *__rte_restrict vq, struct rte_mempool *mbuf_pool,\n \tstruct rte_mbuf **__rte_restrict pkts, uint32_t count)\n \t__rte_exclusive_locks_required(&vq->access_lock)\n+\t__rte_shared_locks_required(&vq->iotlb_lock)\n {\n \treturn virtio_dev_tx_packed(dev, vq, mbuf_pool, pkts, count, true);\n }\n@@ -3498,6 +3532,7 @@ virtio_dev_tx_packed_compliant(struct virtio_net *dev,\n \tstruct vhost_virtqueue *__rte_restrict vq, struct rte_mempool *mbuf_pool,\n \tstruct rte_mbuf **__rte_restrict pkts, uint32_t count)\n \t__rte_exclusive_locks_required(&vq->access_lock)\n+\t__rte_shared_locks_required(&vq->iotlb_lock)\n {\n \treturn virtio_dev_tx_packed(dev, vq, mbuf_pool, pkts, count, false);\n }\n@@ -3661,6 +3696,7 @@ virtio_dev_tx_async_split(struct virtio_net *dev, struct vhost_virtqueue *vq,\n \t\tstruct rte_mempool *mbuf_pool, struct rte_mbuf **pkts, uint16_t count,\n \t\tint16_t dma_id, uint16_t vchan_id, bool legacy_ol_flags)\n \t__rte_exclusive_locks_required(&vq->access_lock)\n+\t__rte_shared_locks_required(&vq->iotlb_lock)\n {\n \tstatic bool allocerr_warned;\n \tbool dropped = false;\n@@ -3808,6 +3844,7 @@ virtio_dev_tx_async_split_legacy(struct virtio_net *dev,\n \t\tstruct rte_mbuf **pkts, uint16_t count,\n \t\tint16_t dma_id, uint16_t vchan_id)\n \t__rte_exclusive_locks_required(&vq->access_lock)\n+\t__rte_shared_locks_required(&vq->iotlb_lock)\n {\n \treturn virtio_dev_tx_async_split(dev, vq, mbuf_pool,\n \t\t\t\tpkts, count, dma_id, vchan_id, true);\n@@ -3820,6 +3857,7 @@ virtio_dev_tx_async_split_compliant(struct virtio_net *dev,\n \t\tstruct rte_mbuf **pkts, uint16_t count,\n \t\tint16_t dma_id, uint16_t vchan_id)\n \t__rte_exclusive_locks_required(&vq->access_lock)\n+\t__rte_shared_locks_required(&vq->iotlb_lock)\n {\n \treturn virtio_dev_tx_async_split(dev, vq, mbuf_pool,\n \t\t\t\tpkts, count, dma_id, vchan_id, false);\n@@ -3851,6 +3889,7 @@ virtio_dev_tx_async_single_packed(struct virtio_net *dev,\n \t\t\tuint16_t slot_idx,\n \t\t\tbool legacy_ol_flags)\n \t__rte_exclusive_locks_required(&vq->access_lock)\n+\t__rte_shared_locks_required(&vq->iotlb_lock)\n {\n \tint err;\n \tuint16_t buf_id, desc_count = 0;\n@@ -3903,6 +3942,7 @@ virtio_dev_tx_async_packed_batch(struct virtio_net *dev,\n \t\t\t   struct rte_mbuf **pkts, uint16_t slot_idx,\n \t\t\t   uint16_t dma_id, uint16_t vchan_id)\n \t__rte_exclusive_locks_required(&vq->access_lock)\n+\t__rte_shared_locks_required(&vq->iotlb_lock)\n {\n \tuint16_t avail_idx = vq->last_avail_idx;\n \tuint32_t buf_offset = sizeof(struct virtio_net_hdr_mrg_rxbuf);\n@@ -3960,6 +4000,7 @@ virtio_dev_tx_async_packed(struct virtio_net *dev, struct vhost_virtqueue *vq,\n \t\tstruct rte_mempool *mbuf_pool, struct rte_mbuf **pkts,\n \t\tuint16_t count, uint16_t dma_id, uint16_t vchan_id, bool legacy_ol_flags)\n \t__rte_exclusive_locks_required(&vq->access_lock)\n+\t__rte_shared_locks_required(&vq->iotlb_lock)\n {\n \tuint32_t pkt_idx = 0;\n \tuint16_t slot_idx = 0;\n@@ -4070,6 +4111,7 @@ virtio_dev_tx_async_packed_legacy(struct virtio_net *dev, struct vhost_virtqueue\n \t\tstruct rte_mempool *mbuf_pool, struct rte_mbuf **pkts,\n \t\tuint16_t count, uint16_t dma_id, uint16_t vchan_id)\n \t__rte_exclusive_locks_required(&vq->access_lock)\n+\t__rte_shared_locks_required(&vq->iotlb_lock)\n {\n \treturn virtio_dev_tx_async_packed(dev, vq, mbuf_pool,\n \t\t\t\tpkts, count, dma_id, vchan_id, true);\n@@ -4081,6 +4123,7 @@ virtio_dev_tx_async_packed_compliant(struct virtio_net *dev, struct vhost_virtqu\n \t\tstruct rte_mempool *mbuf_pool, struct rte_mbuf **pkts,\n \t\tuint16_t count, uint16_t dma_id, uint16_t vchan_id)\n \t__rte_exclusive_locks_required(&vq->access_lock)\n+\t__rte_shared_locks_required(&vq->iotlb_lock)\n {\n \treturn virtio_dev_tx_async_packed(dev, vq, mbuf_pool,\n \t\t\t\tpkts, count, dma_id, vchan_id, false);\n",
    "prefixes": [
        "v6",
        "7/9"
    ]
}