net/ice: Modify DCF state checking mechanism and error code

Message ID 20220505153932.401749-1-peng1x.zhang@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Qi Zhang
Headers
Series net/ice: Modify DCF state checking mechanism and error code |

Checks

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

Commit Message

Zhang, Peng1X May 5, 2022, 3:39 p.m. UTC
  From: Peng Zhang <peng1x.zhang@intel.com>

Add DCF state checking mechanism which will conduct whether reset is
done.And modify error code to avoid misleading.

Fixes: b71573ec2fc2 ("net/ice: retry getting VF VSI map after failure")
Cc: stable@dpdk.org

Signed-off-by: Peng Zhang <peng1x.zhang@intel.com>
---
 drivers/net/ice/ice_dcf.c           | 3 ++-
 drivers/net/ice/ice_switch_filter.c | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)
  

Comments

Qi Zhang May 7, 2022, 7:10 a.m. UTC | #1
> -----Original Message-----
> From: Zhang, Peng1X <peng1x.zhang@intel.com>
> Sent: Thursday, May 5, 2022 11:40 PM
> To: Yang, Qiming <qiming.yang@intel.com>; Zhang, Qi Z
> <qi.z.zhang@intel.com>; Zhou, YidingX <yidingx.zhou@intel.com>;
> dev@dpdk.org
> Cc: Zhang, Peng1X <peng1x.zhang@intel.com>; stable@dpdk.org
> Subject: [PATCH] net/ice: Modify DCF state checking mechanism and error
> code
> 
> From: Peng Zhang <peng1x.zhang@intel.com>
> 
> Add DCF state checking mechanism which will conduct whether reset is
> done.And modify error code to avoid misleading.
> 
> Fixes: b71573ec2fc2 ("net/ice: retry getting VF VSI map after failure")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Peng Zhang <peng1x.zhang@intel.com>
> ---
>  drivers/net/ice/ice_dcf.c           | 3 ++-
>  drivers/net/ice/ice_switch_filter.c | 2 +-
>  2 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ice/ice_dcf.c b/drivers/net/ice/ice_dcf.c index
> 7f0c074b01..3808272ea3 100644
> --- a/drivers/net/ice/ice_dcf.c
> +++ b/drivers/net/ice/ice_dcf.c
> @@ -544,7 +544,8 @@ ice_dcf_handle_vsi_update_event(struct ice_dcf_hw
> *hw)
> 
>  	for (;;) {
>  		if (ice_dcf_get_vf_resource(hw) == 0 &&
> -		    ice_dcf_get_vf_vsi_map(hw) >= 0) {
> +		    ice_dcf_get_vf_vsi_map(hw) >= 0 &&
> +		    ice_dcf_check_reset_done(hw) == 0) {
>  			err = 0;
>  			break;
>  		}
> diff --git a/drivers/net/ice/ice_switch_filter.c
> b/drivers/net/ice/ice_switch_filter.c
> index 36c9bffb73..199a981018 100644
> --- a/drivers/net/ice/ice_switch_filter.c
> +++ b/drivers/net/ice/ice_switch_filter.c
> @@ -434,7 +434,7 @@ ice_switch_create(struct ice_adapter *ad,
>  		flow->rule = filter_conf_ptr;
>  	} else {
>  		if (ice_dcf_adminq_need_retry(ad))
> -			ret = -EAGAIN;
> +			ret = -EBUSY;

what's wrong with -EAGAIN? Is it necessary?

>  		else
>  			ret = -EINVAL;
> 
> --
> 2.25.1
  
Zhang, Peng1X May 7, 2022, 7:29 a.m. UTC | #2
Hi Qi,
   The Aim of change error code from EAGAIN to EBUSY is to mention user as reporter wished ' something more along the lines of device being busy '. 
Br,
Peng

> -----Original Message-----
> From: Zhang, Qi Z <qi.z.zhang@intel.com>
> Sent: Saturday, May 7, 2022 3:10 PM
> To: Zhang, Peng1X <peng1x.zhang@intel.com>; Yang, Qiming
> <qiming.yang@intel.com>; Zhou, YidingX <yidingx.zhou@intel.com>;
> dev@dpdk.org
> Cc: stable@dpdk.org
> Subject: RE: [PATCH] net/ice: Modify DCF state checking mechanism and error
> code
> 
> 
> 
> > -----Original Message-----
> > From: Zhang, Peng1X <peng1x.zhang@intel.com>
> > Sent: Thursday, May 5, 2022 11:40 PM
> > To: Yang, Qiming <qiming.yang@intel.com>; Zhang, Qi Z
> > <qi.z.zhang@intel.com>; Zhou, YidingX <yidingx.zhou@intel.com>;
> > dev@dpdk.org
> > Cc: Zhang, Peng1X <peng1x.zhang@intel.com>; stable@dpdk.org
> > Subject: [PATCH] net/ice: Modify DCF state checking mechanism and
> > error code
> >
> > From: Peng Zhang <peng1x.zhang@intel.com>
> >
> > Add DCF state checking mechanism which will conduct whether reset is
> > done.And modify error code to avoid misleading.
> >
> > Fixes: b71573ec2fc2 ("net/ice: retry getting VF VSI map after
> > failure")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Peng Zhang <peng1x.zhang@intel.com>
> > ---
> >  drivers/net/ice/ice_dcf.c           | 3 ++-
> >  drivers/net/ice/ice_switch_filter.c | 2 +-
> >  2 files changed, 3 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/net/ice/ice_dcf.c b/drivers/net/ice/ice_dcf.c
> > index
> > 7f0c074b01..3808272ea3 100644
> > --- a/drivers/net/ice/ice_dcf.c
> > +++ b/drivers/net/ice/ice_dcf.c
> > @@ -544,7 +544,8 @@ ice_dcf_handle_vsi_update_event(struct ice_dcf_hw
> > *hw)
> >
> >  for (;;) {
> >  if (ice_dcf_get_vf_resource(hw) == 0 &&
> > -    ice_dcf_get_vf_vsi_map(hw) >= 0) {
> > +    ice_dcf_get_vf_vsi_map(hw) >= 0 &&
> > +    ice_dcf_check_reset_done(hw) == 0) {
> >  err = 0;
> >  break;
> >  }
> > diff --git a/drivers/net/ice/ice_switch_filter.c
> > b/drivers/net/ice/ice_switch_filter.c
> > index 36c9bffb73..199a981018 100644
> > --- a/drivers/net/ice/ice_switch_filter.c
> > +++ b/drivers/net/ice/ice_switch_filter.c
> > @@ -434,7 +434,7 @@ ice_switch_create(struct ice_adapter *ad,
> > flow->rule = filter_conf_ptr;  } else {  if
> > (ice_dcf_adminq_need_retry(ad)) -ret = -EAGAIN;
> > +ret = -EBUSY;
> 
> what's wrong with -EAGAIN? Is it necessary?
> 
> >  else
> >  ret = -EINVAL;
> >
> > --
> > 2.25.1
>
  

Patch

diff --git a/drivers/net/ice/ice_dcf.c b/drivers/net/ice/ice_dcf.c
index 7f0c074b01..3808272ea3 100644
--- a/drivers/net/ice/ice_dcf.c
+++ b/drivers/net/ice/ice_dcf.c
@@ -544,7 +544,8 @@  ice_dcf_handle_vsi_update_event(struct ice_dcf_hw *hw)
 
 	for (;;) {
 		if (ice_dcf_get_vf_resource(hw) == 0 &&
-		    ice_dcf_get_vf_vsi_map(hw) >= 0) {
+		    ice_dcf_get_vf_vsi_map(hw) >= 0 &&
+		    ice_dcf_check_reset_done(hw) == 0) {
 			err = 0;
 			break;
 		}
diff --git a/drivers/net/ice/ice_switch_filter.c b/drivers/net/ice/ice_switch_filter.c
index 36c9bffb73..199a981018 100644
--- a/drivers/net/ice/ice_switch_filter.c
+++ b/drivers/net/ice/ice_switch_filter.c
@@ -434,7 +434,7 @@  ice_switch_create(struct ice_adapter *ad,
 		flow->rule = filter_conf_ptr;
 	} else {
 		if (ice_dcf_adminq_need_retry(ad))
-			ret = -EAGAIN;
+			ret = -EBUSY;
 		else
 			ret = -EINVAL;