All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Xing, Beilei" <beilei.xing@intel.com>
To: "Zhang, AlvinX" <alvinx.zhang@intel.com>,
	"Wu, Jingjing" <jingjing.wu@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>, "stable@dpdk.org" <stable@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] net/iavf: fix PF returning error
Date: Sun, 25 Apr 2021 06:06:59 +0000	[thread overview]
Message-ID: <MN2PR11MB3807CE1385096BC6904852ABF7439@MN2PR11MB3807.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20210425050454.12324-1-alvinx.zhang@intel.com>



> -----Original Message-----
> From: Zhang, AlvinX <alvinx.zhang@intel.com>
> Sent: Sunday, April 25, 2021 1:05 PM
> To: Wu, Jingjing <jingjing.wu@intel.com>; Xing, Beilei <beilei.xing@intel.com>
> Cc: dev@dpdk.org; Zhang, AlvinX <alvinx.zhang@intel.com>; stable@dpdk.org
> Subject: [PATCH] net/iavf: fix PF returning error
> 
> When the command sent by VF to PF fails, iavf may need to run different code
> paths according to the specific reason of the failure (not supported or other
> reasons).
> 
> This patch adds support of identifying PF return error type.
> 
> Fixes: 22b123a36d07 ("net/avf: initialize PMD")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
> ---
>  drivers/net/iavf/iavf_vchnl.c | 18 ++++++++++++------
>  1 file changed, 12 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.c index
> 45096cb..6586fc3 100644
> --- a/drivers/net/iavf/iavf_vchnl.c
> +++ b/drivers/net/iavf/iavf_vchnl.c
> @@ -228,13 +228,19 @@
>  			rte_delay_ms(ASQ_DELAY_MS);
>  			/* 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;
> -			PMD_DRV_LOG(ERR, "No response or return failure
> (%d)"
> -				    " for cmd %d", vf->cmd_retval, args->ops);
> +
> +		if (i >= MAX_TRY_TIMES) {
> +			PMD_DRV_LOG(ERR, "No response for cmd %d", args-
> >ops);
>  			_clear_cmd(vf);
> +			err = -EIO;
> +		} else if (vf->cmd_retval ==
> +			   (uint32_t)VIRTCHNL_STATUS_ERR_NOT_SUPPORTED)

Can we change 'uint32_t cmd_retval' to 'enum virtchnl_status_code cmd_retval' in iavf_info structure? Then we needn't cast here.

> {
> +			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;
>  	}
> --
> 1.8.3.1


  reply	other threads:[~2021-04-25  6:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-25  5:04 [dpdk-dev] [PATCH] net/iavf: fix PF returning error Alvin Zhang
2021-04-25  6:06 ` Xing, Beilei [this message]
2021-04-25  7:39 ` [dpdk-dev] [PATCH v2] " Alvin Zhang
2021-04-26  1:34   ` Xing, Beilei
2021-04-26  4:43     ` Zhang, Qi Z

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=MN2PR11MB3807CE1385096BC6904852ABF7439@MN2PR11MB3807.namprd11.prod.outlook.com \
    --to=beilei.xing@intel.com \
    --cc=alvinx.zhang@intel.com \
    --cc=dev@dpdk.org \
    --cc=jingjing.wu@intel.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.