net/iavf: fix error handle for unsupported promisc configure

Message ID 20210526095305.1060069-1-qi.z.zhang@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Qi Zhang
Headers
Series net/iavf: fix error handle for unsupported promisc configure |

Checks

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

Commit Message

Qi Zhang May 26, 2021, 9:53 a.m. UTC
  iavf_execute_vf_cmd returns standard error code but not IAVF_xxx,
The patch fix the wrong error handling in iavf_config_promisc.

Fixes: 1e4d55a7fe71 ("net/iavf: optimize promiscuous device operations")
Cc: stable@dpdk.org

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/iavf/iavf_vchnl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Xing, Beilei May 27, 2021, 1:54 a.m. UTC | #1
> -----Original Message-----
> From: Zhang, Qi Z <qi.z.zhang@intel.com>
> Sent: Wednesday, May 26, 2021 5:53 PM
> To: Xing, Beilei <beilei.xing@intel.com>
> Cc: dev@dpdk.org; Zhang, Qi Z <qi.z.zhang@intel.com>; stable@dpdk.org
> Subject: [PATCH] net/iavf: fix error handle for unsupported promisc configure
> 
> iavf_execute_vf_cmd returns standard error code but not IAVF_xxx, The patch
> fix the wrong error handling in iavf_config_promisc.
> 
> Fixes: 1e4d55a7fe71 ("net/iavf: optimize promiscuous device operations")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
> ---
>  drivers/net/iavf/iavf_vchnl.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.c index
> 5d57e8b541..02e828f9b7 100644
> --- a/drivers/net/iavf/iavf_vchnl.c
> +++ b/drivers/net/iavf/iavf_vchnl.c
> @@ -1257,8 +1257,8 @@ iavf_config_promisc(struct iavf_adapter *adapter,
>  		PMD_DRV_LOG(ERR,
>  			    "fail to execute command
> CONFIG_PROMISCUOUS_MODE");
> 
> -		if (err == IAVF_NOT_SUPPORTED)
> -			return -ENOTSUP;
> +		if (err == -ENOTSUP)
> +			return err;
> 
>  		return -EAGAIN;
>  	}
> --
> 2.26.2

Acked-by: Beilei Xing <beilei.xing@intel.com>
  
Qi Zhang June 1, 2021, 11:07 a.m. UTC | #2
> -----Original Message-----
> From: Xing, Beilei <beilei.xing@intel.com>
> Sent: Thursday, May 27, 2021 9:54 AM
> To: Zhang, Qi Z <qi.z.zhang@intel.com>
> Cc: dev@dpdk.org; stable@dpdk.org
> Subject: RE: [PATCH] net/iavf: fix error handle for unsupported promisc
> configure
> 
> 
> 
> > -----Original Message-----
> > From: Zhang, Qi Z <qi.z.zhang@intel.com>
> > Sent: Wednesday, May 26, 2021 5:53 PM
> > To: Xing, Beilei <beilei.xing@intel.com>
> > Cc: dev@dpdk.org; Zhang, Qi Z <qi.z.zhang@intel.com>; stable@dpdk.org
> > Subject: [PATCH] net/iavf: fix error handle for unsupported promisc
> > configure
> >
> > iavf_execute_vf_cmd returns standard error code but not IAVF_xxx, The
> > patch fix the wrong error handling in iavf_config_promisc.
> >
> > Fixes: 1e4d55a7fe71 ("net/iavf: optimize promiscuous device
> > operations")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
> > ---
> >  drivers/net/iavf/iavf_vchnl.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/net/iavf/iavf_vchnl.c
> > b/drivers/net/iavf/iavf_vchnl.c index
> > 5d57e8b541..02e828f9b7 100644
> > --- a/drivers/net/iavf/iavf_vchnl.c
> > +++ b/drivers/net/iavf/iavf_vchnl.c
> > @@ -1257,8 +1257,8 @@ iavf_config_promisc(struct iavf_adapter *adapter,
> >  		PMD_DRV_LOG(ERR,
> >  			    "fail to execute command
> > CONFIG_PROMISCUOUS_MODE");
> >
> > -		if (err == IAVF_NOT_SUPPORTED)
> > -			return -ENOTSUP;
> > +		if (err == -ENOTSUP)
> > +			return err;
> >
> >  		return -EAGAIN;
> >  	}
> > --
> > 2.26.2
> 
> Acked-by: Beilei Xing <beilei.xing@intel.com>

Applied to dpdk-next-net-intel.

Thanks
Qi
>
  

Patch

diff --git a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.c
index 5d57e8b541..02e828f9b7 100644
--- a/drivers/net/iavf/iavf_vchnl.c
+++ b/drivers/net/iavf/iavf_vchnl.c
@@ -1257,8 +1257,8 @@  iavf_config_promisc(struct iavf_adapter *adapter,
 		PMD_DRV_LOG(ERR,
 			    "fail to execute command CONFIG_PROMISCUOUS_MODE");
 
-		if (err == IAVF_NOT_SUPPORTED)
-			return -ENOTSUP;
+		if (err == -ENOTSUP)
+			return err;
 
 		return -EAGAIN;
 	}