| 2522 | } |
| 2523 | |
| 2524 | static __rte_always_inline uint32_t |
| 2525 | virtio_dev_rx_async_submit(struct virtio_net *dev, struct vhost_virtqueue *vq, |
| 2526 | struct rte_mbuf **pkts, uint32_t count, int16_t dma_id, uint16_t vchan_id) |
| 2527 | { |
| 2528 | uint32_t nb_tx = 0; |
| 2529 | |
| 2530 | VHOST_LOG_DATA(dev->ifname, DEBUG, "%s\n", __func__); |
| 2531 | |
| 2532 | if (unlikely(!dma_copy_track[dma_id].vchans || |
| 2533 | !dma_copy_track[dma_id].vchans[vchan_id].pkts_cmpl_flag_addr)) { |
| 2534 | VHOST_LOG_DATA(dev->ifname, ERR, |
| 2535 | "%s: invalid channel %d:%u.\n", |
| 2536 | __func__, dma_id, vchan_id); |
| 2537 | return 0; |
| 2538 | } |
| 2539 | |
| 2540 | rte_rwlock_write_lock(&vq->access_lock); |
| 2541 | |
| 2542 | if (unlikely(!vq->enabled || !vq->async)) |
| 2543 | goto out_access_unlock; |
| 2544 | |
| 2545 | vhost_user_iotlb_rd_lock(vq); |
| 2546 | |
| 2547 | if (unlikely(!vq->access_ok)) { |
| 2548 | vhost_user_iotlb_rd_unlock(vq); |
| 2549 | rte_rwlock_write_unlock(&vq->access_lock); |
| 2550 | |
| 2551 | virtio_dev_vring_translate(dev, vq); |
| 2552 | goto out_no_unlock; |
| 2553 | } |
| 2554 | |
| 2555 | count = RTE_MIN((uint32_t)MAX_PKT_BURST, count); |
| 2556 | if (count == 0) |
| 2557 | goto out; |
| 2558 | |
| 2559 | if (vq_is_packed(dev)) |
| 2560 | nb_tx = virtio_dev_rx_async_submit_packed(dev, vq, pkts, count, |
| 2561 | dma_id, vchan_id); |
| 2562 | else |
| 2563 | nb_tx = virtio_dev_rx_async_submit_split(dev, vq, pkts, count, |
| 2564 | dma_id, vchan_id); |
| 2565 | |
| 2566 | vq->stats.inflight_submitted += nb_tx; |
| 2567 | |
| 2568 | out: |
| 2569 | vhost_user_iotlb_rd_unlock(vq); |
| 2570 | |
| 2571 | out_access_unlock: |
| 2572 | rte_rwlock_write_unlock(&vq->access_lock); |
| 2573 | |
| 2574 | out_no_unlock: |
| 2575 | return nb_tx; |
| 2576 | } |
| 2577 | |
| 2578 | uint16_t |
| 2579 | rte_vhost_submit_enqueue_burst(int vid, uint16_t queue_id, |
no test coverage detected