<html>
    <head>
      <base href="https://bugs.dpdk.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8" class="bz_new_table">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_UNCONFIRMED "
   title="UNCONFIRMED - virtio: reader/writer lock mismatch"
   href="https://bugs.dpdk.org/show_bug.cgi?id=1582">1582</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>virtio: reader/writer lock mismatch
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>DPDK
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>24.11
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>UNCONFIRMED
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>major
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>Normal
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>ethdev
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>dev@dpdk.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>stephen@networkplumber.org
          </td>
        </tr>

        <tr>
          <th>Target Milestone</th>
          <td>---
          </td>
        </tr></table>
      <p>
        <div class="bz_comment_block">
          <pre class="bz_comment_text">The code virtio_dev_rx_async_submit has mismatch between locking the
access_lock for write, and then releases it with read_unlock.  This could cause
all sorts of deadlock depending on the implementation of rwlock.

static __rte_always_inline uint32_t
virtio_dev_rx_async_submit(struct virtio_net *dev, struct vhost_virtqueue *vq,
        struct rte_mbuf **pkts, uint32_t count, int16_t dma_id, uint16_t
vchan_id)
{
        uint32_t nb_tx = 0;

        VHOST_DATA_LOG(dev->ifname, DEBUG, "%s", __func__);

        if (unlikely(!dma_copy_track[dma_id].vchans ||
                               
!dma_copy_track[dma_id].vchans[vchan_id].pkts_cmpl_flag_addr)) {
                VHOST_DATA_LOG(dev->ifname, ERR,
                        "%s: invalid channel %d:%u.",
                         __func__, dma_id, vchan_id);
                return 0;
        }

        rte_rwlock_write_lock(&vq->access_lock);

        if (unlikely(!vq->enabled || !vq->async))
                goto out_access_unlock;

        vhost_user_iotlb_rd_lock(vq);

        if (unlikely(!vq->access_ok)) {
                vhost_user_iotlb_rd_unlock(vq);
                rte_rwlock_read_unlock(&vq->access_lock);  <<<<<<<< HERE

                virtio_dev_vring_translate(dev, vq);
                goto out_no_unlock;
        }
          </pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
      <div itemscope itemtype="http://schema.org/EmailMessage">
        <div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
          
          <link itemprop="url" href="https://bugs.dpdk.org/show_bug.cgi?id=1582">
          <meta itemprop="name" content="View bug">
        </div>
        <meta itemprop="description" content="Bugzilla bug update notification">
      </div>
    </body>
</html>