From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by dpdk.org (Postfix) with ESMTP id 6039D2C57 for ; Thu, 1 Feb 2018 10:49:42 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 1606720CBE; Thu, 1 Feb 2018 04:49:42 -0500 (EST) Received: from frontend2 ([10.202.2.161]) by compute1.internal (MEProxy); Thu, 01 Feb 2018 04:49:42 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fridaylinux.org; h=cc:date:from:in-reply-to:message-id:references:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=fEbty2QeOPMKrzAE/ SjhXztAOIR2JwiE9Dm3zkM4fVg=; b=g4kF6PLOA4Gsw5RdJ+SHuT1wHMmALHPkn b2JN4U77l+lGNgUbRdr//rPEO87nXmyh1tNZYdvQfcZ9WuFZ3/vBzsD0c1HsGt6/ HLqEtttuCXyRc+cw0qpUSDRLZ/0aU65skUDwp2d4Y5/53GavpoWuIaPu4JdlRTYj tBY7bU4MlBHQCVp8myL9vSAcSil81W22WugXlOUqreeeN05QT9hh5L1DzmKtPWN4 TGx4TGZvEqx/YjYDqBlxkJv+FTIoPO6wmn66/FddV/7TbQvWFJNDc6+/Yu3X1AuC 99zmvxEBo/ajAXuIZSJeOjFOShrO8Vy9q7BtRNAXjF3AMOYFGIiDQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=fEbty2QeOPMKrzAE/SjhXztAOIR2JwiE9Dm3zkM4fVg=; b=qQAg6fTM 9J+17cb43mC15vPh2iIYBcqh57zfWTglUZgpY6fgO4QP3dz3TK2cGYpcEq1unCZr rUaFHQmgTl33HboyuT38dyGnuHFw+zor+UHiPyS6d8A7G6EyEXkBu2etVEu2w08U cg4eLd4L9bQFa6fwLNvPLpxvsXCVtNxE9pmHNPeaBN8y1mTbrB0x2EZlghebUuOk EvncyqtlECPLP0cxZj8GKPH0cBjKD66r0S06xZEgi6EUOF9bnzUYGjKuY3Zzqbj1 GdRcUiuwz7ofoaIMKPnp/0uE12Hy18Pu+lhf+VUsIZ8yzV3NA9Mrt/6shyOTF3d5 DNkOGVS81Bes8g== X-ME-Sender: Received: from yliu-mob.mtl.com (unknown [115.150.27.200]) by mail.messagingengine.com (Postfix) with ESMTPA id 6D9D424610; Thu, 1 Feb 2018 04:49:40 -0500 (EST) From: Yuanhan Liu To: Matan Azrad Cc: Thomas Monjalon , Konstantin Ananyev , dpdk stable Date: Thu, 1 Feb 2018 17:47:53 +0800 Message-Id: <1517478479-12417-39-git-send-email-yliu@fridaylinux.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1517478479-12417-1-git-send-email-yliu@fridaylinux.org> References: <1517478479-12417-1-git-send-email-yliu@fridaylinux.org> Subject: [dpdk-stable] patch 'ethdev: fix port data reset timing' has been queued to LTS release 17.11.1 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: Thu, 01 Feb 2018 09:49:42 -0000 Hi, FYI, your patch has been queued to LTS release 17.11.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 02/03/18. So please shout if anyone has objections. Thanks. --yliu --- >>From 75b1eafa0332177df4c3dae9fe95a82eafbad6ea Mon Sep 17 00:00:00 2001 From: Matan Azrad Date: Mon, 22 Jan 2018 16:38:17 +0000 Subject: [PATCH] ethdev: fix port data reset timing [ upstream commit 133b54779aa1a0071e67d73b0963d28ef28b41a5 ] rte_eth_dev_data structure is allocated per ethdev port and can be used to get a data of the port internally. rte_eth_dev_attach_secondary tries to find the port identifier using rte_eth_dev_data name field comparison and may get an identifier of invalid port in case of this port was released by the primary process because the port release API doesn't reset the port data. So, it will be better to reset the port data in release time instead of allocation time. Move the port data reset to the port release API. Fixes: d948f596fee2 ("ethdev: fix port data mismatched in multiple process model") Signed-off-by: Matan Azrad Acked-by: Thomas Monjalon Acked-by: Konstantin Ananyev --- lib/librte_ether/rte_ethdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index 4f492e3..9dcb0d2 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -233,7 +233,6 @@ rte_eth_dev_allocate(const char *name) return NULL; } - memset(&rte_eth_dev_data[port_id], 0, sizeof(struct rte_eth_dev_data)); eth_dev = eth_dev_get(port_id); snprintf(eth_dev->data->name, sizeof(eth_dev->data->name), "%s", name); eth_dev->data->port_id = port_id; @@ -279,6 +278,7 @@ rte_eth_dev_release_port(struct rte_eth_dev *eth_dev) if (eth_dev == NULL) return -EINVAL; + memset(eth_dev->data, 0, sizeof(struct rte_eth_dev_data)); eth_dev->state = RTE_ETH_DEV_UNUSED; return 0; } -- 2.7.4