From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id E3BD8A0C4B for ; Wed, 14 Jul 2021 04:34:25 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D5AF3410FF; Wed, 14 Jul 2021 04:34:25 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id D57884003E; Wed, 14 Jul 2021 04:34:22 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10044"; a="197460034" X-IronPort-AV: E=Sophos;i="5.84,238,1620716400"; d="scan'208";a="197460034" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jul 2021 19:34:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.84,238,1620716400"; d="scan'208";a="505033053" Received: from dpdk-yyzhang2.sh.intel.com ([10.67.117.158]) by fmsmga002.fm.intel.com with ESMTP; 13 Jul 2021 19:34:19 -0700 From: Yuying Zhang To: dev@dpdk.org, xiaoyun.li@intel.com, qi.z.zhang@intel.com Cc: Yuying Zhang , stable@dpdk.org Date: Wed, 14 Jul 2021 02:20:27 +0000 Message-Id: <20210714022027.940655-1-yuying.zhang@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] [PATCH v1] app/testpmd: fix port MAC address after resetting port X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" MAC address of each port in global variable ports hasn't been updated after resetting. It was the initial one after resetting VF MAC address. This patch gets correct port MAC address when starting port. Fixes: a5279d25616d ("app/testpmd: check status of getting MAC address") Cc: stable@dpdk.org Signed-off-by: Yuying Zhang --- app/test-pmd/testpmd.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index 1cdd3cdd12..204e0d52cd 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -2456,7 +2456,6 @@ start_port(portid_t pid) int peer_pi; queueid_t qi; struct rte_port *port; - struct rte_ether_addr mac_addr; struct rte_eth_hairpin_cap cap; if (port_id_is_invalid(pid, ENABLED_WARN)) @@ -2627,11 +2626,14 @@ start_port(portid_t pid) RTE_PORT_HANDLING, RTE_PORT_STARTED) == 0) printf("Port %d can not be set into started\n", pi); - if (eth_macaddr_get_print_err(pi, &mac_addr) == 0) + if (eth_macaddr_get_print_err(pi, &port->eth_addr) == 0) printf("Port %d: %02X:%02X:%02X:%02X:%02X:%02X\n", pi, - mac_addr.addr_bytes[0], mac_addr.addr_bytes[1], - mac_addr.addr_bytes[2], mac_addr.addr_bytes[3], - mac_addr.addr_bytes[4], mac_addr.addr_bytes[5]); + port->eth_addr.addr_bytes[0], + port->eth_addr.addr_bytes[1], + port->eth_addr.addr_bytes[2], + port->eth_addr.addr_bytes[3], + port->eth_addr.addr_bytes[4], + port->eth_addr.addr_bytes[5]); /* at least one port started, need checking link status */ need_check_link_status = 1; -- 2.25.1