Subject: Re: [PATCH net 1/3] bnxt_en: Fix reporting of test result in ethtool selftest

From: Simon Horman <[email-masked]>
Date: Wed, 29 Mar 2023 15:08:01 +0200

On Tue, Mar 28, 2023 at 06:30:19PM -0700, Michael Chan wrote:
> From: Kalesh AP <[email-masked]>
> 
> When the selftest command fails, driver is not reporting the failure
> by updating the "test->flags" when bnxt_close_nic() fails.
> 
> Fixes: eb51365846bc ("bnxt_en: Add basic ethtool -t selftest support.")
> Reviewed-by: Pavan Chebbi <[email-masked]>
> Reviewed-by: Somnath Kotur <[email-masked]>
> Signed-off-by: Kalesh AP <[email-masked]>
> Signed-off-by: Michael Chan <[email-masked]>

Reviewed-by: Simon Horman <[email-masked]>

Note: I think this will require a manual backport to get
      all the way back to the above referenced commit (v4.12).
      I'm unsure if that will need to be addressed in practice.

> ---
>  drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
> index ec573127b707..7658a06b8d05 100644
> --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
> +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
> @@ -3738,6 +3738,7 @@ static void bnxt_self_test(struct net_device *dev, struct ethtool_test *etest,
>  		bnxt_ulp_stop(bp);
>  		rc = bnxt_close_nic(bp, true, false);
>  		if (rc) {
> +			etest->flags |= ETH_TEST_FL_FAILED;
>  			bnxt_ulp_start(bp, rc);
>  			return;
>  		}
> -- 
> 2.18.1
>