DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/i40e: fix X710 Rx issue after reading some registers
@ 2018-11-14  4:10 Beilei Xing
  2018-11-14 20:16 ` Zhang, Qi Z
  2018-11-15  3:17 ` [dpdk-dev] [PATCH v2] " Beilei Xing
  0 siblings, 2 replies; 4+ messages in thread
From: Beilei Xing @ 2018-11-14  4:10 UTC (permalink / raw)
  To: qi.z.zhang, jingjing.wu; +Cc: dev, stable

There's an issue that X710 can't receive any packet after
reading some special registers. That's because these
registers are only valid for X722, read access for non-X722
will cause ECC error.

Fixes: d9efd0136ac1 ("i40e: add EEPROM and registers dumping")
Cc: stable@dpdk.org

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
---
 drivers/net/i40e/i40e_ethdev.c | 33 +++++++++++++++++++++++++++++++--
 1 file changed, 31 insertions(+), 2 deletions(-)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 1c77906..686227e 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -11609,6 +11609,31 @@ i40e_dev_rx_queue_intr_disable(struct rte_eth_dev *dev, uint16_t queue_id)
 	return 0;
 }
 
+/**
+ * This function is used to check if the register is valid for non-X722 NIC.
+ * Below is the valid registers list for X722 only:
+ * 0x2b800--0x2bb00
+ * 0x38700--0x38a00
+ * 0x3d800--0x3db00
+ * 0x208e00--0x209000
+ * 0x20be00--0x20c000
+ * 0x263c00--0x264000
+ * 0x265c00--0x266000
+ */
+static inline int i40e_valid_regs(uint32_t reg_offset)
+{
+	if (((reg_offset >= 0x2b800) && (reg_offset <= 0x2bb00)) ||
+	    ((reg_offset >= 0x38700) && (reg_offset <= 0x38a00)) ||
+	    ((reg_offset >= 0x3d800) && (reg_offset <= 0x3db00)) ||
+	    ((reg_offset >= 0x208e00) && (reg_offset <= 0x209000)) ||
+	    ((reg_offset >= 0x20be00) && (reg_offset <= 0x20c000)) ||
+	    ((reg_offset >= 0x263c00) && (reg_offset <= 0x264000)) ||
+	    ((reg_offset >= 0x265c00) && (reg_offset <= 0x266000)))
+		return 0;
+	else
+		return 1;
+}
+
 static int i40e_get_regs(struct rte_eth_dev *dev,
 			 struct rte_dev_reg_info *regs)
 {
@@ -11650,8 +11675,12 @@ static int i40e_get_regs(struct rte_eth_dev *dev,
 				reg_offset = arr_idx * reg_info->stride1 +
 					arr_idx2 * reg_info->stride2;
 				reg_offset += reg_info->base_addr;
-				ptr_data[reg_offset >> 2] =
-					I40E_READ_REG(hw, reg_offset);
+				if ((hw->mac.type != I40E_MAC_X722) &&
+				    !i40e_valid_regs(reg_offset))
+					ptr_data[reg_offset >> 2] = 0;
+				else
+					ptr_data[reg_offset >> 2] =
+						I40E_READ_REG(hw, reg_offset);
 			}
 	}
 
-- 
2.5.5

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH] net/i40e: fix X710 Rx issue after reading some registers
  2018-11-14  4:10 [dpdk-dev] [PATCH] net/i40e: fix X710 Rx issue after reading some registers Beilei Xing
@ 2018-11-14 20:16 ` Zhang, Qi Z
  2018-11-15  3:17 ` [dpdk-dev] [PATCH v2] " Beilei Xing
  1 sibling, 0 replies; 4+ messages in thread
From: Zhang, Qi Z @ 2018-11-14 20:16 UTC (permalink / raw)
  To: Xing, Beilei, Wu, Jingjing; +Cc: dev, stable



