From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id AFBC09139; Fri, 28 Jul 2017 08:52:47 +0200 (CEST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga105.fm.intel.com with ESMTP; 27 Jul 2017 23:52:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,424,1496127600"; d="scan'208";a="998139382" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga003.jf.intel.com with ESMTP; 27 Jul 2017 23:52:45 -0700 Received: from fmsmsx157.amr.corp.intel.com (10.18.116.73) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 27 Jul 2017 23:52:45 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by FMSMSX157.amr.corp.intel.com (10.18.116.73) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 27 Jul 2017 23:52:44 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.116]) by SHSMSX104.ccr.corp.intel.com ([10.239.4.70]) with mapi id 14.03.0319.002; Fri, 28 Jul 2017 14:52:43 +0800 From: "Wu, Jingjing" To: "Li, Xiaoyun" CC: "dev@dpdk.org" , "stable@dpdk.org" Thread-Topic: [PATCH v2] net/i40e: fix PF notify issue when VF not up Thread-Index: AQHTB1Sv52GY0/WpHki9qiaCSSqoD6JozLlA Date: Fri, 28 Jul 2017 06:52:42 +0000 Message-ID: <9BB6961774997848B5B42BEC655768F810DD77C3@SHSMSX103.ccr.corp.intel.com> References: <1500921763-115209-1-git-send-email-xiaoyun.li@intel.com> <1501241979-15767-1-git-send-email-xiaoyun.li@intel.com> In-Reply-To: <1501241979-15767-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-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYjM3ZTE3MDAtZjU3MS00ZWM3LWE5ODctNTRiYWY1ZjU2N2VhIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6ImlhYTB6MEFvUlpSWDZqSGFsRHlwczFFRFwvaFBmVGRoSnljUm5jMGhyUmZZPSJ9 x-ctpclassification: CTP_IC dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action 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-stable] [PATCH v2] net/i40e: fix PF notify issue when VF not up X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jul 2017 06:52:49 -0000 > -----Original Message----- > From: Li, Xiaoyun > Sent: Friday, July 28, 2017 7:40 PM > To: Wu, Jingjing > Cc: dev@dpdk.org; Li, Xiaoyun ; stable@dpdk.org > Subject: [PATCH v2] net/i40e: fix PF notify issue when VF not up >=20 > This patch modifies PF notify error to warning when not starting > up VF and modifies VF state to active when VF reset is completed. >=20 > Fixes: 4861cde46116 ("i40e: new poll mode driver") > Cc: stable@dpdk.org >=20 > Signed-off-by: Xiaoyun Li > --- > v2 changes: > * add VF state modification when VF reset is done. > --- > drivers/net/i40e/i40e_pf.c | 33 +++++++++++++++++++-------------- > 1 file changed, 19 insertions(+), 14 deletions(-) >=20 > diff --git a/drivers/net/i40e/i40e_pf.c b/drivers/net/i40e/i40e_pf.c > index b4cf57f..5d5d24a 100644 > --- a/drivers/net/i40e/i40e_pf.c > +++ b/drivers/net/i40e/i40e_pf.c > @@ -152,22 +152,23 @@ i40e_pf_host_vf_reset(struct i40e_pf_vf *vf, bool d= o_hw_reset) > val |=3D I40E_VPGEN_VFRTRIG_VFSWR_MASK; > I40E_WRITE_REG(hw, I40E_VPGEN_VFRTRIG(vf_id), val); > I40E_WRITE_FLUSH(hw); > - } >=20 > #define VFRESET_MAX_WAIT_CNT 100 > - /* Wait until VF reset is done */ > - for (i =3D 0; i < VFRESET_MAX_WAIT_CNT; i++) { > - rte_delay_us(10); > - val =3D I40E_READ_REG(hw, I40E_VPGEN_VFRSTAT(vf_id)); > - if (val & I40E_VPGEN_VFRSTAT_VFRD_MASK) > - break; > - } > + /* Wait until VF reset is done */ > + for (i =3D 0; i < VFRESET_MAX_WAIT_CNT; i++) { > + rte_delay_us(10); > + val =3D I40E_READ_REG(hw, I40E_VPGEN_VFRSTAT(vf_id)); > + if (val & I40E_VPGEN_VFRSTAT_VFRD_MASK) { > + vf->state =3D I40E_VF_ACTIVE; > + break; > + } > + } >=20 > - if (i >=3D VFRESET_MAX_WAIT_CNT) { > - PMD_DRV_LOG(ERR, "VF reset timeout"); > - return -ETIMEDOUT; > + if (i >=3D VFRESET_MAX_WAIT_CNT) { > + PMD_DRV_LOG(ERR, "VF reset timeout"); > + return -ETIMEDOUT; > + } It's much clearer to add "vf->state =3D I40E_VF_ACTIVE;" here but not above= . > } > - > /* This is not first time to do reset, do cleanup job first */ > if (vf->vsi) { > /* Disable queues */ > @@ -267,8 +268,12 @@ i40e_pf_host_send_msg_to_vf(struct i40e_pf_vf *vf, > ret =3D i40e_aq_send_msg_to_vf(hw, abs_vf_id, opcode, retval, > msg, msglen, NULL); > if (ret) { > - PMD_INIT_LOG(ERR, "Fail to send message to VF, err %u", > - hw->aq.asq_last_status); > + if (vf->state =3D=3D I40E_VF_INACTIVE) > + PMD_DRV_LOG(WARNING, "Warning! VF %u is inactive now!", > + abs_vf_id); How about just don't send msg to inactive VF but not print warning? > + else > + PMD_INIT_LOG(ERR, "Fail to send message to VF, err %u", > + hw->aq.asq_last_status); > } >=20 > return ret; > -- > 2.7.4