net/ixgbe: fix statistics error in flow control mode

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

Checks

Context Check Description
ci/checkpatch success coding style 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/Intel-compilation success Compilation OK
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-testing fail Testing issues

Commit Message

Guinan Sun May 8, 2020, 8:29 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. 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>
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 2 ++
 1 file changed, 2 insertions(+)
  

Comments

Jiang, YuX May 9, 2020, 3:13 a.m. UTC | #1
Tested-by: Jiang, YuX <yux.jiang@intel.com>

-----Original Message-----
From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Guinan Sun
Sent: Friday, May 8, 2020 4:30 PM
To: dev@dpdk.org
Cc: Sun, GuinanX <guinanx.sun@intel.com>; stable@dpdk.org
Subject: [dpdk-dev] [PATCH] 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. 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>
---
 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 cf5f1fe70..e6c747aef 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;
 
+	hw->mac.ops.setup_fc(hw);
+
 	err = ixgbe_fc_enable(hw);
 
 	/* Not negotiated is not an error case */
--
2.17.1
  
Zhao1, Wei May 11, 2020, 1:03 a.m. UTC | #2
Hi, Guinan

> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Guinan Sun
> Sent: Friday, May 8, 2020 4:30 PM
> To: dev@dpdk.org
> Cc: Sun, GuinanX <guinanx.sun@intel.com>; stable@dpdk.org
> Subject: [dpdk-dev] [PATCH] 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. 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>
> ---
>  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 cf5f1fe70..e6c747aef 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;
> 
> +	hw->mac.ops.setup_fc(hw);

1. please use base code API ixgbe_setup_fc(), do not use internal function directly.
2. please more info for this patch, what register error you want to fix, and why it can fix.
 

> +
>  	err = ixgbe_fc_enable(hw);
> 
>  	/* Not negotiated is not an error case */
> --
> 2.17.1
  
Guinan Sun May 12, 2020, 8:28 a.m. UTC | #3
Hi zhaowei

> -----Original Message-----
> From: Zhao1, Wei
> Sent: Monday, May 11, 2020 9:03 AM
> To: Sun, GuinanX <guinanx.sun@intel.com>; dev@dpdk.org
> Cc: Sun, GuinanX <guinanx.sun@intel.com>; stable@dpdk.org; Guo, Jia
> <jia.guo@intel.com>
> Subject: RE: [dpdk-dev] [PATCH] net/ixgbe: fix statistics error in flow control
> mode
> 
> 
> Hi, Guinan
> 
> > -----Original Message-----
> > From: dev <dev-bounces@dpdk.org> On Behalf Of Guinan Sun
> > Sent: Friday, May 8, 2020 4:30 PM
> > To: dev@dpdk.org
> > Cc: Sun, GuinanX <guinanx.sun@intel.com>; stable@dpdk.org
> > Subject: [dpdk-dev] [PATCH] 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. 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>
> > ---
> >  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 cf5f1fe70..e6c747aef 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;
> >
> > +hw->mac.ops.setup_fc(hw);
> 
> 1. please use base code API ixgbe_setup_fc(), do not use internal function
> directly.
> 2. please more info for this patch, what register error you want to fix, and why it
> can fix.

V2 patch will be send to resolve the problems.

> 
> 
> > +
> >  err = ixgbe_fc_enable(hw);
> >
> >  /* Not negotiated is not an error case */
> > --
> > 2.17.1
>
  

Patch

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index cf5f1fe70..e6c747aef 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;
 
+	hw->mac.ops.setup_fc(hw);
+
 	err = ixgbe_fc_enable(hw);
 
 	/* Not negotiated is not an error case */