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 284FE912D; Fri, 28 Jul 2017 09:06:19 +0200 (CEST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga105.fm.intel.com with ESMTP; 28 Jul 2017 00:06:18 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,424,1496127600"; d="scan'208";a="1156297243" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga001.jf.intel.com with ESMTP; 28 Jul 2017 00:06:18 -0700 Received: from fmsmsx154.amr.corp.intel.com (10.18.116.70) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 28 Jul 2017 00:06:18 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by FMSMSX154.amr.corp.intel.com (10.18.116.70) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 28 Jul 2017 00:06:17 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.197]) by SHSMSX104.ccr.corp.intel.com ([10.239.4.70]) with mapi id 14.03.0319.002; Fri, 28 Jul 2017 15:06:16 +0800 From: "Li, Xiaoyun" To: "Wu, Jingjing" CC: "dev@dpdk.org" , "stable@dpdk.org" Thread-Topic: [PATCH v2] net/i40e: fix PF notify issue when VF not up Thread-Index: AQHTB1SvNOaKQqe180GwISa7ae5OGqJoR3IAgACHIYA= Date: Fri, 28 Jul 2017 07:06:15 +0000 Message-ID: References: <1500921763-115209-1-git-send-email-xiaoyun.li@intel.com> <1501241979-15767-1-git-send-email-xiaoyun.li@intel.com> <9BB6961774997848B5B42BEC655768F810DD77C3@SHSMSX103.ccr.corp.intel.com> In-Reply-To: <9BB6961774997848B5B42BEC655768F810DD77C3@SHSMSX103.ccr.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-ctpclassification: CTP_IC x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYjM3ZTE3MDAtZjU3MS00ZWM3LWE5ODctNTRiYWY1ZjU2N2VhIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6ImlhYTB6MEFvUlpSWDZqSGFsRHlwczFFRFwvaFBmVGRoSnljUm5jMGhyUmZZPSJ9 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 07:06:21 -0000 1. At first, I add vs state modification as follows, but it will show a war= ning when I check the patch. The warning says that usually the else after return or break would not be e= xecuted. if (i >=3D VFRESET_MAX_WAIT_CNT) { PMD_DRV_LOG(ERR, "VF reset timeout"); return -ETIMEDOUT; } else=20 vf->state =3D I40E_VF_ACTIVE; 2. Does it mean if vf state isn't inactive, the function will do "ret =3D = i40e_aq_send_msg_to_vf();" and following statements ? -----Original Message----- From: Wu, Jingjing=20 Sent: Friday, July 28, 2017 14:53 To: Li, Xiaoyun Cc: dev@dpdk.org; stable@dpdk.org Subject: RE: [PATCH v2] net/i40e: fix PF notify issue when VF not up > -----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=20 > 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=20 > 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