From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ferruh Yigit Subject: Re: [PATCH] ethdev: fix wrong memset Date: Mon, 23 Jan 2017 09:41:35 +0000 Message-ID: <3451afa6-12fb-dc65-f379-873facc0301c@intel.com> References: <1484899493-11051-1-git-send-email-yuanhan.liu@linux.intel.com> <6e706e07-455f-de57-4f85-eb4e506528f1@intel.com> <4d897cf9-f1f4-d924-10cd-63e95b12b411@intel.com> <20170122024529.GZ10293@yliu-dev.sh.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org, Thomas Monjalon , Remy Horton To: Yuanhan Liu Return-path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 0AE76108F for ; Mon, 23 Jan 2017 10:41:37 +0100 (CET) In-Reply-To: <20170122024529.GZ10293@yliu-dev.sh.intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 1/22/2017 2:45 AM, Yuanhan Liu wrote: > On Fri, Jan 20, 2017 at 03:27:43PM +0000, Ferruh Yigit wrote: >> On 1/20/2017 11:21 AM, Ferruh Yigit wrote: >>> On 1/20/2017 8:04 AM, Yuanhan Liu wrote: >>>> Fix an silly error by auto-complete while managing the merge conflicts. >>>> It's the eth_dev_data (but not eth_dev) entry should be memset. >>>> >>>> Fixes: d948f596fee2 ("ethdev: fix port data mismatched in multiple process model") >>>> >>>> Reported-by: Ferruh Yigit >>>> Signed-off-by: Yuanhan Liu >>>> --- >>>> 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 4790faf..61f44e2 100644 >>>> --- a/lib/librte_ether/rte_ethdev.c >>>> +++ b/lib/librte_ether/rte_ethdev.c >>>> @@ -225,7 +225,7 @@ struct rte_eth_dev * >>>> return NULL; >>>> } >>>> >>>> - memset(&rte_eth_devices[port_id], 0, sizeof(*eth_dev->data)); >>>> + memset(&rte_eth_dev_data[port_id], 0, sizeof(struct rte_eth_dev_data)); >>> >>> Not directly related to the this issue, but, after fix, this may have >>> issues with secondary process. >>> >>> There were patches sent to fix this. >> >> I mean this one: >> http://dpdk.org/ml/archives/dev/2017-January/054422.html > > d948f596fee2 ("ethdev: fix port data mismatched in multiple process > model") should have fixed it. Think about case, where secondary process uses a virtual PMD, which does a rte_eth_dev_allocate() call, shouldn't this corrupt primary process device data? > > --yliu >