DPDK patches and discussions
 help / color / mirror / Atom feed
From: Satha Rao <skoteshwar@caviumnetworks.com>
To: <helin.zhang@intel.com>
Cc: <jingjing.wu@intel.com>, <jerin.jacob@caviumnetworks.com>,
	<jianbo.liu@linaro.org>, <dev@dpdk.org>,
	Satha Rao <skoteshwar@caviumnetworks.com>
Subject: [dpdk-dev] [PATCH] i40e: Fix eth_i40e_dev_init sequence on ThunderX
Date: Thu, 10 Nov 2016 04:04:27 -0800	[thread overview]
Message-ID: <1478779467-35123-1-git-send-email-skoteshwar@caviumnetworks.com> (raw)

i40e_asq_send_command: rd32 & wr32 under ThunderX gives unpredictable
                       results. To solve this include rte memory barriers

Signed-off-by: Satha Rao <skoteshwar@caviumnetworks.com>
---
 drivers/net/i40e/base/i40e_adminq.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/i40e/base/i40e_adminq.c b/drivers/net/i40e/base/i40e_adminq.c
index 0d3a83f..1038a95 100644
--- a/drivers/net/i40e/base/i40e_adminq.c
+++ b/drivers/net/i40e/base/i40e_adminq.c
@@ -832,6 +832,7 @@ enum i40e_status_code i40e_asq_send_command(struct i40e_hw *hw,
 	}
 
 	val = rd32(hw, hw->aq.asq.head);
+	rte_rmb();
 	if (val >= hw->aq.num_asq_entries) {
 		i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE,
 			   "AQTX: head overrun at %d\n", val);
@@ -929,8 +930,10 @@ enum i40e_status_code i40e_asq_send_command(struct i40e_hw *hw,
 	(hw->aq.asq.next_to_use)++;
 	if (hw->aq.asq.next_to_use == hw->aq.asq.count)
 		hw->aq.asq.next_to_use = 0;
-	if (!details->postpone)
+	if (!details->postpone) {
 		wr32(hw, hw->aq.asq.tail, hw->aq.asq.next_to_use);
+		rte_wmb();
+	}
 
 	/* if cmd_details are not defined or async flag is not set,
 	 * we need to wait for desc write back
-- 
2.7.4

             reply	other threads:[~2016-11-10 12:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-10 12:04 Satha Rao [this message]
2016-11-10 12:11 ` Jerin Jacob
2016-11-11 13:54 ` Zhang, Helin

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=1478779467-35123-1-git-send-email-skoteshwar@caviumnetworks.com \
    --to=skoteshwar@caviumnetworks.com \
    --cc=dev@dpdk.org \
    --cc=helin.zhang@intel.com \
    --cc=jerin.jacob@caviumnetworks.com \
    --cc=jianbo.liu@linaro.org \
    --cc=jingjing.wu@intel.com \
    /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).