From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id A2F892A5B for ; Mon, 23 Jan 2017 12:32:26 +0100 (CET) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 23 Jan 2017 03:32:25 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,274,1477983600"; d="scan'208";a="34202440" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.237.220.38]) ([10.237.220.38]) by orsmga002.jf.intel.com with ESMTP; 23 Jan 2017 03:32:24 -0800 To: Yuanhan Liu 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> <3451afa6-12fb-dc65-f379-873facc0301c@intel.com> <20170123103417.GB10293@yliu-dev.sh.intel.com> <53a23156-dcb9-b41f-c27c-5bd13d5874f6@intel.com> <20170123112445.GE10293@yliu-dev.sh.intel.com> Cc: dev@dpdk.org, Thomas Monjalon , Remy Horton From: Ferruh Yigit Message-ID: <90752e37-444b-e2bf-6d4b-1bf2eda38deb@intel.com> Date: Mon, 23 Jan 2017 11:32:23 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: <20170123112445.GE10293@yliu-dev.sh.intel.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH] ethdev: fix wrong memset 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: Mon, 23 Jan 2017 11:32:27 -0000 On 1/23/2017 11:24 AM, Yuanhan Liu wrote: > On Mon, Jan 23, 2017 at 11:05:25AM +0000, Ferruh Yigit wrote: >>>>>>>> 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? >>> >>> Yes, it may. However, I doubt that's the typical usage. >> >> But this is a use case, and broken now, > > I thought it was broken since the beginning? No, memset(&rte_eth_dev_data[port_id], ...) breaks it. > >> and fix is known. > > And there is already a fix? http://dpdk.org/ml/archives/dev/2017-January/054422.html > >> Should be >> fixed I think. > > Sure. > >> >>> Besides that, >>> most of virtual PMDs don't support Multipleprocess: git grep shows pcap >>> is the only one that does claim Multipleprocess is supported. >> >> I guess you searched for NIC feature documentation for this. > > Yes. > >> But as far >> as I know, all virtual drivers can be used in both primary and secondary >> process. > > Maybe. But it becomes very error-prone to me then when vdev are involved > in both primary and secondary process. I don't think current code is (or > designed to be) strong enough to support that. > > I don't know it's allowed to use hotplug or not in the multiple process > model. If yes, I think there would be many ways to break it. > > Honestly, the multiple process doesn't look like a good/clean design to > me, especially when some piece of code claim to support it while some > other doesn't. > > So my point was, yes, there is a bug, we should fix it. But it seems > that there could be so many bugs if we hugely expand the test coverage > of the multiple process feature. Agreed. > > --yliu >