From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: On vmxnet-pmd crash in DPDK 1.6.0r1 Date: Fri, 21 Mar 2014 15:10:08 +0100 Message-ID: <29690202.d2trYudiQU@xps13> References: Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Cc: dev-VfR2kkLFssw@public.gmane.org To: Daniel Kan Return-path: In-Reply-To: List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" 10/03/2014 23:29, Daniel Kan : > virtio-pmd has the same pattern. I wonder if vmxnet3-pmd just blindly= copied > the same paradigm. >=20 > 473 static struct eth_driver rte_virtio_pmd =3D { > 474 { > 475 .name =3D "rte_virtio_pmd", > 476 .id_table =3D pci_id_virtio_map, > 477 #ifdef RTE_EAL_UNBIND_PORTS > 478 .drv_flags =3D RTE_PCI_DRV_NEED_IGB_UIO, > 479 #endif [...] > > 266 static struct eth_driver rte_vmxnet3_pmd =3D { > > 267 { > > 268 .name =3D "rte_vmxnet3_pmd", > > 269 .id_table =3D pci_id_vmxnet3_map, > > 270 #ifdef RTE_EAL_UNBIND_PORTS > > 271 .drv_flags =3D RTE_PCI_DRV_NEED_IGB_UIO, > > 272 #endif It was the old way of configuring UIO PMD before this patch: =09pci: use igb_uio mapping only when needed =09http://dpdk.org/browse/dpdk/commit/?id=3D10ed99419b12b8 The goal of this patch was to fix usage of the extensions virtio-net-pm= d and=20 vmxnet3-usermap. You can see in this patch that em/igb/ixgbe drivers are updated accordi= ngly. Then virtio_uio and vmxnet3_uio were released without this patch in min= d. So=20 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 > >=20 > > If RTE_EAL_UNBIND_PORTS is defined, pci_switch_module will call > > pci_uio_map_resource. > >=20 > > I then looked at the bsdapp=E2=80=99s 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; > >=20 > > I don=E2=80=99t know the history behind why .drv_flags =3D RTE_PCI_= DRV_NEED_IGB_UIO > > only for RTE_EAL_UNBIND_PORTS. Can we just ensure pci_uio_map_resou= rce is > > called in linux just like bsd version? One way is to ensure drv_fla= gs is > > always set to RTE_PCI_DRV_NEED_IGB_UIO, but I don=E2=80=99t know if= this fix will > > break other parts. I've just sent another patch to update and fix virtio_uio and vmxnet3_u= io: =09http://dpdk.org/ml/archives/dev/2014-March/001647.html Feel free to ack it. Thanks for reporting --=20 Thomas