The current timestamp should be set every time the queue is flushed.
Thus, if DRAIN_TSC timer cycles have passed since the last timestamp,
the send queue should be flushed again.
Signed-off-by: Ryan Wilson <wryan@nicira.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
(txq->count - nb_tx));
}
txq->count = 0;
+ txq->tsc = rte_get_timer_cycles();
}
static inline void
{
struct dpdk_tx_queue *txq = &dev->tx_q[qid];
uint64_t diff_tsc;
- uint64_t cur_tsc;
int i = 0;
if (txq->count == MAX_TX_QUEUE_LEN) {
dpdk_queue_flush__(dev, qid);
}
- cur_tsc = rte_get_timer_cycles();
- if (txq->count == 1) {
- txq->tsc = cur_tsc;
- }
- diff_tsc = cur_tsc - txq->tsc;
+ diff_tsc = rte_get_timer_cycles() - txq->tsc;
if (diff_tsc >= DRAIN_TSC) {
dpdk_queue_flush__(dev, qid);
}