From 55cd9f139e2b767d33c752e0279b5dc81dfc9b8b Mon Sep 17 00:00:00 2001 From: Yong Wang Date: Tue, 12 Jan 2016 18:08:34 -0800 Subject: [PATCH] vmxnet3: rework Tx Clean up txNumDeferred usage. Signed-off-by: Yong Wang Acked-by: Stephen Hemminger --- drivers/net/vmxnet3/vmxnet3_rxtx.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/net/vmxnet3/vmxnet3_rxtx.c b/drivers/net/vmxnet3/vmxnet3_rxtx.c index 5f207452b6..f88ced77a8 100644 --- a/drivers/net/vmxnet3/vmxnet3_rxtx.c +++ b/drivers/net/vmxnet3/vmxnet3_rxtx.c @@ -326,6 +326,8 @@ vmxnet3_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_tx; vmxnet3_tx_queue_t *txq = tx_queue; struct vmxnet3_hw *hw = txq->hw; + Vmxnet3_TxQueueCtrl *txq_ctrl = &txq->shared->ctrl; + uint32_t deferred = rte_le_to_cpu_32(txq_ctrl->txNumDeferred); if (unlikely(txq->stopped)) { PMD_TX_LOG(DEBUG, "Tx queue is stopped."); @@ -413,15 +415,14 @@ vmxnet3_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, rte_compiler_barrier(); gdesc->dword[2] ^= VMXNET3_TXD_GEN; - txq->shared->ctrl.txNumDeferred++; + txq_ctrl->txNumDeferred = rte_cpu_to_le_32(++deferred); nb_tx++; } - PMD_TX_LOG(DEBUG, "vmxnet3 txThreshold: %u", txq->shared->ctrl.txThreshold); + PMD_TX_LOG(DEBUG, "vmxnet3 txThreshold: %u", rte_le_to_cpu_32(txq_ctrl->txThreshold)); - if (txq->shared->ctrl.txNumDeferred >= txq->shared->ctrl.txThreshold) { - - txq->shared->ctrl.txNumDeferred = 0; + if (deferred >= rte_le_to_cpu_32(txq_ctrl->txThreshold)) { + txq_ctrl->txNumDeferred = 0; /* Notify vSwitch that packets are available. */ VMXNET3_WRITE_BAR0_REG(hw, (VMXNET3_REG_TXPROD + txq->queue_id * VMXNET3_REG_ALIGN), txq->cmd_ring.next2fill); -- 2.20.1