patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [DPDK 20.11] net/iavf: fix error handling for unsupported promisc config
@ 2021-06-11  1:43 Qi Zhang
  2021-06-20 14:05 ` Xueming(Steven) Li
  0 siblings, 1 reply; 4+ messages in thread
From: Qi Zhang @ 2021-06-11  1:43 UTC (permalink / raw)
  To: bluca
  Cc: vitaliy.zakharchenko, arjun.anantharam, stable, Qi Zhang, Ngai-mint Kwan

[ upstream commit 308f75b5c9cc5ca3e972dbc84375bdee353c3156 ]
[ upstream commit 0c35eecfe8b54bbdf59c30a803404acfdcc4f7eb ]

1. The VIRTCHNL_STATUS_ERR_NOT_SUPPORTED should be esculated to upper
   with -ENOTSUP in iavf_execute_vf_cmd.
2. fix error code check in iavf_config_promisc
3. change vf->cmd_ret_val from unsigned to signed as it will compare with
   negtive value.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Signed-off-by: Ngai-mint Kwan <ngai-mint.kwan@intel.com>
---
 drivers/net/iavf/iavf.h       |  2 +-
 drivers/net/iavf/iavf_vchnl.c | 16 +++++++++++-----
 2 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/drivers/net/iavf/iavf.h b/drivers/net/iavf/iavf.h
index 0196f74721..4bcb407b20 100644
--- a/drivers/net/iavf/iavf.h
+++ b/drivers/net/iavf/iavf.h
@@ -136,7 +136,7 @@ struct iavf_info {
 	uint64_t supported_rxdid;
 	uint8_t *proto_xtr; /* proto xtr type for all queues */
 	volatile enum virtchnl_ops pend_cmd; /* pending command not finished */
-	uint32_t cmd_retval; /* return value of the cmd response from PF */
+	int cmd_retval; /* return value of the cmd response from PF */
 	uint8_t *aq_resp; /* buffer to store the adminq response from PF */
 
 	/* Event from pf */
diff --git a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.c
index 3d52a8c402..219245d040 100644
--- a/drivers/net/iavf/iavf_vchnl.c
+++ b/drivers/net/iavf/iavf_vchnl.c
@@ -228,12 +228,18 @@ iavf_execute_vf_cmd(struct iavf_adapter *adapter, struct iavf_cmd_info *args)
 			/* If don't read msg or read sys event, continue */
 		} while (i++ < MAX_TRY_TIMES);
 		/* If there's no response is received, clear command */
-		if (i >= MAX_TRY_TIMES  ||
-		    vf->cmd_retval != VIRTCHNL_STATUS_SUCCESS) {
-			err = -1;
+		if (i >= MAX_TRY_TIMES) {
 			PMD_DRV_LOG(ERR, "No response or return failure (%d)"
 				    " for cmd %d", vf->cmd_retval, args->ops);
 			_clear_cmd(vf);
+			err = -EIO;
+		} else if (vf->cmd_retval == VIRTCHNL_STATUS_ERR_NOT_SUPPORTED) {
+			PMD_DRV_LOG(ERR, "Cmd %d not supported", args->ops);
+			err = -ENOTSUP;
+		} else if (vf->cmd_retval != VIRTCHNL_STATUS_SUCCESS) {
+			PMD_DRV_LOG(ERR, "Return failure %d for cmd %d",
+				    vf->cmd_retval, args->ops);
+			err = -EINVAL;
 		}
 		break;
 	}
@@ -1099,8 +1105,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


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

* Re: [dpdk-stable] [DPDK 20.11] net/iavf: fix error handling for unsupported promisc config
  2021-06-11  1:43 [dpdk-stable] [DPDK 20.11] net/iavf: fix error handling for unsupported promisc config Qi Zhang
@ 2021-06-20 14:05 ` Xueming(Steven) Li
  2021-06-21  1:04   ` Zhang, Qi Z
  0 siblings, 1 reply; 4+ messages in thread
From: Xueming(Steven) Li @ 2021-06-20 14:05 UTC (permalink / raw)
  To: Qi Zhang, bluca
  Cc: vitaliy.zakharchenko, arjun.anantharam, stable, Ngai-mint Kwan

Hi Qi,

Two upstream tag in this commit message, the first one not found in upstream branch, could you please check?
BTW, the patch can't be applied to 20.11 work queue branch, could you please rebase on latest version?
	https://github.com/steevenlee/dpdk/commits/20.11

Best Regards,
Xueming

> -----Original Message-----
> From: stable <stable-bounces@dpdk.org> On Behalf Of Qi Zhang
> Sent: Friday, June 11, 2021 9:44 AM
> To: bluca@debian.org
> Cc: vitaliy.zakharchenko@intel.com; arjun.anantharam@intel.com; stable@dpdk.org; Qi Zhang <qi.z.zhang@intel.com>; Ngai-mint
> Kwan <ngai-mint.kwan@intel.com>
> Subject: [dpdk-stable] [DPDK 20.11] net/iavf: fix error handling for unsupported promisc config
> 
> [ upstream commit 308f75b5c9cc5ca3e972dbc84375bdee353c3156 ] [ upstream commit
> 0c35eecfe8b54bbdf59c30a803404acfdcc4f7eb ]
> 
> 1. The VIRTCHNL_STATUS_ERR_NOT_SUPPORTED should be esculated to upper
>    with -ENOTSUP in iavf_execute_vf_cmd.
> 2. fix error code check in iavf_config_promisc 3. change vf->cmd_ret_val from unsigned to signed as it will compare with
>    negtive value.
> 
> Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
> Signed-off-by: Ngai-mint Kwan <ngai-mint.kwan@intel.com>
> ---
>  drivers/net/iavf/iavf.h       |  2 +-
>  drivers/net/iavf/iavf_vchnl.c | 16 +++++++++++-----
>  2 files changed, 12 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/net/iavf/iavf.h b/drivers/net/iavf/iavf.h index 0196f74721..4bcb407b20 100644
> --- a/drivers/net/iavf/iavf.h
> +++ b/drivers/net/iavf/iavf.h
> @@ -136,7 +136,7 @@ struct iavf_info {
>  	uint64_t supported_rxdid;
>  	uint8_t *proto_xtr; /* proto xtr type for all queues */
>  	volatile enum virtchnl_ops pend_cmd; /* pending command not finished */
> -	uint32_t cmd_retval; /* return value of the cmd response from PF */
> +	int cmd_retval; /* return value of the cmd response from PF */
>  	uint8_t *aq_resp; /* buffer to store the adminq response from PF */
> 
>  	/* Event from pf */
> diff --git a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.c index 3d52a8c402..219245d040 100644
> --- a/drivers/net/iavf/iavf_vchnl.c
> +++ b/drivers/net/iavf/iavf_vchnl.c
> @@ -228,12 +228,18 @@ iavf_execute_vf_cmd(struct iavf_adapter *adapter, struct iavf_cmd_info *args)
>  			/* If don't read msg or read sys event, continue */
>  		} while (i++ < MAX_TRY_TIMES);
>  		/* If there's no response is received, clear command */
> -		if (i >= MAX_TRY_TIMES  ||
> -		    vf->cmd_retval != VIRTCHNL_STATUS_SUCCESS) {
> -			err = -1;
> +		if (i >= MAX_TRY_TIMES) {
>  			PMD_DRV_LOG(ERR, "No response or return failure (%d)"
>  				    " for cmd %d", vf->cmd_retval, args->ops);
>  			_clear_cmd(vf);
> +			err = -EIO;
> +		} else if (vf->cmd_retval == VIRTCHNL_STATUS_ERR_NOT_SUPPORTED) {
> +			PMD_DRV_LOG(ERR, "Cmd %d not supported", args->ops);
> +			err = -ENOTSUP;
> +		} else if (vf->cmd_retval != VIRTCHNL_STATUS_SUCCESS) {
> +			PMD_DRV_LOG(ERR, "Return failure %d for cmd %d",
> +				    vf->cmd_retval, args->ops);
> +			err = -EINVAL;
>  		}
>  		break;
>  	}
> @@ -1099,8 +1105,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


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

* Re: [dpdk-stable] [DPDK 20.11] net/iavf: fix error handling for unsupported promisc config
  2021-06-20 14:05 ` Xueming(Steven) Li
