From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 4674B58FE for ; Mon, 10 Dec 2018 09:27:26 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Dec 2018 00:27:25 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,337,1539673200"; d="scan'208";a="99455333" Received: from dpdk-server.sh.intel.com ([10.67.110.170]) by orsmga006.jf.intel.com with ESMTP; 10 Dec 2018 00:27:24 -0800 From: Zhirun Yan To: dev@dpdk.org, haiyue.wang@intel.com, qi.z.zhang@intel.com Cc: Zhirun Yan Date: Mon, 10 Dec 2018 16:04:46 +0000 Message-Id: <20181210160446.36825-1-zhirun.yan@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dpdk-dev] [PATCH v1] net/i40e: avoid invalid operations after reset 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: Mon, 10 Dec 2018 08:27:26 -0000 if reset but not reinit adminq, some operations in i40evf_dev_close() like i40evf_dev_promiscuous_disable() and i40evf_dev_allmulticast_disable() will result in failures. Fixes: cae18d2b0fb4 ("net/i40e: add workaround promiscuous disable") Signed-off-by: Zhirun Yan Signed-off-by: Haiyue Wang --- drivers/net/i40e/i40e_ethdev_vf.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c index ae55b9b18..a1f4a729f 100644 --- a/drivers/net/i40e/i40e_ethdev_vf.c +++ b/drivers/net/i40e/i40e_ethdev_vf.c @@ -2245,6 +2245,7 @@ static void i40evf_dev_close(struct rte_eth_dev *dev) { struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private); + struct i40e_vf *vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private); i40evf_dev_stop(dev); i40e_dev_free_queues(dev); @@ -2253,10 +2254,12 @@ i40evf_dev_close(struct rte_eth_dev *dev) * it is a workaround solution when work with kernel driver * and it is not the normal way */ - i40evf_dev_promiscuous_disable(dev); - i40evf_dev_allmulticast_disable(dev); + if (!vf->vf_reset) { + i40evf_dev_promiscuous_disable(dev); + i40evf_dev_allmulticast_disable(dev); + i40evf_reset_vf(hw); + } - i40evf_reset_vf(hw); i40e_shutdown_adminq(hw); i40evf_disable_irq0(hw); rte_eal_alarm_cancel(i40evf_dev_alarm_handler, dev); -- 2.17.1