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 17B21A04AA; Tue, 8 Sep 2020 05:20:11 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EE2B21C196; Tue, 8 Sep 2020 05:20:10 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 30A051C133 for ; Tue, 8 Sep 2020 05:20:10 +0200 (CEST) IronPort-SDR: o9UySqC39ZolX8R9XBsirKmL6SD2q0n7pmW0Gc6T/2m+zHgS4ZvGDCtDYAqRaekpDE5hf/7kiZ qP9O0cQqhRpQ== X-IronPort-AV: E=McAfee;i="6000,8403,9737"; a="155467233" X-IronPort-AV: E=Sophos;i="5.76,404,1592895600"; d="scan'208";a="155467233" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Sep 2020 20:20:09 -0700 IronPort-SDR: iJ2OgQokbSDfL4g4ExCGWknavL24/POJrfKnlkiNV8ZfZkXfJZtXFulguYheSl5ba6cyD16Uv+ CzpRcSYktWrg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,404,1592895600"; d="scan'208";a="336253944" Received: from intel-npg-odc-srv01.cd.intel.com ([10.240.178.136]) by fmsmga002.fm.intel.com with ESMTP; 07 Sep 2020 20:20:07 -0700 From: SteveX Yang To: dev@dpdk.org Cc: wei.zhao1@intel.com, jia.guo@intel.com, qiming.yang@intel.com, SteveX Yang Date: Tue, 8 Sep 2020 03:17:05 +0000 Message-Id: <20200908031705.14496-1-stevex.yang@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200902004425.33423-1-stevex.yang@intel.com> References: <20200902004425.33423-1-stevex.yang@intel.com> Subject: [dpdk-dev] [PATCH v2] 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, reuse the MAC address when device initialization insteads of waiting PF reassign. Fixes: f69166c9a3c9 ("net/ixgbe: fix reset error handling") Signed-off-by: SteveX Yang --- v2: update comment. --- 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