From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4AA05A04B5; Wed, 2 Sep 2020 02:57:20 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 523361C066; Wed, 2 Sep 2020 02:57:19 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id BE51B137D for ; Wed, 2 Sep 2020 02:57:17 +0200 (CEST) IronPort-SDR: +s+DAOHpuXpnlXtynr0leW6kgjVoSFA0U1QCFIUF2I3ZxTAMJldiTK7qgiWoxKz1jKahzEyESI QUsrNtz6aIJw== X-IronPort-AV: E=McAfee;i="6000,8403,9731"; a="144981141" X-IronPort-AV: E=Sophos;i="5.76,381,1592895600"; d="scan'208";a="144981141" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Sep 2020 17:57:16 -0700 IronPort-SDR: jLrMCe9oAZIZ5I3sRhW7jSmwKMeRYG3/CQXNI3ukjNfVJVaY7kjknjasJJvgqhYjIaJQMTIiha TIgv7n3Riswg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,381,1592895600"; d="scan'208";a="314938754" Received: from intel-npg-odc-srv01.cd.intel.com ([10.240.178.136]) by orsmga002.jf.intel.com with ESMTP; 01 Sep 2020 17:57:14 -0700 From: SteveX Yang To: dev@dpdk.org Cc: wei.zhao1@intel.com, jia.guo@intel.com, qiming.yang@intel.com, SteveX Yang Date: Wed, 2 Sep 2020 00:44:25 +0000 Message-Id: <20200902004425.33423-1-stevex.yang@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dpdk-dev] [PATCH] net/ixgbe: fix vf reset hw error handling 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The PF control message will interrupt the assigning MAC address for VF when PF physical link down, and the VF reset operation returns the IXGBE_ERR_INVALID_MAC_ADDR. In this case, reuses the MAC address from eth_ixgbevf_dev_init() directly, no need care of PF assignment. Fixes: f69166c9a3c9 ("net/ixgbe: fix reset error handling") Signed-off-by: SteveX Yang --- drivers/net/ixgbe/ixgbe_ethdev.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c index fd0cb9b0e..c2fa59c73 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -5326,10 +5326,17 @@ ixgbevf_dev_start(struct rte_eth_dev *dev) ixgbe_dev_wait_setup_link_complete(dev, 0); err = hw->mac.ops.reset_hw(hw); - if (err) { + + /* + * The VF reset operation returns the IXGBE_ERR_INVALID_MAC_ADDR when + * the underlying PF driver has not assigned a MAC address to the VF. + * In this case, reuses the MAC address from eth_ixgbevf_dev_init(). + */ + if (err != IXGBE_SUCCESS && err != IXGBE_ERR_INVALID_MAC_ADDR) { PMD_INIT_LOG(ERR, "Unable to reset vf hardware (%d)", err); return err; } + hw->mac.get_link_status = true; /* negotiate mailbox API version to use with the PF. */ -- 2.17.1