mirror of
https://github.com/openvswitch/ovs
synced 2025-10-27 15:18:06 +00:00
netdev-dpdk: Set current timestamp when flushing TX queue.
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>
This commit is contained in:
committed by
Pravin B Shelar
parent
b170db2aaa
commit
844f2d749a
@@ -584,6 +584,7 @@ dpdk_queue_flush__(struct netdev_dpdk *dev, int qid)
|
|||||||
(txq->count - nb_tx));
|
(txq->count - nb_tx));
|
||||||
}
|
}
|
||||||
txq->count = 0;
|
txq->count = 0;
|
||||||
|
txq->tsc = rte_get_timer_cycles();
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
@@ -629,7 +630,6 @@ dpdk_queue_pkts(struct netdev_dpdk *dev, int qid,
|
|||||||
{
|
{
|
||||||
struct dpdk_tx_queue *txq = &dev->tx_q[qid];
|
struct dpdk_tx_queue *txq = &dev->tx_q[qid];
|
||||||
uint64_t diff_tsc;
|
uint64_t diff_tsc;
|
||||||
uint64_t cur_tsc;
|
|
||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
@@ -647,11 +647,7 @@ dpdk_queue_pkts(struct netdev_dpdk *dev, int qid,
|
|||||||
if (txq->count == MAX_TX_QUEUE_LEN) {
|
if (txq->count == MAX_TX_QUEUE_LEN) {
|
||||||
dpdk_queue_flush__(dev, qid);
|
dpdk_queue_flush__(dev, qid);
|
||||||
}
|
}
|
||||||
cur_tsc = rte_get_timer_cycles();
|
diff_tsc = rte_get_timer_cycles() - txq->tsc;
|
||||||
if (txq->count == 1) {
|
|
||||||
txq->tsc = cur_tsc;
|
|
||||||
}
|
|
||||||
diff_tsc = cur_tsc - txq->tsc;
|
|
||||||
if (diff_tsc >= DRAIN_TSC) {
|
if (diff_tsc >= DRAIN_TSC) {
|
||||||
dpdk_queue_flush__(dev, qid);
|
dpdk_queue_flush__(dev, qid);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user