| 1088 | } |
| 1089 | |
| 1090 | static __rte_always_inline void |
| 1091 | drain_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 |
no test coverage detected