[dpdk-dev] On vmxnet-pmd crash in DPDK 1.6.0r1
Thomas Monjalon
thomas.monjalon at 6wind.com
Fri Mar 21 15:10:08 CET 2014
10/03/2014 23:29, Daniel Kan :
> virtio-pmd has the same pattern. I wonder if vmxnet3-pmd just blindly copied
> the same paradigm.
>
> 473 static struct eth_driver rte_virtio_pmd = {
> 474 {
> 475 .name = "rte_virtio_pmd",
> 476 .id_table = pci_id_virtio_map,
> 477 #ifdef RTE_EAL_UNBIND_PORTS
> 478 .drv_flags = RTE_PCI_DRV_NEED_IGB_UIO,
> 479 #endif
[...]
> > 266 static struct eth_driver rte_vmxnet3_pmd = {
> > 267 {
> > 268 .name = "rte_vmxnet3_pmd",
> > 269 .id_table = pci_id_vmxnet3_map,
> > 270 #ifdef RTE_EAL_UNBIND_PORTS
> > 271 .drv_flags = RTE_PCI_DRV_NEED_IGB_UIO,
> > 272 #endif
It was the old way of configuring UIO PMD before this patch:
pci: use igb_uio mapping only when needed
http://dpdk.org/browse/dpdk/commit/?id=10ed99419b12b8
The goal of this patch was to fix usage of the extensions virtio-net-pmd and
vmxnet3-usermap.
You can see in this patch that em/igb/ixgbe drivers are updated accordingly.
Then virtio_uio and vmxnet3_uio were released without this patch in mind. So
they were broken.
> > lib/librte_eal/linuxapp/eal/eal_pci.c
> > 1039 #ifdef RTE_EAL_UNBIND_PORTS
> > 1040 if (dr->drv_flags & RTE_PCI_DRV_NEED_IGB_UIO) {
> > 1041 /* unbind driver and load uio resources for Intel NICs */
> > 1042 if (pci_switch_module(dr, dev, 1, IGB_UIO_NAME) < 0)
> > ...
> > 1050 #else
> > 1051 if (dr->drv_flags & RTE_PCI_DRV_NEED_IGB_UIO)
> > 1052 /* just map resources for Intel NICs */
> > 1053 if (pci_uio_map_resource(dev) < 0)
> > 1054 return -1;
> > 1055 #endif
> >
> > If RTE_EAL_UNBIND_PORTS is defined, pci_switch_module will call
> > pci_uio_map_resource.
> >
> > I then looked at the bsdapp’s version, it simply has:
> > lib/librte_eal/bsdapp/eal/eal_pci.c
> > 479 /* just map the NIC resources */
> > 480 if (pci_uio_map_resource(dev) < 0)
> > 481 return -1;
> >
> > I don’t know the history behind why .drv_flags = RTE_PCI_DRV_NEED_IGB_UIO
> > only for RTE_EAL_UNBIND_PORTS. Can we just ensure pci_uio_map_resource is
> > called in linux just like bsd version? One way is to ensure drv_flags is
> > always set to RTE_PCI_DRV_NEED_IGB_UIO, but I don’t know if this fix will
> > break other parts.
I've just sent another patch to update and fix virtio_uio and vmxnet3_uio:
http://dpdk.org/ml/archives/dev/2014-March/001647.html
Feel free to ack it.
Thanks for reporting
--
Thomas
More information about the dev
mailing list