@ 2021-06-21  1:04   ` Zhang, Qi Z
  2021-06-21  1:11     ` Xueming(Steven) Li
  0 siblings, 1 reply; 4+ messages in thread
From: Zhang, Qi Z @ 2021-06-21  1:04 UTC (permalink / raw)
  To: Xueming(Steven) Li, bluca
  Cc: Zakharchenko, Vitaliy, Anantharam, Arjun, stable, Kwan, Ngai-mint

Hi Xueming

> -----Original Message-----
> From: Xueming(Steven) Li <xuemingl@nvidia.com>
> Sent: Sunday, June 20, 2021 10:05 PM
> To: Zhang, Qi Z <qi.z.zhang@intel.com>; bluca@debian.org
> Cc: Zakharchenko, Vitaliy <vitaliy.zakharchenko@intel.com>; Anantharam,
> Arjun <arjun.anantharam@intel.com>; stable@dpdk.org; Kwan, Ngai-mint
> <ngai-mint.kwan@intel.com>
> Subject: RE: [dpdk-stable] [DPDK 20.11] net/iavf: fix error handling for
> unsupported promisc config
> 
> Hi Qi,
> 
> Two upstream tag in this commit message, the first one not found in upstream
> branch, could you please check?

Yes, the commit log is not correct, it should be 50937e495f5bcc5985365b3b93e34b6efffeca10, will fix in v2.

