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

Function drain_mbuf_table

dpdk/examples/vhost/main.c:1338–1356  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1336
1337
1338static __rte_always_inline void
1339drain_mbuf_table(struct mbuf_table *tx_q)
1340{
1341 static uint64_t prev_tsc;
1342 uint64_t cur_tsc;
1343
1344 if (tx_q->len == 0)
1345 return;
1346
1347 cur_tsc = rte_rdtsc();
1348 if (unlikely(cur_tsc - prev_tsc > MBUF_TABLE_DRAIN_TSC)) {
1349 prev_tsc = cur_tsc;
1350
1351 RTE_LOG_DP(DEBUG, VHOST_DATA,
1352 "TX queue drained after timeout with burst size %u\n",
1353 tx_q->len);
1354 do_drain_mbuf_table(tx_q);
1355 }
1356}
1357
1358uint16_t
1359async_enqueue_pkts(struct vhost_dev *dev, uint16_t queue_id,

Callers 1

switch_workerFunction · 0.85

Calls 2

do_drain_mbuf_tableFunction · 0.85
rte_rdtscFunction · 0.50

Tested by

no test coverage detected