From mboxrd@z Thu Jan 1 00:00:00 1970 From: Steve Shin Subject: [PATCH] lib/librte_ether: error handling on MAC address replay Date: Thu, 19 Jan 2017 10:47:21 -0800 Message-ID: <20170119184721.22348-1-jonshin@cisco.com> Cc: ferruh.yigit@intel.com, Steve Shin To: dev@dpdk.org Return-path: Received: from rcdn-iport-4.cisco.com (rcdn-iport-4.cisco.com [173.37.86.75]) by dpdk.org (Postfix) with ESMTP id D4DC0FA5A for ; Thu, 19 Jan 2017 19:47:40 +0100 (CET) List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" This patch fixes a bug in replaying MAC address to the hardware in rte_eth_dev_config_restore() routine. Signed-off-by: Steve Shin --- lib/librte_ether/rte_ethdev.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index 4790faf..7e01f10 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -951,10 +951,12 @@ rte_eth_dev_config_restore(uint8_t port_id) continue; /* add address to the hardware */ - if (*dev->dev_ops->mac_addr_add && - (dev->data->mac_pool_sel[i] & (1ULL << pool))) - (*dev->dev_ops->mac_addr_add)(dev, &addr, i, pool); - else { + if (*dev->dev_ops->mac_addr_add) { + if (dev->data->mac_pool_sel[i] & (1ULL << pool)) + (*dev->dev_ops->mac_addr_add)(dev, &addr, i, pool); + else + continue; + } else { RTE_PMD_DEBUG_TRACE("port %d: MAC address array not supported\n", port_id); /* exit the loop but not return an error */ -- 2.9.3