Skip to contentSkip to conversation

vmxnet3: fixed segfault when initializing vmxnet3 pmd on linux platform

PATCH In review Daniel Kan 2 participants 2 messages Mar 12, 2014 – Mar 21, 2014 1 message not in the archive

lore
Share & tools
lore

Daniel Kan

author
#0 lore raw

PATCH 1/1 vmxnet3: fixed segfault when initializing vmxnet3 pmd on linux platform

The vmxnet3 PCI hardware resources were never memory mapped when RE_EAL_UNBIND_PORTS is not defined.
Specifically, pci_dev->mem_resource is not mapped. The fix is to always set drv_flags with RTE_PCI_DRV_NEED_IGU for vmxnet3. This ensures pci_uio_map_resource() is called.

---
 lib/librte_pmd_vmxnet3/vmxnet3_ethdev.c |    2 --
 1 file changed, 2 deletions(-)
lib/librte_pmd_vmxnet3/vmxnet3_ethdev.c +0 -2
index 6757aa2..8259cfe 100644
@@ -267,9 +267,7 @@ static struct eth_driver rte_vmxnet3_pmd = {
 	{
 		.name = "rte_vmxnet3_pmd",
 		.id_table = pci_id_vmxnet3_map,
-#ifdef RTE_EAL_UNBIND_PORTS
 		.drv_flags = RTE_PCI_DRV_NEED_IGB_UIO,
-#endif
 	},
 	.eth_dev_init = eth_vmxnet3_dev_init,
 	.dev_private_size = sizeof(struct vmxnet3_adapter),
Signature · 1 line
1.7.9.5

A message that is not in the archive (sent off-list or not yet received): 1394655599-5991-1-git-send-email-dan-nm7580oGLDTQT0dZR+AlfA@public.gmane.org

#2 lore raw

12/03/2014 13:19, Daniel Kan :

Quoted 6 lines

The vmxnet3 PCI hardware resources were never memory mapped when RE_EAL_UNBIND_PORTS is not defined. Specifically, pci_dev->mem_resource is not mapped. The fix is to always set drv_flags with RTE_PCI_DRV_NEED_IGU for vmxnet3. This ensures pci_uio_map_resource() is called.

I forgot your patch when I've sent this one:

	http://dpdk.org/ml/archives/dev/2014-March/001647.html
I've merged them and applied for 1.6.0r2:
	http://dpdk.org/browse/dpdk/commit/?id=18f02ff759

Thank you

Signature · 1 line
Thomas