> BTW, the patch can't be applied to 20.11 work queue branch, could you please
> rebase on latest version?
> 	https://github.com/steevenlee/dpdk/commits/20.11

Actually I found the second patch (0c35eecf) is already in your working queue, and the other one (50937e495) is merged in DPDK main repo with Cc stable, I assume it will be captured as well.
So I think you can just ignore this patch now :) sorry for the noise.

Thanks
Qi

> 
> Best Regards,
> Xueming
> 
> > -----Original Message-----
> > From: stable <stable-bounces@dpdk.org> On Behalf Of Qi Zhang
> > Sent: Friday, June 11, 2021 9:44 AM
> > To: bluca@debian.org
> > Cc: vitaliy.zakharchenko@intel.com; arjun.anantharam@intel.com;
> > stable@dpdk.org; Qi Zhang <qi.z.zhang@intel.com>; Ngai-mint Kwan
> > <ngai-mint.kwan@intel.com>
> > Subject: [dpdk-stable] [DPDK 20.11] net/iavf: fix error handling for
> > unsupported promisc config
> >
> > [ upstream commit 308f75b5c9cc5ca3e972dbc84375bdee353c3156 ] [
> > upstream commit 0c35eecfe8b54bbdf59c30a803404acfdcc4f7eb ]
> >
> > 1. The VIRTCHNL_STATUS_ERR_NOT_SUPPORTED should be esculated to
> upper
> >    with -ENOTSUP in iavf_execute_vf_cmd.
> > 2. fix error code check in iavf_config_promisc 3. change vf->cmd_ret_val
> from unsigned to signed as it will compare with
> >    negtive value.
> >
> > Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
> > Signed-off-by: Ngai-mint Kwan <ngai-mint.kwan@intel.com>
> > ---
> >  drivers/net/iavf/iavf.h       |  2 +-
> >  drivers/net/iavf/iavf_vchnl.c | 16 +++++++++++-----
> >  2 files changed, 12 insertions(+), 6 deletions(-)
> >
> > diff --git a/drivers/net/iavf/iavf.h b/drivers/net/iavf/iavf.h index
> > 0196f74721..4bcb407b20 100644
> > --- a/drivers/net/iavf/iavf.h
> > +++ b/drivers/net/iavf/iavf.h
> > @@ -136,7 +136,7 @@ struct iavf_info {
> >  	uint64_t supported_rxdid;
> >  	uint8_t *proto_xtr; /* proto xtr type for all queues */
> >  	volatile enum virtchnl_ops pend_cmd; /* pending command not finished
> */
> > -	uint32_t cmd_retval; /* return value of the cmd response from PF */
> > +	int cmd_retval; /* return value of the cmd response from PF */
> >  	uint8_t *aq_resp; /* buffer to store the adminq response from PF */
> >
> >  	/* Event from pf */
> > diff --git a/drivers/net/iavf/iavf_vchnl.c
> > b/drivers/net/iavf/iavf_vchnl.c index 3d52a8c402..219245d040 100644
> > --- a/drivers/net/iavf/iavf_vchnl.c
> > +++ b/drivers/net/iavf/iavf_vchnl.c
> > @@ -228,12 +228,18 @@ iavf_execute_vf_cmd(struct iavf_adapter
> *adapter, struct iavf_cmd_info *args)
> >  			/* If don't read msg or read sys event, continue */
> >  		} while (i++ < MAX_TRY_TIMES);
> >  		/* If there's no response is received, clear command */
> > -		if (i >= MAX_TRY_TIMES  ||
> > -		    vf->cmd_retval != VIRTCHNL_STATUS_SUCCESS) {
> > -			err = -1;
> > +		if (i >= MAX_TRY_TIMES) {
> >  			PMD_DRV_LOG(ERR, "No response or return failure (%d)"
> >  				    " for cmd %d", vf->cmd_retval, args->ops);
> >  			_clear_cmd(vf);
> > +			err = -EIO;
> > +		} else if (vf->cmd_retval ==
> VIRTCHNL_STATUS_ERR_NOT_SUPPORTED) {
> > +			PMD_DRV_LOG(ERR, "Cmd %d not supported", args->ops);
> > +			err = -ENOTSUP;
> > +		} else if (vf->cmd_retval != VIRTCHNL_STATUS_SUCCESS) {
> > +			PMD_DRV_LOG(ERR, "Return failure %d for cmd %d",
> > +				    vf->cmd_retval, args->ops);
> > +			err = -EINVAL;
> >  		}
> >  		break;
> >  	}
> > @@ -1099,8 +1105,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


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

