patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Jingjing Wu <jingjing.wu@intel.com>
To: dev@dpdk.org
Cc: jingjing.wu@intel.com, helin.zhang@intel.com, stable@dpdk.org
Subject: [dpdk-stable] [PATCH v3 22/31] net/i40e/base: fix NVM access intefering
Date: Sat, 10 Dec 2016 19:24:44 +0800	[thread overview]
Message-ID: <1481369093-102492-23-git-send-email-jingjing.wu@intel.com> (raw)
In-Reply-To: <1481369093-102492-1-git-send-email-jingjing.wu@intel.com>

Acquire NVM lock before reads on all devices.  Previously, locks were
only used for X722 and later.  Fixes an issue where simultaneous X710
NVM accesses were interfering with each other.

Fixes: 8db9e2a1b232 ("i40e: base driver")

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
CC: stable@dpdk.org
---
 drivers/net/i40e/base/i40e_nvm.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/net/i40e/base/i40e_nvm.c b/drivers/net/i40e/base/i40e_nvm.c
index eb69e49..1f345a5 100644
--- a/drivers/net/i40e/base/i40e_nvm.c
+++ b/drivers/net/i40e/base/i40e_nvm.c
@@ -219,19 +219,19 @@ enum i40e_status_code i40e_read_nvm_word(struct i40e_hw *hw, u16 offset,
 {
 	enum i40e_status_code ret_code = I40E_SUCCESS;
 
+	ret_code = i40e_acquire_nvm(hw, I40E_RESOURCE_READ);
+	if (!ret_code) {
 #ifdef X722_SUPPORT
-	if (hw->flags & I40E_HW_FLAG_AQ_SRCTL_ACCESS_ENABLE) {
-		ret_code = i40e_acquire_nvm(hw, I40E_RESOURCE_READ);
-		if (!ret_code) {
+		if (hw->flags & I40E_HW_FLAG_AQ_SRCTL_ACCESS_ENABLE) {
 			ret_code = i40e_read_nvm_word_aq(hw, offset, data);
-			i40e_release_nvm(hw);
+		} else {
+			ret_code = i40e_read_nvm_word_srctl(hw, offset, data);
 		}
-	} else {
-		ret_code = i40e_read_nvm_word_srctl(hw, offset, data);
-	}
 #else
-	ret_code = i40e_read_nvm_word_srctl(hw, offset, data);
+		ret_code = i40e_read_nvm_word_srctl(hw, offset, data);
 #endif
+		i40e_release_nvm(hw);
+	}
 	return ret_code;
 }
 
-- 
2.4.11

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

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1481294364-83505-1-git-send-email-jingjing.wu@intel.com>
     [not found] ` <1481369093-102492-1-git-send-email-jingjing.wu@intel.com>
2016-12-10 11:24   ` [dpdk-stable] [PATCH v3 02/31] net/i40e/base: fix flow control set for 25G Jingjing Wu
2016-12-10 11:24   ` [dpdk-stable] [PATCH v3 04/31] net/i40e/base: fix bit test mask Jingjing Wu
2016-12-10 11:24   ` [dpdk-stable] [PATCH v3 06/31] net/i40e/base: fix long link down notification time Jingjing Wu
2016-12-10 11:24   ` [dpdk-stable] [PATCH v3 11/31] net/i40e/base: fix unknown PHYs incorrect identification Jingjing Wu
2016-12-10 11:24   ` [dpdk-stable] [PATCH v3 20/31] net/i40e/base: fix wol failure on PF reset Jingjing Wu
2016-12-10 11:24   ` Jingjing Wu [this message]
2016-12-10 11:24   ` [dpdk-stable] [PATCH v3 28/31] net/i40e/base: fix division by zero Jingjing Wu
2016-12-10 11:24   ` [dpdk-stable] [PATCH v3 29/31] net/i40e/base: fix byte order Jingjing Wu

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=1481369093-102492-23-git-send-email-jingjing.wu@intel.com \
    --to=jingjing.wu@intel.com \
    --cc=dev@dpdk.org \
    --cc=helin.zhang@intel.com \
    --cc=stable@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).