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

Function drain_vhost_table

dpdk/examples/vhost/main.c:1090–1115  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1088}
1089
1090static __rte_always_inline void
1091drain_vhost_table(void)
1092{
1093 uint16_t lcore_id = rte_lcore_id();
1094 struct vhost_bufftable *vhost_txq;
1095 struct vhost_dev *vdev;
1096 uint64_t cur_tsc;
1097
1098 TAILQ_FOREACH(vdev, &vhost_dev_list, global_vdev_entry) {
1099 if (unlikely(vdev->remove == 1))
1100 continue;
1101
1102 vhost_txq = vhost_txbuff[lcore_id * RTE_MAX_VHOST_DEVICE + vdev->vid];
1103
1104 cur_tsc = rte_rdtsc();
1105 if (unlikely(cur_tsc - vhost_txq->pre_tsc
1106 > MBUF_TABLE_DRAIN_TSC)) {
1107 RTE_LOG_DP(DEBUG, VHOST_DATA,
1108 "Vhost TX queue drained after timeout with burst size %u\n",
1109 vhost_txq->len);
1110 drain_vhost(vdev);
1111 vhost_txq->len = 0;
1112 vhost_txq->pre_tsc = cur_tsc;
1113 }
1114 }
1115}
1116
1117/*
1118 * Check if the packet destination MAC address is for a local device. If so then put

Callers 1

switch_workerFunction · 0.85

Calls 3

rte_lcore_idFunction · 0.85
drain_vhostFunction · 0.85
rte_rdtscFunction · 0.50

Tested by

no test coverage detected