* Re: [dpdk-stable] [DPDK 20.11] net/iavf: fix error handling for unsupported promisc config
  2021-06-21  1:04   ` Zhang, Qi Z
@ 2021-06-21  1:11     ` Xueming(Steven) Li
  0 siblings, 0 replies; 4+ messages in thread
From: Xueming(Steven) Li @ 2021-06-21  1:11 UTC (permalink / raw)
  To: Zhang, Qi Z, bluca
  Cc: Zakharchenko, Vitaliy, Anantharam, Arjun, stable, Kwan, Ngai-mint



> -----Original Message-----
> From: Zhang, Qi Z <qi.z.zhang@intel.com>
> Sent: Monday, June 21, 2021 9:04 AM
> To: Xueming(Steven) Li <xuemingl@nvidia.com>; bluca@debian.org
> Cc: Zakharchenko, Vitaliy <vitaliy.zakharchenko@intel.com>; Anantharam, Arjun <arjun.anantharam@intel.com>; stable@dpdk.org;
> Kwan, Ngai-mint <ngai-mint.kwan@intel.com>
> Subject: RE: [dpdk-stable] [DPDK 20.11] net/iavf: fix error handling for unsupported promisc config
> 
> Hi Xueming
> 
> > -----Original Message-----
> > From: Xueming(Steven) Li <xuemingl@nvidia.com>
> > Sent: Sunday, June 20, 2021 10:05 PM
> > To: Zhang, Qi Z <qi.z.zhang@intel.com>; bluca@debian.org
> > Cc: Zakharchenko, Vitaliy <vitaliy.zakharchenko@intel.com>;
> > Anantharam, Arjun <arjun.anantharam@intel.com>; stable@dpdk.org; Kwan,
> > Ngai-mint <ngai-mint.kwan@intel.com>
> > Subject: RE: [dpdk-stable] [DPDK 20.11] net/iavf: fix error handling
> > for unsupported promisc config
> >
> > Hi Qi,
> >
> > Two upstream tag in this commit message, the first one not found in
> > upstream branch, could you please check?
> 
> Yes, the commit log is not correct, it should be 50937e495f5bcc5985365b3b93e34b6efffeca10, will fix in v2.
> 
> > BTW, the patch can't be applied to 20.11 work queue branch, could you
> > please rebase on latest version?
> > 	https://github.com/steevenlee/dpdk/commits/20.11
> 
> Actually I found the second patch (0c35eecf) is already in your working queue, and the other one (50937e495) is merged in DPDK main
> repo with Cc stable, I assume it will be captured as well.
> So I think you can just ignore this patch now :) sorry for the noise.

NP, 50937e495 is merged after v21.05, so it will be collected into next LTS drop, i.e. 20.11.3.
20.11.2 includes fixes up to v21.05, send it manually if you want it in 20.11.2.