> -----Original Message-----
> From: Xing, Beilei
> Sent: Tuesday, November 13, 2018 8:11 PM
> To: Zhang, Qi Z <qi.z.zhang@intel.com>; Wu, Jingjing <jingjing.wu@intel.com>
> Cc: dev@dpdk.org; stable@dpdk.org
> Subject: [PATCH] net/i40e: fix X710 Rx issue after reading some registers
> 
> There's an issue that X710 can't receive any packet after reading some special
> registers. That's because these registers are only valid for X722, read access for
> non-X722 will cause ECC error.
> 
> Fixes: d9efd0136ac1 ("i40e: add EEPROM and registers dumping")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Beilei Xing <beilei.xing@intel.com>
> ---
>  drivers/net/i40e/i40e_ethdev.c | 33
> +++++++++++++++++++++++++++++++--
>  1 file changed, 31 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
> index 1c77906..686227e 100644
> --- a/drivers/net/i40e/i40e_ethdev.c
> +++ b/drivers/net/i40e/i40e_ethdev.c
> @@ -11609,6 +11609,31 @@ i40e_dev_rx_queue_intr_disable(struct
> rte_eth_dev *dev, uint16_t queue_id)
>  	return 0;
>  }
> 
> +/**
> + * This function is used to check if the register is valid for non-X722 NIC.
> + * Below is the valid registers list for X722 only:
> + * 0x2b800--0x2bb00
> + * 0x38700--0x38a00
> + * 0x3d800--0x3db00
> + * 0x208e00--0x209000
> + * 0x20be00--0x20c000
> + * 0x263c00--0x264000
> + * 0x265c00--0x266000
> + */
> +static inline int i40e_valid_regs(uint32_t reg_offset) {

The function is named as "i4Oe_xxx", but actually it is for all devices.
I think it will be better either move the mac_type check into the function or rename to a more specific function name.


> +	if (((reg_offset >= 0x2b800) && (reg_offset <= 0x2bb00)) ||
> +	    ((reg_offset >= 0x38700) && (reg_offset <= 0x38a00)) ||
> +	    ((reg_offset >= 0x3d800) && (reg_offset <= 0x3db00)) ||
> +	    ((reg_offset >= 0x208e00) && (reg_offset <= 0x209000)) ||
> +	    ((reg_offset >= 0x20be00) && (reg_offset <= 0x20c000)) ||
> +	    ((reg_offset >= 0x263c00) && (reg_offset <= 0x264000)) ||
> +	    ((reg_offset >= 0x265c00) && (reg_offset <= 0x266000)))
> +		return 0;
> +	else
> +		return 1;
> +}
> +
>  static int i40e_get_regs(struct rte_eth_dev *dev,
>  			 struct rte_dev_reg_info *regs)
>  {
> @@ -11650,8 +11675,12 @@ static int i40e_get_regs(struct rte_eth_dev
> *dev,
>  				reg_offset = arr_idx * reg_info->stride1 +
>  					arr_idx2 * reg_info->stride2;
>  				reg_offset += reg_info->base_addr;
> -				ptr_data[reg_offset >> 2] =
> -					I40E_READ_REG(hw, reg_offset);
> +				if ((hw->mac.type != I40E_MAC_X722) &&
> +				    !i40e_valid_regs(reg_offset))
> +					ptr_data[reg_offset >> 2] = 0;
> +				else
> +					ptr_data[reg_offset >> 2] =
> +						I40E_READ_REG(hw, reg_offset);
>  			}
>  	}
> 
> --
> 2.5.5

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [dpdk-dev] [PATCH v2] net/i40e: fix X710 Rx issue after reading some registers
  2018-11-14  4:10 [dpdk-dev] [PATCH] net/i40e: fix X710 Rx issue after reading some registers Beilei Xing
  2018-11-14 20:16 ` Zhang, Qi Z
@ 2018-11-15  3:17 ` Beilei Xing
  2018-11-15 18:11   ` Zhang, Qi Z
  1 sibling, 1 reply; 4+ messages in thread
From: Beilei Xing @ 2018-11-15  3:17 UTC (permalink / raw)
  To: qi.z.zhang, jingjing.wu; +Cc: dev, stable

There's an issue that X710 can't receive any packet after
reading some special registers. That's because these
registers are only valid for X722, read access for non-X722
will cause ECC error.

Fixes: d9efd0136ac1 ("i40e: add EEPROM and registers dumping")
Cc: stable@dpdk.org

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
---
v2 change:
 - Add mac type as parameter in i40e_valid_regs function.

 drivers/net/i40e/i40e_ethdev.c | 33 +++++++++++++++++++++++++++++++--
 1 file changed, 31 insertions(+), 2 deletions(-)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 1c77906..bf67a2b 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -11609,6 +11609,32 @@ i40e_dev_rx_queue_intr_disable(struct rte_eth_dev *dev, uint16_t queue_id)
 	return 0;
 }
 
+/**
+ * This function is used to check if the register is valid.
+ * Below is the valid registers list for X722 only:
+ * 0x2b800--0x2bb00
+ * 0x38700--0x38a00
+ * 0x3d800--0x3db00
+ * 0x208e00--0x209000
+ * 0x20be00--0x20c000
+ * 0x263c00--0x264000
+ * 0x265c00--0x266000
+ */
+static inline int i40e_valid_regs(enum i40e_mac_type type, uint32_t reg_offset)
+{
+	if ((type != I40E_MAC_X722) &&
+	    ((reg_offset >= 0x2b800 && reg_offset <= 0x2bb00) ||
+	     (reg_offset >= 0x38700 && reg_offset <= 0x38a00) ||
+	     (reg_offset >= 0x3d800 && reg_offset <= 0x3db00) ||
+	     (reg_offset >= 0x208e00 && reg_offset <= 0x209000) ||
+	     (reg_offset >= 0x20be00 && reg_offset <= 0x20c000) ||
+	     (reg_offset >= 0x263c00 && reg_offset <= 0x264000) ||
+	     (reg_offset >= 0x265c00 && reg_offset <= 0x266000)))
+		return 0;
+	else
+		return 1;
+}
+
 static int i40e_get_regs(struct rte_eth_dev *dev,
 			 struct rte_dev_reg_info *regs)
 {
@@ -11650,8 +11676,11 @@ static int i40e_get_regs(struct rte_eth_dev *dev,
 				reg_offset = arr_idx * reg_info->stride1 +
 					arr_idx2 * reg_info->stride2;
 				reg_offset += reg_info->base_addr;
-				ptr_data[reg_offset >> 2] =
-					I40E_READ_REG(hw, reg_offset);
+				if (!i40e_valid_regs(hw->mac.type, reg_offset))
+					ptr_data[reg_offset >> 2] = 0;
+				else
+					ptr_data[reg_offset >> 2] =
+						I40E_READ_REG(hw, reg_offset);
 			}
 	}
 
-- 
2.5.5

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH v2] net/i40e: fix X710 Rx issue after reading some registers
  2018-11-15  3:17 ` [dpdk-dev] [PATCH v2] " Beilei Xing
