From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-outbound-1.vmware.com (smtp-outbound-1.vmware.com [208.91.2.12]) by dpdk.org (Postfix) with ESMTP id D063A8E78 for ; Wed, 13 Jan 2016 03:19:33 +0100 (CET) Received: from sc9-mailhost2.vmware.com (sc9-mailhost2.vmware.com [10.113.161.72]) by smtp-outbound-1.vmware.com (Postfix) with ESMTP id 0780028FDE; Tue, 12 Jan 2016 18:19:31 -0800 (PST) Received: from prmh-edge-ivybridge-01.eng.vmware.com (unknown [10.24.235.72]) by sc9-mailhost2.vmware.com (Postfix) with ESMTP id 17295B0300; Tue, 12 Jan 2016 18:19:32 -0800 (PST) From: Yong Wang To: dev@dpdk.org Date: Tue, 12 Jan 2016 18:08:34 -0800 Message-Id: <1452650917-7960-4-git-send-email-yongwang@vmware.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1452650917-7960-1-git-send-email-yongwang@vmware.com> References: <1452650917-7960-1-git-send-email-yongwang@vmware.com> Subject: [dpdk-dev] [PATCH v4 3/6] vmxnet3: cleanup txNumDeferred usage X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2016 02:19:34 -0000 Signed-off-by: Yong Wang --- 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 4ccab0e..f3af2f2 100644 --- a/drivers/net/vmxnet3/vmxnet3_rxtx.c +++ b/drivers/net/vmxnet3/vmxnet3_rxtx.c @@ -332,6 +332,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."); @@ -419,15 +421,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); -- 1.9.1