DPDK patches and discussions
 help / color / mirror / Atom feed
From: Yong Wang <yongwang@vmware.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH v4 3/6] vmxnet3: cleanup txNumDeferred usage
Date: Tue, 12 Jan 2016 18:08:34 -0800	[thread overview]
Message-ID: <1452650917-7960-4-git-send-email-yongwang@vmware.com> (raw)
In-Reply-To: <1452650917-7960-1-git-send-email-yongwang@vmware.com>

Signed-off-by: Yong Wang <yongwang@vmware.com>
---
 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

  parent reply	other threads:[~2016-01-13  2:19 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-13  2:08 [dpdk-dev] [PATCH v4 0/6] vmxnet3 TSO, tx cksum offload and cleanups Yong Wang
2016-01-13  2:08 ` [dpdk-dev] [PATCH v4 1/6] vmxnet3: fix typos and remove unused struct Yong Wang
2016-01-13  2:08 ` [dpdk-dev] [PATCH v4 2/6] vmxnet3: restore tx data ring support Yong Wang
2016-01-13  2:08 ` Yong Wang [this message]
2016-01-13  2:08 ` [dpdk-dev] [PATCH v4 4/6] vmxnet3: add tx l4 cksum offload Yong Wang
2016-01-13  2:08 ` [dpdk-dev] [PATCH v4 5/6] vmxnet3: add TSO support Yong Wang
2016-03-15 20:39   ` Thomas Monjalon
2016-01-13  2:08 ` [dpdk-dev] [PATCH v4 6/6] vmxnet3: announce device offload capability Yong Wang
2016-01-13  4:56 ` [dpdk-dev] [PATCH v4 0/6] vmxnet3 TSO, tx cksum offload and cleanups Stephen Hemminger
2016-02-10 12:30   ` Bruce Richardson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1452650917-7960-4-git-send-email-yongwang@vmware.com \
    --to=yongwang@vmware.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).