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 D29287D14; Tue, 15 Aug 2017 07:26:53 +0200 (CEST) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP; 14 Aug 2017 22:26:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,376,1498546800"; d="scan'208";a="300184075" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by fmsmga004.fm.intel.com with ESMTP; 14 Aug 2017 22:26:52 -0700 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 14 Aug 2017 22:26:52 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.128]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.135]) with mapi id 14.03.0319.002; Tue, 15 Aug 2017 13:26:50 +0800 From: "Xing, Beilei" To: "Li, Xiaoyun" CC: "Wu, Jingjing" , "dev@dpdk.org" , "stable@dpdk.org" Thread-Topic: [PATCH] net/i40e: fix PF notify issue when VF is not up Thread-Index: AQHTFXdP6dOLIwhd3kWmI9WJZxo146KE32Iw Date: Tue, 15 Aug 2017 05:26:50 +0000 Message-ID: <94479800C636CB44BD422CB454846E0132004E78@SHSMSX101.ccr.corp.intel.com> References: <1502768028-187875-1-git-send-email-xiaoyun.li@intel.com> In-Reply-To: <1502768028-187875-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: fix PF notify issue when VF is not up 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: Tue, 15 Aug 2017 05:26:54 -0000 > -----Original Message----- > From: Li, Xiaoyun > Sent: Tuesday, August 15, 2017 11:34 AM > To: Xing, Beilei > Cc: Wu, Jingjing ; dev@dpdk.org; Li, Xiaoyun > ; stable@dpdk.org > Subject: [PATCH] net/i40e: fix PF notify issue when VF is not up >=20 > This patch stops PF from sending message to VF when VF's ARQ and ATQ isn'= t Abbreviation is not easy to understand, how about changing ARQ and ATQ with= admin queue? > enabled, namely VF isn't up 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 > --- > drivers/net/i40e/i40e_pf.c | 21 +++++++++++++++++++-- > 1 file changed, 19 insertions(+), 2 deletions(-) >=20 > diff --git a/drivers/net/i40e/i40e_pf.c b/drivers/net/i40e/i40e_pf.c inde= x > 100f8dc..c40f40a 100644 > --- a/drivers/net/i40e/i40e_pf.c > +++ b/drivers/net/i40e/i40e_pf.c > @@ -167,6 +167,9 @@ i40e_pf_host_vf_reset(struct i40e_pf_vf *vf, bool > do_hw_reset) > PMD_DRV_LOG(ERR, "VF reset timeout"); > return -ETIMEDOUT; > } > + > + vf->state =3D I40E_VF_ACTIVE; > + > /* This is not first time to do reset, do cleanup job first */ > if (vf->vsi) { > /* Disable queues */ > @@ -1224,8 +1227,22 @@ i40e_notify_vf_link_status(struct rte_eth_dev > *dev, struct i40e_pf_vf *vf) > break; > } >=20 > - i40e_pf_host_send_msg_to_vf(vf, VIRTCHNL_OP_EVENT, > - I40E_SUCCESS, (uint8_t *)&event, sizeof(event)); > + uint32_t tval, rval; > + uint16_t vf_id; > + struct i40e_hw *hw; Move the above variable up to the begin of the function. > + > + hw =3D I40E_PF_TO_HW(vf->pf); > + vf_id =3D vf->vf_idx; > + > + tval =3D I40E_READ_REG(hw, I40E_VF_ATQLEN(vf_id)); > + rval =3D I40E_READ_REG(hw, I40E_VF_ARQLEN(vf_id)); > + > + if (tval & I40E_VF_ATQLEN_ATQLEN_MASK || > + tval & I40E_VF_ATQLEN_ATQENABLE_MASK || > + rval & I40E_VF_ARQLEN_ARQLEN_MASK || > + rval & I40E_VF_ARQLEN_ARQENABLE_MASK) > + i40e_pf_host_send_msg_to_vf(vf, VIRTCHNL_OP_EVENT, > + I40E_SUCCESS, (uint8_t *)&event, sizeof(event)); > } >=20 > void > -- > 2.7.4