* [dpdk-dev] [PATCH] net/i40e: firmware status check
@ 2018-06-06 6:16 Xiaoyun Li
2018-06-07 6:58 ` Xing, Beilei
0 siblings, 1 reply; 3+ messages in thread
From: Xiaoyun Li @ 2018-06-06 6:16 UTC (permalink / raw)
To: beilei.xing, qi.z.zhang; +Cc: dev, Xiaoyun Li
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.");
+ return -EIO;
+ }
+
/* Check if need to support multi-driver */
i40e_support_multi_driver(dev);
--
2.7.4
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dpdk-dev] [PATCH] net/i40e: firmware status check
2018-06-06 6:16 [dpdk-dev] [PATCH] net/i40e: firmware status check Xiaoyun Li
@ 2018-06-07 6:58 ` Xing, Beilei
0 siblings, 0 replies; 3+ messages in thread
From: Xing, Beilei @ 2018-06-07 6:58 UTC (permalink / raw)
To: Li, Xiaoyun, Zhang, Qi Z; +Cc: dev
> -----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
^ permalink raw reply [flat|nested] 3+ messages in thread
* [dpdk-dev] [PATCH] net/i40e: firmware status check
@ 2018-09-07 15:00 Xiaoyun Li
0 siblings, 0 replies; 3+ messages in thread
From: Xiaoyun Li @ 2018-09-07 15:00 UTC (permalink / raw)
To: beilei.xing, qi.z.zhang, dev, helin.zhang, jingjing.wu; +Cc: Xiaoyun Li
Check the firmware status at init time. If the firmware is in
recovery mode, alert the user to check it.
Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
---
drivers/net/i40e/i40e_ethdev.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 85a6a86..30cec47 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -1210,7 +1210,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();
@@ -1261,6 +1261,15 @@ eth_i40e_dev_init(struct rte_eth_dev *dev, void *init_params __rte_unused)
*/
hw->switch_tag = 0xffff;
+ val = I40E_READ_REG(hw, I40E_GL_FWSTS);
+ if (val & I40E_GL_FWSTS_FWS1B_MASK) {
+ PMD_INIT_LOG(ERR, "\nERROR: "
+ "Firmware recovery mode detected. Limiting functionality.\n"
+ "Refer to the Intel(R) Ethernet Adapters and Devices "
+ "User Guide for details on firmware recovery mode.");
+ return -EIO;
+ }
+
/* Check if need to support multi-driver */
i40e_support_multi_driver(dev);
--
2.7.4
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-09-07 15:15 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-06 6:16 [dpdk-dev] [PATCH] net/i40e: firmware status check Xiaoyun Li
2018-06-07 6:58 ` Xing, Beilei
2018-09-07 15:00 Xiaoyun Li
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).