MCPcopy Create free account
hub / github.com/F-Stack/f-stack / vhost_shadow_dequeue_batch_packed

Function vhost_shadow_dequeue_batch_packed

dpdk/lib/vhost/virtio_net.c:492–530  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

490}
491
492static __rte_always_inline void
493vhost_shadow_dequeue_batch_packed(struct virtio_net *dev,
494 struct vhost_virtqueue *vq,
495 uint16_t *ids)
496{
497 uint16_t flags;
498 uint16_t i;
499 uint16_t begin;
500
501 flags = PACKED_DESC_DEQUEUE_USED_FLAG(vq->used_wrap_counter);
502
503 if (!vq->shadow_used_idx) {
504 vq->shadow_last_used_idx = vq->last_used_idx;
505 vq->shadow_used_packed[0].id = ids[0];
506 vq->shadow_used_packed[0].len = 0;
507 vq->shadow_used_packed[0].count = 1;
508 vq->shadow_used_packed[0].flags = flags;
509 vq->shadow_used_idx++;
510 begin = 1;
511 } else
512 begin = 0;
513
514 vhost_for_each_try_unroll(i, begin, PACKED_BATCH_SIZE) {
515 vq->desc_packed[vq->last_used_idx + i].id = ids[i];
516 vq->desc_packed[vq->last_used_idx + i].len = 0;
517 }
518
519 rte_atomic_thread_fence(rte_memory_order_release);
520 vhost_for_each_try_unroll(i, begin, PACKED_BATCH_SIZE)
521 vq->desc_packed[vq->last_used_idx + i].flags = flags;
522
523 vhost_log_cache_used_vring(dev, vq, vq->last_used_idx *
524 sizeof(struct vring_packed_desc),
525 sizeof(struct vring_packed_desc) *
526 PACKED_BATCH_SIZE);
527 vhost_log_cache_sync(dev, vq);
528
529 vq_inc_last_used_packed(vq, PACKED_BATCH_SIZE);
530}
531
532static __rte_always_inline void
533vhost_shadow_dequeue_single_packed(struct vhost_virtqueue *vq,

Callers 1

Calls 4

vhost_log_cache_syncFunction · 0.85
vq_inc_last_used_packedFunction · 0.85
rte_atomic_thread_fenceFunction · 0.50

Tested by

no test coverage detected