From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id CB0CB1AFF6 for ; Thu, 7 Jun 2018 08:58:48 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Jun 2018 23:58:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,486,1520924400"; d="scan'208";a="206032131" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga004.jf.intel.com with ESMTP; 06 Jun 2018 23:58:32 -0700 Received: from fmsmsx113.amr.corp.intel.com (10.18.116.7) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 6 Jun 2018 23:58:20 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by FMSMSX113.amr.corp.intel.com (10.18.116.7) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 6 Jun 2018 23:58:19 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.82]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.116]) with mapi id 14.03.0319.002; Thu, 7 Jun 2018 14:58:08 +0800 From: "Xing, Beilei" To: "Li, Xiaoyun" , "Zhang, Qi Z" CC: "dev@dpdk.org" Thread-Topic: [PATCH] net/i40e: firmware status check Thread-Index: AQHT/V5BJzC5/5WrAEKW+bCZURgZEKRUWuVQ Date: Thu, 7 Jun 2018 06:58:07 +0000 Message-ID: <94479800C636CB44BD422CB454846E01321C67E0@SHSMSX101.ccr.corp.intel.com> References: <1528265807-59987-1-git-send-email-xiaoyun.li@intel.com> In-Reply-To: <1528265807-59987-1-git-send-email-xiaoyun.li@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] net/i40e: firmware status check X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 06:58:49 -0000 > -----Original Message----- > From: Li, Xiaoyun > Sent: Wednesday, June 6, 2018 2:17 PM > To: Xing, Beilei ; Zhang, Qi Z > Cc: dev@dpdk.org; Li, Xiaoyun > Subject: [PATCH] net/i40e: firmware status check >=20 > Check the firmware status at init time. If the status is abnormal, alert = the > user to exit DPDK. >=20 > Signed-off-by: Xiaoyun Li > --- > drivers/net/i40e/i40e_ethdev.c | 10 +++++++++- > 1 file changed, 9 insertions(+), 1 deletion(-) >=20 > diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethde= v.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 =3D 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 =3D 0; >=20 > 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 =3D pci_dev->addr.function; > hw->adapter_stopped =3D 0; >=20 > + val =3D 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 "pleas= e check if firmware is updating" and ?=20 > + return -EIO; Seems I/O error is not suitable for firmware status. How about EBUSY or som= ething else? > + } > + > /* Check if need to support multi-driver */ > i40e_support_multi_driver(dev); >=20 > -- > 2.7.4