From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pascal Mazon Subject: Re: [PATCH v2] net/tap: fix dev name look-up Date: Mon, 6 Mar 2017 15:57:50 +0100 Message-ID: <20170306155750.55dfb49f@paques.dev.6wind.com> References: <1ad979ca71ba1ebe10572237a6a5b4694c23b645.1488531158.git.pascal.mazon@6wind.com> <64e79c8c7398e0af093168d614c0ca62dc28377e.1488808159.git.pascal.mazon@6wind.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: keith.wiles@intel.com, dev@dpdk.org To: Ferruh Yigit Return-path: Received: from mail-wr0-f171.google.com (mail-wr0-f171.google.com [209.85.128.171]) by dpdk.org (Postfix) with ESMTP id DD38B952 for ; Mon, 6 Mar 2017 15:58:01 +0100 (CET) Received: by mail-wr0-f171.google.com with SMTP id u48so118508014wrc.0 for ; Mon, 06 Mar 2017 06:58:01 -0800 (PST) In-Reply-To: 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 Mon, 6 Mar 2017 14:27:18 +0000 Ferruh Yigit wrote: > On 3/6/2017 1:51 PM, Pascal Mazon wrote: > > Store the device name in dev->data->name, to have symmetrical > > behavior between rte_pmd_tap_probe(name) and > > rte_pmd_tap_remove(name). > > > > The netdevice name (linux interface name) is stored in the name > > field of struct pmd_internals. > > +1 for this. > > > > > There's no need to allocate an rte_eth_dev_data, as it is done in > > rte_eth_dev_allocate()/rte_eth_dev_data_alloc(). > > Allocating rte_eth_dev_data, although rte_eth_dev_allocate() does > already, common practice for virtual devices, for a reason. > > rte_eth_dev_allocate() allocates device data from a shared memory, so > that multiple DPDK processes can access same device data, this may > make sense for physical devices, since there is a single physical > resource. > > But for virtual devices, each DPDK process may want to have > independent instance of the virtual device, that is why PMD itself > allocates data and overwrites with existing dev->data. > > Also this may lead unexpected results for some multi process use > cases, like secondary process virtual device corrupt primary process > physical device data. > > I believe it is good to keep this as it is. > I see your point. I'll send a v3 with just the correct "name" used for allocation. And I'll move the snprintf(data->name) closer, to insist it must use the same name as in allocation. Regards, Pascal > > > > Signed-off-by: Pascal Mazon > <...>