On Mon, 6 Mar 2017 14:27:18 +0000 Ferruh Yigit <ferruh.yi...@intel.com> 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 <pascal.ma...@6wind.com> > <...>