From mboxrd@z Thu Jan 1 00:00:00 1970 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=1065; q=dns/txt; s=iport; t=1484851660; x=1486061260; h=from:to:cc:subject:date:message-id; bh=6TyomK0Wb5NG7uFMyvJbYKDbac3RAFFSMimVVrlC76Q=; b=hbMdvqNZeXuglop5CU5bARstdk4/kuaVoYzro2cPk9qlW00Q/BqQ6OwW +hjY2d7BsUquRmvcyBX9XSDA9ZAqjHaUMvmxA5EoOTZpTPZ+oV9RthCo0 O5sfKAfsY+aFMFFiYoaiLwu0JIus+b7u/xShR8no0kkdmN1txMp2XJLt6 c=; X-IronPort-AV: E=Sophos;i="5.33,255,1477958400"; d="scan'208";a="197192612" Received: from rcdn-core-6.cisco.com ([173.37.93.157]) by rcdn-iport-4.cisco.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Jan 2017 18:47:39 +0000 Received: from sjc-ads-512.cisco.com (sjc-ads-512.cisco.com [10.28.13.212]) by rcdn-core-6.cisco.com (8.14.5/8.14.5) with ESMTP id v0JIldJo013543 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 19 Jan 2017 18:47:39 GMT Received: from sjc-ads-512.cisco.com (localhost.localdomain [127.0.0.1]) by sjc-ads-512.cisco.com (8.13.8/8.13.8) with ESMTP id v0JIldrW022457; Thu, 19 Jan 2017 10:47:39 -0800 Received: (from jonshin@localhost) by sjc-ads-512.cisco.com (8.13.8/8.13.8/Submit) id v0JIldqI022456; Thu, 19 Jan 2017 10:47:39 -0800 From: Steve Shin To: dev@dpdk.org Cc: ferruh.yigit@intel.com, Steve Shin Date: Thu, 19 Jan 2017 10:47:21 -0800 Message-Id: <20170119184721.22348-1-jonshin@cisco.com> X-Mailer: git-send-email 2.9.3 Subject: [dpdk-dev] [PATCH] lib/librte_ether: error handling on MAC address replay 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: Thu, 19 Jan 2017 18:47:41 -0000 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