From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 77F74239 for ; Fri, 1 Mar 2019 12:53:29 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Mar 2019 03:53:28 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,427,1544515200"; d="scan'208";a="303556538" Received: from silpixa00398672.ir.intel.com (HELO silpixa00398672.ger.corp.intel.com) ([10.237.222.112]) by orsmga005.jf.intel.com with ESMTP; 01 Mar 2019 03:53:27 -0800 From: Reshma Pattan To: stable@dpdk.org Cc: Reshma Pattan Date: Fri, 1 Mar 2019 11:53:22 +0000 Message-Id: <20190301115323.32420-1-reshma.pattan@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dpdk-stable] [ PATCH 17.11 1/2] ethdev: clear ethdev data upon detach X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Mar 2019 11:53:29 -0000 When port is detached its relevant rte_eth_dev_data[port_id] has to be zeroed, otherwise the next port creations could get wrong port_id. Fixes: 92d94d3744 ("ethdev: attach or detach port") Signed-off-by: Reshma Pattan --- lib/librte_ether/rte_ethdev.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index 096b35faf..7ba9bc564 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -443,6 +443,7 @@ rte_eth_dev_detach(uint16_t port_id, char *name) goto err; rte_eth_devices[port_id].state = RTE_ETH_DEV_UNUSED; + memset(&rte_eth_dev_data[port_id], 0, sizeof(struct rte_eth_dev_data)); return 0; err: -- 2.17.1