[03/21] net/ixgbe/base: hange flow for "Apply Update" command

Message ID 20200612032410.20864-4-guinanx.sun@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Qi Zhang
Headers
Series update ixgbe base code |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Guinan Sun June 12, 2020, 3:23 a.m. UTC
  For the "Apply Update" command the firmware does not
given an response. For this command, success should
be return. Based on information at EAS.

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 |  9 ++++++++-
 drivers/net/ixgbe/base/ixgbe_type.h   | 12 ++++++++++++
 2 files changed, 20 insertions(+), 1 deletion(-)
  

Comments

Ferruh Yigit June 22, 2020, 11:58 a.m. UTC | #1
On 6/12/2020 4:23 AM, Guinan Sun wrote:
> For the "Apply Update" command the firmware does not
> given an response. For this command, success should
> be return. Based on information at EAS.
> 
> Signed-off-by: Mateusz Kowalski <mateusz.kowalski@intel.com>
> Signed-off-by: Guinan Sun <guinanx.sun@intel.com>

<...>

> 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_ */
> 

Previous patch uses these commands in a hardcoded way, since we are adding
defines, why not them in the previous patch so we can use the macros in previous
patch?
  
Guinan Sun June 30, 2020, 2:24 a.m. UTC | #2
Hi Ferruh

> -----Original Message-----
> From: Yigit, Ferruh
> Sent: Monday, June 22, 2020 7:59 PM
> To: Sun, GuinanX <guinanx.sun@intel.com>; dev@dpdk.org
> Cc: Mateusz Kowalski <mateusz.kowalski@intel.com>
> Subject: Re: [dpdk-dev] [PATCH 03/21] net/ixgbe/base: hange flow for "Apply
> Update" command
> 
> On 6/12/2020 4:23 AM, Guinan Sun wrote:
> > For the "Apply Update" command the firmware does not given an
> > response. For this command, success should be return. Based on
> > information at EAS.
> >
> > Signed-off-by: Mateusz Kowalski <mateusz.kowalski@intel.com>
> > Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
> 
> <...>
> 
> > 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_ */
> >
> 
> Previous patch uses these commands in a hardcoded way, since we are adding
> defines, why not them in the previous patch so we can use the macros in
> previous patch?

I agree with you.
V2 patch we will split this patch into two parts.
The part about macrow will be merged into the previous patch.
  

Patch

diff --git a/drivers/net/ixgbe/base/ixgbe_common.c b/drivers/net/ixgbe/base/ixgbe_common.c
index 9e3b71e38..89ae2b462 100644
--- a/drivers/net/ixgbe/base/ixgbe_common.c
+++ b/drivers/net/ixgbe/base/ixgbe_common.c
@@ -4584,11 +4584,18 @@  s32 ixgbe_hic_unlocked(struct ixgbe_hw *hw, u32 *buffer, u32 length,
 		msec_delay(1);
 	}
 
+	/* For each command except "Apply Update" perform
+	 * status checks in the HICR registry.
+	 */
+	if ((buffer[0] & IXGBE_HOST_INTERFACE_MASK_CMD) ==
+	    IXGBE_HOST_INTERFACE_APPLY_UPDATE_CMD)
+		return IXGBE_SUCCESS;
+
 	/* Check command completion */
 	if ((timeout && i == timeout) ||
 	    !(IXGBE_READ_REG(hw, IXGBE_HICR) & IXGBE_HICR_SV)) {
 		ERROR_REPORT1(IXGBE_ERROR_CAUTION,
-			     "Command has failed with no status valid.\n");
+			      "Command has failed with no status valid.\n");
 		return IXGBE_ERR_HOST_INTERFACE_COMMAND;
 	}
 
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_ */