DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Xing, Beilei" <beilei.xing@intel.com>
To: "Li, Xiaoyun" <xiaoyun.li@intel.com>,
	"Zhang, Qi Z" <qi.z.zhang@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] net/i40e: firmware status check
Date: Thu, 7 Jun 2018 06:58:07 +0000	[thread overview]
Message-ID: <94479800C636CB44BD422CB454846E01321C67E0@SHSMSX101.ccr.corp.intel.com> (raw)
In-Reply-To: <1528265807-59987-1-git-send-email-xiaoyun.li@intel.com>



> -----Original Message-----
> From: Li, Xiaoyun
> Sent: Wednesday, June 6, 2018 2:17 PM
> To: Xing, Beilei <beilei.xing@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>
> Cc: dev@dpdk.org; Li, Xiaoyun <xiaoyun.li@intel.com>
> Subject: [PATCH] net/i40e: firmware status check
> 
> Check the firmware status at init time. If the status is abnormal, alert the
> user to exit DPDK.
> 
> Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
> ---
>  drivers/net/i40e/i40e_ethdev.c | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
> index 13c5d32..c1c19d3 100644
> --- a/drivers/net/i40e/i40e_ethdev.c
> +++ b/drivers/net/i40e/i40e_ethdev.c
> @@ -1192,7 +1192,7 @@ eth_i40e_dev_init(struct rte_eth_dev *dev, void
> *init_params __rte_unused)
>  	struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data-
> >dev_private);
>  	struct i40e_vsi *vsi;
>  	int ret;
> -	uint32_t len;
> +	uint32_t len, val;
>  	uint8_t aq_fail = 0;
> 
>  	PMD_INIT_FUNC_TRACE();
> @@ -1236,6 +1236,14 @@ eth_i40e_dev_init(struct rte_eth_dev *dev, void
> *init_params __rte_unused)
>  	hw->bus.func = pci_dev->addr.function;
>  	hw->adapter_stopped = 0;
> 
> +	val = I40E_READ_REG(hw, I40E_GL_FWSTS);
> +	if (val & I40E_GL_FWSTS_FWS1B_MASK) {
> +		PMD_INIT_LOG(ERR, "\nERROR:"
> +				  " Firmware status of this driver is
> abnormal."
> +				  " Please quit the app.");

"Please quit the app." can be replaced with some notice, for example "please check if firmware is updating" and ? 

> +		return -EIO;

Seems I/O error is not suitable for firmware status. How about EBUSY or something else?

> +	}
> +
>  	/* Check if need to support multi-driver */
>  	i40e_support_multi_driver(dev);
> 
> --
> 2.7.4

  reply	other threads:[~2018-06-07  6:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-06  6:16 Xiaoyun Li
2018-06-07  6:58 ` Xing, Beilei [this message]
2018-09-07 15:00 Xiaoyun Li

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=94479800C636CB44BD422CB454846E01321C67E0@SHSMSX101.ccr.corp.intel.com \
    --to=beilei.xing@intel.com \
    --cc=dev@dpdk.org \
    --cc=qi.z.zhang@intel.com \
    --cc=xiaoyun.li@intel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).