@ 2018-11-15 18:11   ` Zhang, Qi Z
  0 siblings, 0 replies; 4+ messages in thread
From: Zhang, Qi Z @ 2018-11-15 18:11 UTC (permalink / raw)
  To: Xing, Beilei, Wu, Jingjing; +Cc: dev, stable



> -----Original Message-----
> From: Xing, Beilei
> Sent: Wednesday, November 14, 2018 7:17 PM
> To: Zhang, Qi Z <qi.z.zhang@intel.com>; Wu, Jingjing <jingjing.wu@intel.com>
> Cc: dev@dpdk.org; stable@dpdk.org
> Subject: [PATCH v2] net/i40e: fix X710 Rx issue after reading some registers
> 
> There's an issue that X710 can't receive any packet after reading some special
> registers. That's because these registers are only valid for X722, read access for
> non-X722 will cause ECC error.
> 
> Fixes: d9efd0136ac1 ("i40e: add EEPROM and registers dumping")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Beilei Xing <beilei.xing@intel.com>

Acked-by: Qi Zhang <qi.z.zhang@intel.com>

Applied to dpdk-next-net-intel.

Thanks
Qi

> ---
> v2 change:
>  - Add mac type as parameter in i40e_valid_regs function.
> 
>  drivers/net/i40e/i40e_ethdev.c | 33 +++++++++++++++++++++++++++++++--
>  1 file changed, 31 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
> index 1c77906..bf67a2b 100644
> --- a/drivers/net/i40e/i40e_ethdev.c
> +++ b/drivers/net/i40e/i40e_ethdev.c
> @@ -11609,6 +11609,32 @@ i40e_dev_rx_queue_intr_disable(struct
> rte_eth_dev *dev, uint16_t queue_id)
>  	return 0;
>  }
> 
> +/**
> + * This function is used to check if the register is valid.
> + * Below is the valid registers list for X722 only:
> + * 0x2b800--0x2bb00
> + * 0x38700--0x38a00
> + * 0x3d800--0x3db00
> + * 0x208e00--0x209000
> + * 0x20be00--0x20c000
> + * 0x263c00--0x264000
> + * 0x265c00--0x266000
> + */
> +static inline int i40e_valid_regs(enum i40e_mac_type type, uint32_t
> +reg_offset) {
> +	if ((type != I40E_MAC_X722) &&
> +	    ((reg_offset >= 0x2b800 && reg_offset <= 0x2bb00) ||
> +	     (reg_offset >= 0x38700 && reg_offset <= 0x38a00) ||
> +	     (reg_offset >= 0x3d800 && reg_offset <= 0x3db00) ||
> +	     (reg_offset >= 0x208e00 && reg_offset <= 0x209000) ||
> +	     (reg_offset >= 0x20be00 && reg_offset <= 0x20c000) ||
> +	     (reg_offset >= 0x263c00 && reg_offset <= 0x264000) ||
> +	     (reg_offset >= 0x265c00 && reg_offset <= 0x266000)))
> +		return 0;
> +	else
> +		return 1;
> +}
> +
>  static int i40e_get_regs(struct rte_eth_dev *dev,
>  			 struct rte_dev_reg_info *regs)
>  {
> @@ -11650,8 +11676,11 @@ static int i40e_get_regs(struct rte_eth_dev
> *dev,
>  				reg_offset = arr_idx * reg_info->stride1 +
>  					arr_idx2 * reg_info->stride2;
>  				reg_offset += reg_info->base_addr;
> -				ptr_data[reg_offset >> 2] =
> -					I40E_READ_REG(hw, reg_offset);
> +				if (!i40e_valid_regs(hw->mac.type, reg_offset))
> +					ptr_data[reg_offset >> 2] = 0;
> +				else
> +					ptr_data[reg_offset >> 2] =
> +						I40E_READ_REG(hw, reg_offset);
>  			}
>  	}
> 
> --
> 2.5.5

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-11-15 18:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-14  4:10 [dpdk-dev] [PATCH] net/i40e: fix X710 Rx issue after reading some registers Beilei Xing
2018-11-14 20:16 ` Zhang, Qi Z
2018-11-15  3:17 ` [dpdk-dev] [PATCH v2] " Beilei Xing
2018-11-15 18:11   ` Zhang, Qi Z

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).