From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 81C0369C6; Tue, 17 Jan 2017 03:28:50 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga102.fm.intel.com with ESMTP; 16 Jan 2017 18:28:50 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,242,1477983600"; d="scan'208";a="1083776947" Received: from dpdk26.sh.intel.com ([10.239.128.228]) by orsmga001.jf.intel.com with ESMTP; 16 Jan 2017 18:28:49 -0800 From: Wenzhuo Lu To: dev@dpdk.org Cc: Qi Zhang , stable@dpdk.org Date: Tue, 17 Jan 2017 10:28:19 +0800 Message-Id: <1484620116-70813-10-git-send-email-wenzhuo.lu@intel.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1484620116-70813-1-git-send-email-wenzhuo.lu@intel.com> References: <1480637533-37425-1-git-send-email-wenzhuo.lu@intel.com> <1484620116-70813-1-git-send-email-wenzhuo.lu@intel.com> Subject: [dpdk-dev] [PATCH v11 09/26] net/i40e: fix VF reset flow 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, 17 Jan 2017 02:28:51 -0000 From: Qi Zhang Add missing step during VF reset: PF should set I40E_VFGEN_RSTAT to ACTIVE at end of the VF reset operation or VF driver may not able to detect that reset is already completed. This patch also remove the unnecessary enum for vfr state. Fixes: 4861cde46116 ("i40e: new poll mode driver") CC: stable@dpdk.org Signed-off-by: Qi Zhang --- drivers/net/i40e/i40e_pf.c | 6 ++++-- drivers/net/i40e/i40e_pf.h | 5 ----- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/net/i40e/i40e_pf.c b/drivers/net/i40e/i40e_pf.c index 5c58424..8a6733c 100644 --- a/drivers/net/i40e/i40e_pf.c +++ b/drivers/net/i40e/i40e_pf.c @@ -139,7 +139,7 @@ abs_vf_id = vf_id + hw->func_caps.vf_base_id; /* Notify VF that we are in VFR progress */ - I40E_WRITE_REG(hw, I40E_VFGEN_RSTAT1(vf_id), I40E_PF_VFR_INPROGRESS); + I40E_WRITE_REG(hw, I40E_VFGEN_RSTAT1(vf_id), I40E_VFR_INPROGRESS); /* * If require a SW VF reset, a VFLR interrupt will be generated, @@ -220,7 +220,7 @@ } /* Reset done, Set COMPLETE flag and clear reset bit */ - I40E_WRITE_REG(hw, I40E_VFGEN_RSTAT1(vf_id), I40E_PF_VFR_COMPLETED); + I40E_WRITE_REG(hw, I40E_VFGEN_RSTAT1(vf_id), I40E_VFR_COMPLETED); val = I40E_READ_REG(hw, I40E_VPGEN_VFRTRIG(vf_id)); val &= ~I40E_VPGEN_VFRTRIG_VFSWR_MASK; I40E_WRITE_REG(hw, I40E_VPGEN_VFRTRIG(vf_id), val); @@ -248,6 +248,8 @@ return -EFAULT; } + I40E_WRITE_REG(hw, I40E_VFGEN_RSTAT1(vf_id), I40E_VFR_VFACTIVE); + return ret; } diff --git a/drivers/net/i40e/i40e_pf.h b/drivers/net/i40e/i40e_pf.h index 47a9c34..b4c2287 100644 --- a/drivers/net/i40e/i40e_pf.h +++ b/drivers/net/i40e/i40e_pf.h @@ -48,11 +48,6 @@ #define I40E_DPDK_OFFSET 0x100 -enum i40e_pf_vfr_state { - I40E_PF_VFR_INPROGRESS = 0, - I40E_PF_VFR_COMPLETED = 1, -}; - /* DPDK pf driver specific command to VF */ enum i40e_virtchnl_ops_dpdk { /* -- 1.9.3