> 
> Thanks
> Qi
> 
> >
> > Best Regards,
> > Xueming
> >
> > > -----Original Message-----
> > > From: stable <stable-bounces@dpdk.org> On Behalf Of Qi Zhang
> > > Sent: Friday, June 11, 2021 9:44 AM
> > > To: bluca@debian.org
> > > Cc: vitaliy.zakharchenko@intel.com; arjun.anantharam@intel.com;
> > > stable@dpdk.org; Qi Zhang <qi.z.zhang@intel.com>; Ngai-mint Kwan
> > > <ngai-mint.kwan@intel.com>
> > > Subject: [dpdk-stable] [DPDK 20.11] net/iavf: fix error handling for
> > > unsupported promisc config
> > >
> > > [ upstream commit 308f75b5c9cc5ca3e972dbc84375bdee353c3156 ] [
> > > upstream commit 0c35eecfe8b54bbdf59c30a803404acfdcc4f7eb ]
> > >
> > > 1. The VIRTCHNL_STATUS_ERR_NOT_SUPPORTED should be esculated to
> > upper
> > >    with -ENOTSUP in iavf_execute_vf_cmd.
> > > 2. fix error code check in iavf_config_promisc 3. change
> > > vf->cmd_ret_val
> > from unsigned to signed as it will compare with
> > >    negtive value.
> > >
> > > Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
> > > Signed-off-by: Ngai-mint Kwan <ngai-mint.kwan@intel.com>
> > > ---
> > >  drivers/net/iavf/iavf.h       |  2 +-
> > >  drivers/net/iavf/iavf_vchnl.c | 16 +++++++++++-----
> > >  2 files changed, 12 insertions(+), 6 deletions(-)
> > >
> > > diff --git a/drivers/net/iavf/iavf.h b/drivers/net/iavf/iavf.h index
> > > 0196f74721..4bcb407b20 100644
> > > --- a/drivers/net/iavf/iavf.h
> > > +++ b/drivers/net/iavf/iavf.h
> > > @@ -136,7 +136,7 @@ struct iavf_info {
> > >  	uint64_t supported_rxdid;
> > >  	uint8_t *proto_xtr; /* proto xtr type for all queues */
> > >  	volatile enum virtchnl_ops pend_cmd; /* pending command not
> > > finished
> > */
> > > -	uint32_t cmd_retval; /* return value of the cmd response from PF */
> > > +	int cmd_retval; /* return value of the cmd response from PF */
> > >  	uint8_t *aq_resp; /* buffer to store the adminq response from PF
> > > */
> > >
> > >  	/* Event from pf */
> > > diff --git a/drivers/net/iavf/iavf_vchnl.c
> > > b/drivers/net/iavf/iavf_vchnl.c index 3d52a8c402..219245d040 100644
> > > --- a/drivers/net/iavf/iavf_vchnl.c
> > > +++ b/drivers/net/iavf/iavf_vchnl.c
> > > @@ -228,12 +228,18 @@ iavf_execute_vf_cmd(struct iavf_adapter
> > *adapter, struct iavf_cmd_info *args)
> > >  			/* If don't read msg or read sys event, continue */
> > >  		} while (i++ < MAX_TRY_TIMES);
> > >  		/* If there's no response is received, clear command */
> > > -		if (i >= MAX_TRY_TIMES  ||
> > > -		    vf->cmd_retval != VIRTCHNL_STATUS_SUCCESS) {
> > > -			err = -1;
> > > +		if (i >= MAX_TRY_TIMES) {
> > >  			PMD_DRV_LOG(ERR, "No response or return failure (%d)"
> > >  				    " for cmd %d", vf->cmd_retval, args->ops);
> > >  			_clear_cmd(vf);
> > > +			err = -EIO;
> > > +		} else if (vf->cmd_retval ==
> > VIRTCHNL_STATUS_ERR_NOT_SUPPORTED) {
> > > +			PMD_DRV_LOG(ERR, "Cmd %d not supported", args->ops);
> > > +			err = -ENOTSUP;
> > > +		} else if (vf->cmd_retval != VIRTCHNL_STATUS_SUCCESS) {
> > > +			PMD_DRV_LOG(ERR, "Return failure %d for cmd %d",
> > > +				    vf->cmd_retval, args->ops);
> > > +			err = -EINVAL;
> > >  		}
> > >  		break;
> > >  	}
> > > @@ -1099,8 +1105,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


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

end of thread, other threads:[~2021-06-21  1:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-11  1:43 [dpdk-stable] [DPDK 20.11] net/iavf: fix error handling for unsupported promisc config Qi Zhang
2021-06-20 14:05 ` Xueming(Steven) Li
2021-06-21  1:04   ` Zhang, Qi Z
2021-06-21  1:11     ` Xueming(Steven) Li

patches for DPDK stable branches

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/stable/0 stable/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 stable stable/ https://inbox.dpdk.org/stable \
		stable@dpdk.org
	public-inbox-index stable

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.stable


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git