patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Guinan Sun <guinanx.sun@intel.com>
To: dev@dpdk.org
Cc: Jeff Guo <jia.guo@intel.com>, Zhao1 Wei <wei.zhao1@intel.com>,
	Guinan Sun <guinanx.sun@intel.com>,
	stable@dpdk.org, Mateusz Kowalski <mateusz.kowalski@intel.com>
Subject: [dpdk-stable] [PATCH v2 03/20] net/ixgbe/base: fix host interface shadow RAM read
Date: Thu,  2 Jul 2020 03:13:12 +0000	[thread overview]
Message-ID: <20200702031329.4495-4-guinanx.sun@intel.com> (raw)
In-Reply-To: <20200702031329.4495-1-guinanx.sun@intel.com>

Host interface Shadow RAM Read (0x31) command response
buffer length should be stored in two bytes, instead of one byte.
This patch fixes it.

Fixes: e6102361b1d4 ("net/ixgbe/base: use 2 bytes for flash read command")
Cc: stable@dpdk.org

Signed-off-by: Mateusz Kowalski <mateusz.kowalski@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
---
 drivers/net/ixgbe/base/ixgbe_common.c |  2 +-
 drivers/net/ixgbe/base/ixgbe_type.h   | 12 ++++++++++++
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ixgbe/base/ixgbe_common.c b/drivers/net/ixgbe/base/ixgbe_common.c
index 36c003844..9e3b71e38 100644
--- a/drivers/net/ixgbe/base/ixgbe_common.c
+++ b/drivers/net/ixgbe/base/ixgbe_common.c
@@ -4656,7 +4656,7 @@ s32 ixgbe_host_interface_command(struct ixgbe_hw *hw, u32 *buffer,
 	 * Read Flash command requires reading buffer length from
 	 * two byes instead of one byte
 	 */
-	if (resp->cmd == 0x30) {
+	if (resp->cmd == 0x30 || resp->cmd == 0x31) {
 		for (; bi < dword_len + 2; bi++) {
 			buffer[bi] = IXGBE_READ_REG_ARRAY(hw, IXGBE_FLEX_MNG,
 							  bi);
diff --git a/drivers/net/ixgbe/base/ixgbe_type.h b/drivers/net/ixgbe/base/ixgbe_type.h
index 0470b1dfc..33ca659cd 100644
--- a/drivers/net/ixgbe/base/ixgbe_type.h
+++ b/drivers/net/ixgbe/base/ixgbe_type.h
@@ -4366,4 +4366,16 @@ struct ixgbe_hw {
 #define IXGBE_NW_MNG_IF_SEL_MDIO_PHY_ADD	\
 				(0x1F << IXGBE_NW_MNG_IF_SEL_MDIO_PHY_ADD_SHIFT)
 
+/* Code Command (Flash I/F Interface) */
+#define IXGBE_HOST_INTERFACE_FLASH_READ_CMD			0x30
+#define IXGBE_HOST_INTERFACE_SHADOW_RAM_READ_CMD		0x31
+#define IXGBE_HOST_INTERFACE_FLASH_WRITE_CMD			0x32
+#define IXGBE_HOST_INTERFACE_SHADOW_RAM_WRITE_CMD		0x33
+#define IXGBE_HOST_INTERFACE_FLASH_MODULE_UPDATE_CMD		0x34
+#define IXGBE_HOST_INTERFACE_FLASH_BLOCK_EREASE_CMD		0x35
+#define IXGBE_HOST_INTERFACE_SHADOW_RAM_DUMP_CMD		0x36
+#define IXGBE_HOST_INTERFACE_FLASH_INFO_CMD			0x37
+#define IXGBE_HOST_INTERFACE_APPLY_UPDATE_CMD			0x38
+#define IXGBE_HOST_INTERFACE_MASK_CMD				0x000000FF
+
 #endif /* _IXGBE_TYPE_H_ */
-- 
2.17.1


       reply	other threads:[~2020-07-02  3:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20200612032410.20864-1-guinanx.sun@intel.com>
     [not found] ` <20200702031329.4495-1-guinanx.sun@intel.com>
2020-07-02  3:13   ` Guinan Sun [this message]
2020-07-02  3:13   ` [dpdk-stable] [PATCH v2 05/20] net/ixgbe/base: fix x550em 10G NIC link status report Guinan Sun
     [not found]   ` <20200709080046.65879-1-guinanx.sun@intel.com>
2020-07-09  8:00     ` [dpdk-stable] [PATCH v3 01/19] net/ixgbe/base: fix host interface shadow RAM read Guinan Sun
2020-07-09  8:00     ` [dpdk-stable] [PATCH v3 03/19] net/ixgbe/base: fix x550em 10G NIC link status report Guinan Sun

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=20200702031329.4495-4-guinanx.sun@intel.com \
    --to=guinanx.sun@intel.com \
    --cc=dev@dpdk.org \
    --cc=jia.guo@intel.com \
    --cc=mateusz.kowalski@intel.com \
    --cc=stable@dpdk.org \
    --cc=wei.zhao1@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).