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

Function vhost_vring_call_split

dpdk/lib/vhost/vhost.h:951–978  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

949}
950
951static __rte_always_inline void
952vhost_vring_call_split(struct virtio_net *dev, struct vhost_virtqueue *vq)
953{
954 /* Flush used->idx update before we read avail->flags. */
955 rte_atomic_thread_fence(rte_memory_order_seq_cst);
956
957 /* Don't kick guest if we don't reach index specified by guest. */
958 if (dev->features & (1ULL << VIRTIO_RING_F_EVENT_IDX)) {
959 uint16_t old = vq->signalled_used;
960 uint16_t new = vq->last_used_idx;
961 bool signalled_used_valid = vq->signalled_used_valid;
962
963 vq->signalled_used = new;
964 vq->signalled_used_valid = true;
965
966 VHOST_LOG_DATA(dev->ifname, DEBUG,
967 "%s: used_event_idx=%d, old=%d, new=%d\n",
968 __func__, vhost_used_event(vq), old, new);
969
970 if (vhost_need_event(vhost_used_event(vq), new, old) ||
971 unlikely(!signalled_used_valid))
972 vhost_vring_inject_irq(dev, vq);
973 } else {
974 /* Kick the guest if necessary. */
975 if (!(vq->avail->flags & VRING_AVAIL_F_NO_INTERRUPT))
976 vhost_vring_inject_irq(dev, vq);
977 }
978}
979
980static __rte_always_inline void
981vhost_vring_call_packed(struct virtio_net *dev, struct vhost_virtqueue *vq)

Callers 7

virtio_net_ctrl_pushFunction · 0.85
rte_vhost_vring_callFunction · 0.85
virtio_dev_rx_splitFunction · 0.85
virtio_dev_tx_splitFunction · 0.85

Calls 3

vhost_need_eventFunction · 0.85
vhost_vring_inject_irqFunction · 0.85
rte_atomic_thread_fenceFunction · 0.50

Tested by

no test coverage detected