From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by dpdk.org (Postfix) with ESMTP id A89A1237 for ; Tue, 21 Nov 2017 14:26:58 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 5C82B2094B; Tue, 21 Nov 2017 08:26:58 -0500 (EST) Received: from frontend2 ([10.202.2.161]) by compute1.internal (MEProxy); Tue, 21 Nov 2017 08:26:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fridaylinux.org; h=cc:date:from:in-reply-to:message-id:references:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=4r9XZtjLTXmzw54CE ST92b9o3FhcG2BZkamaWUbu+lQ=; b=P7+4jaXndeMC7e78XI0v+NYwdguKShn+B qD2VDrlrOehKcBijowVSmhN4vT73zNtom1s3Zg5APJfVdbzTyhhIhvvxmFKYTi9B LkrqxEq+0AJtmd5HlNxqXAkhBTVWHiUcZoB/8ulbi4GcqT0nFHdPtnEBfT4WwB2h 6WmuP7ra++Gao2wChE5NwNdYxCbg90wOqpqtS712W42ic/iyrKPTwJw65DcA0Fkn rAGjkk41TlvBpc+xmiIzWYQ4WCMsf3UwKfXFlvvOo1BU2cWW2UDZpyeO22EIe1iz WHiFvqlHsWw1UF1XSD9KqZFm4lp8/0NrK5iC0xTL72lX3XdDWEFng== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=4r9XZtjLTXmzw54CEST92b9o3FhcG2BZkamaWUbu+lQ=; b=SdEAd9Dz VXJDWcer9jNfL3y0mFUt/MdGxC4RukSWjABD8P/aoWkxbp+fto79SD/osFiH9qsD O+KPE4mLvXXdZTkt2ctfFxf95VIN0UCNjTYq4NqloxkXOiG6GeFGbbqgk9FcJHKV fWn+I8lVutuDRt2NMciWR1oiIl4HI41eSIiG6J4G6YdqD1VicDWG2b8DKDxNRbh4 D8yw+nGJqDYFZ44oTtICVo+p9qIEnZx+U1DyUhnBiBe4QfJlkSmKqjOTjS35PbfR C0+YsYWzF3HtvWqfgS2a82Tr5KFa5I8EJvjvTDBi2plEbYzZ71h4CNdxuno+Mf8u C+GoEaUzdcVqBw== X-ME-Sender: Received: from localhost.localdomain (unknown [180.158.62.0]) by mail.messagingengine.com (Postfix) with ESMTPA id 5A10124810; Tue, 21 Nov 2017 08:26:55 -0500 (EST) From: Yuanhan Liu To: Jingjing Wu Cc: dpdk stable Date: Tue, 21 Nov 2017 21:17:42 +0800 Message-Id: <1511270333-31002-120-git-send-email-yliu@fridaylinux.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1511270333-31002-1-git-send-email-yliu@fridaylinux.org> References: <1511270333-31002-1-git-send-email-yliu@fridaylinux.org> Subject: [dpdk-stable] patch 'net/i40e: fix VF initialization error' has been queued to stable release 17.08.1 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: Tue, 21 Nov 2017 13:26:58 -0000 Hi, FYI, your patch has been queued to stable release 17.08.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/24/17. So please shout if anyone has objections. Thanks. --yliu --- >>From d43e926baec2ff48caa5eb2c6e6f528d8b327e12 Mon Sep 17 00:00:00 2001 From: Jingjing Wu Date: Tue, 10 Oct 2017 06:08:30 +0800 Subject: [PATCH] net/i40e: fix VF initialization error [ upstream commit 8cacf78469a78b42557895ad1c2b40fbee864f53 ] In igb_uio, FLR is issued during open device file. i40evf is trying to initialize admin queue when driver probe, while the FLR is not done by host driver. That will cause initialization fail. This patch is adding the checking if VF reset is done before adimin queue initialization. Fixes: b58eedfc7dd5 ("igb_uio: issue FLR during open and release of device file") Signed-off-by: Jingjing Wu --- drivers/net/i40e/i40e_ethdev_vf.c | 44 ++++++++++++++++++++++++++------------- 1 file changed, 30 insertions(+), 14 deletions(-) diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c index 6933cc2..616829a 100644 --- a/drivers/net/i40e/i40e_ethdev_vf.c +++ b/drivers/net/i40e/i40e_ethdev_vf.c @@ -1241,10 +1241,30 @@ i40evf_enable_irq0(struct i40e_hw *hw) } static int -i40evf_reset_vf(struct i40e_hw *hw) +i40evf_check_vf_reset_done(struct i40e_hw *hw) { int i, reset; + for (i = 0; i < MAX_RESET_WAIT_CNT; i++) { + reset = I40E_READ_REG(hw, I40E_VFGEN_RSTAT) & + I40E_VFGEN_RSTAT_VFR_STATE_MASK; + reset = reset >> I40E_VFGEN_RSTAT_VFR_STATE_SHIFT; + if (reset == VIRTCHNL_VFR_VFACTIVE || + reset == VIRTCHNL_VFR_COMPLETED) + break; + rte_delay_ms(50); + } + + if (i >= MAX_RESET_WAIT_CNT) + return -1; + + return 0; +} +static int +i40evf_reset_vf(struct i40e_hw *hw) +{ + int ret; + if (i40e_vf_reset(hw) != I40E_SUCCESS) { PMD_INIT_LOG(ERR, "Reset VF NIC failed"); return -1; @@ -1260,19 +1280,10 @@ i40evf_reset_vf(struct i40e_hw *hw) */ rte_delay_ms(200); - for (i = 0; i < MAX_RESET_WAIT_CNT; i++) { - reset = rd32(hw, I40E_VFGEN_RSTAT) & - I40E_VFGEN_RSTAT_VFR_STATE_MASK; - reset = reset >> I40E_VFGEN_RSTAT_VFR_STATE_SHIFT; - if (VIRTCHNL_VFR_COMPLETED == reset || VIRTCHNL_VFR_VFACTIVE == reset) - break; - else - rte_delay_ms(50); - } - - if (i >= MAX_RESET_WAIT_CNT) { - PMD_INIT_LOG(ERR, "Reset VF NIC failed"); - return -1; + ret = i40evf_check_vf_reset_done(hw); + if (ret) { + PMD_INIT_LOG(ERR, "VF is still resetting"); + return ret; } return 0; @@ -1295,6 +1306,10 @@ i40evf_init_vf(struct rte_eth_dev *dev) goto err; } + err = i40evf_check_vf_reset_done(hw); + if (err) + goto err; + i40e_init_adminq_parameter(hw); err = i40e_init_adminq(hw); if (err) { @@ -1319,6 +1334,7 @@ i40evf_init_vf(struct rte_eth_dev *dev) PMD_INIT_LOG(ERR, "init_adminq failed"); goto err; } + vf->aq_resp = rte_zmalloc("vf_aq_resp", I40E_AQ_BUF_SZ, 0); if (!vf->aq_resp) { PMD_INIT_LOG(ERR, "unable to allocate vf_aq_resp memory"); -- 2.7.4