[v2] net/ixgbe: fix statistics error in flow control mode

Message ID 20200512081306.16013-1-guinanx.sun@intel.com (mailing list archive)
State Accepted, archived
Delegated to: xiaolong ye
Headers
Series [v2] net/ixgbe: fix statistics error in flow control mode |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/travis-robot success Travis build: passed
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-nxp-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-testing fail Testing issues

Commit Message

Guinan Sun May 12, 2020, 8:13 a.m. UTC
  The register autoneg can't be updated synchronously
with flow control mode setting in the state of port start
, so NIC statistics error occurs. AUTO_NEG Advt register
should be updated by ixgbe_setup_fc() when enabling flow control.
The patch fixes the issue.

Fixes: a524f550da6e ("net/ixgbe: fix flow control mode setting")
Cc: stable@dpdk.org

Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
---
v2 changes:
* Replaced mac.ops.setup_fc() with ixgbe_setup_fc()
* Modified commit message.
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 2 ++
 1 file changed, 2 insertions(+)
  

Comments

Zhao1, Wei May 12, 2020, 8:39 a.m. UTC | #1
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>


> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Guinan Sun
> Sent: Tuesday, May 12, 2020 4:13 PM
> To: dev@dpdk.org
> Cc: Sun, GuinanX <guinanx.sun@intel.com>; stable@dpdk.org
> Subject: [dpdk-dev] [PATCH v2] net/ixgbe: fix statistics error in flow control
> mode
> 
> The register autoneg can't be updated synchronously with flow control mode
> setting in the state of port start , so NIC statistics error occurs. AUTO_NEG
> Advt register should be updated by ixgbe_setup_fc() when enabling flow
> control.
> The patch fixes the issue.
> 
> Fixes: a524f550da6e ("net/ixgbe: fix flow control mode setting")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
> ---
> v2 changes:
> * Replaced mac.ops.setup_fc() with ixgbe_setup_fc()
> * Modified commit message.
> ---
>  drivers/net/ixgbe/ixgbe_ethdev.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c
> b/drivers/net/ixgbe/ixgbe_ethdev.c
> index a4e5c539d..f8a84c565 100644
> --- a/drivers/net/ixgbe/ixgbe_ethdev.c
> +++ b/drivers/net/ixgbe/ixgbe_ethdev.c
> @@ -2543,6 +2543,8 @@ ixgbe_flow_ctrl_enable(struct rte_eth_dev *dev,
> struct ixgbe_hw *hw)
>  	int err;
>  	uint32_t mflcn;
> 
> +	ixgbe_setup_fc(hw);
> +
>  	err = ixgbe_fc_enable(hw);
> 
>  	/* Not negotiated is not an error case */
> --
> 2.17.1
  
Xiaolong Ye May 13, 2020, 12:59 a.m. UTC | #2
On 05/12, Guinan Sun wrote:
>The register autoneg can't be updated synchronously
>with flow control mode setting in the state of port start
>, so NIC statistics error occurs. AUTO_NEG Advt register
>should be updated by ixgbe_setup_fc() when enabling flow control.
>The patch fixes the issue.
>
>Fixes: a524f550da6e ("net/ixgbe: fix flow control mode setting")
>Cc: stable@dpdk.org
>
>Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
>---
>v2 changes:
>* Replaced mac.ops.setup_fc() with ixgbe_setup_fc()
>* Modified commit message.
>---
> drivers/net/ixgbe/ixgbe_ethdev.c | 2 ++
> 1 file changed, 2 insertions(+)
>
>diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
>index a4e5c539d..f8a84c565 100644
>--- a/drivers/net/ixgbe/ixgbe_ethdev.c
>+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
>@@ -2543,6 +2543,8 @@ ixgbe_flow_ctrl_enable(struct rte_eth_dev *dev, struct ixgbe_hw *hw)
> 	int err;
> 	uint32_t mflcn;
> 
>+	ixgbe_setup_fc(hw);
>+
> 	err = ixgbe_fc_enable(hw);
> 
> 	/* Not negotiated is not an error case */
>-- 
>2.17.1
>

Applied to dpdk-next-net-intel, Thanks.
  
Yu Jiang May 13, 2020, 7:03 a.m. UTC | #3
Tested-by: Jiang, YuX <yux.jiang@intel.com>

-----Original Message-----
From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Ye Xiaolong
Sent: Wednesday, May 13, 2020 8:59 AM
To: Sun, GuinanX <guinanx.sun@intel.com>
Cc: dev@dpdk.org; stable@dpdk.org
Subject: Re: [dpdk-dev] [dpdk-stable] [PATCH v2] net/ixgbe: fix statistics error in flow control mode

On 05/12, Guinan Sun wrote:
>The register autoneg can't be updated synchronously with flow control 
>mode setting in the state of port start , so NIC statistics error 
>occurs. AUTO_NEG Advt register should be updated by ixgbe_setup_fc() 
>when enabling flow control.
>The patch fixes the issue.
>
>Fixes: a524f550da6e ("net/ixgbe: fix flow control mode setting")
>Cc: stable@dpdk.org
>
>Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
>---
>v2 changes:
>* Replaced mac.ops.setup_fc() with ixgbe_setup_fc()
>* Modified commit message.
>---
> drivers/net/ixgbe/ixgbe_ethdev.c | 2 ++
> 1 file changed, 2 insertions(+)
>
>diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c 
>b/drivers/net/ixgbe/ixgbe_ethdev.c
>index a4e5c539d..f8a84c565 100644
>--- a/drivers/net/ixgbe/ixgbe_ethdev.c
>+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
>@@ -2543,6 +2543,8 @@ ixgbe_flow_ctrl_enable(struct rte_eth_dev *dev, struct ixgbe_hw *hw)
> 	int err;
> 	uint32_t mflcn;
> 
>+	ixgbe_setup_fc(hw);
>+
> 	err = ixgbe_fc_enable(hw);
> 
> 	/* Not negotiated is not an error case */
>--
>2.17.1
>

Applied to dpdk-next-net-intel, Thanks.
  

Patch

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index a4e5c539d..f8a84c565 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -2543,6 +2543,8 @@  ixgbe_flow_ctrl_enable(struct rte_eth_dev *dev, struct ixgbe_hw *hw)
 	int err;
 	uint32_t mflcn;
 
+	ixgbe_setup_fc(hw);
+
 	err = ixgbe_fc_enable(hw);
 
 	/* Not negotiated is not an error case */