Re: [Accel-config] [PATCH v1 1/2] accel-config/test: fix batch result return logic error of sub-task fail

Dave Jiang <[email protected]> Wed, 19 Apr 2023 08:41:16 -0700
Newsgroups dev.linux.lists.accel-config
Message-ID <[email protected]>

On 4/19/23 12:23 AM, Tony Zhu wrote:
> It is not correct to return success when there is Sub-task failure. Even
> there is one Sub-task failure, the return should be not success.
> 
> Signed-off-by: Tony Zhu <[email protected]>
> ---
>   test/dsa.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/test/dsa.c b/test/dsa.c
> index da5d2e6..e9cc55a 100644
> --- a/test/dsa.c
> +++ b/test/dsa.c
> @@ -2257,9 +2257,9 @@ int batch_result_verify(struct batch_task *btsk, int bof, int cpfault)
>   			}
>   		} else {
>   			err("Sub-task[%d] failed with stat=%d", i, sub_stat);
> -			return ACCTEST_STATUS_FAIL;
> +			rc = ACCTEST_STATUS_FAIL;

I don't think this change above is necessary. You are directly returning 
failure when a sub-task failure is detected right? Otherwise you go to 
the next descriptor and ignore the failure.

>   		}
>   	}
>   
> -	return ACCTEST_STATUS_OK;
> +	return rc;
>   }