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

Function drain_vhost

dpdk/examples/vhost/main.c:1064–1088  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1062}
1063
1064static __rte_always_inline void
1065drain_vhost(struct vhost_dev *vdev)
1066{
1067 uint16_t ret;
1068 uint32_t buff_idx = rte_lcore_id() * RTE_MAX_VHOST_DEVICE + vdev->vid;
1069 uint16_t nr_xmit = vhost_txbuff[buff_idx]->len;
1070 struct rte_mbuf **m = vhost_txbuff[buff_idx]->m_table;
1071
1072 ret = vdev_queue_ops[vdev->vid].enqueue_pkt_burst(vdev, VIRTIO_RXQ, m, nr_xmit);
1073
1074 if (enable_stats) {
1075 __atomic_fetch_add(&vdev->stats.rx_total_atomic, nr_xmit,
1076 __ATOMIC_SEQ_CST);
1077 __atomic_fetch_add(&vdev->stats.rx_atomic, ret,
1078 __ATOMIC_SEQ_CST);
1079 }
1080
1081 if (!dma_bind[vid2socketid[vdev->vid]].dmas[VIRTIO_RXQ].async_enabled) {
1082 free_pkts(m, nr_xmit);
1083 } else {
1084 uint16_t enqueue_fail = nr_xmit - ret;
1085 if (enqueue_fail > 0)
1086 free_pkts(&m[ret], enqueue_fail);
1087 }
1088}
1089
1090static __rte_always_inline void
1091drain_vhost_table(void)

Callers 2

drain_vhost_tableFunction · 0.85
virtio_tx_localFunction · 0.85

Calls 2

rte_lcore_idFunction · 0.85
free_pktsFunction · 0.70

Tested by

no test coverage detected