fd6949c55c
For virtio-net pmd, the interrupt management thread must be created after this driver has initialised so that iopl() has been properly called and its effects are inherited by all eal children threads. Before this change, changing link status on a virtio-net device would trigger a segfault in the interrupt thread : $ mkdir -p /mnt/huge $ echo 256 > /proc/sys/vm/nr_hugepages $ mount -t hugetlbfs none /mnt/huge $ lspci |grep Ethernet 00:03.0 Ethernet controller: Red Hat, Inc Virtio network device $ modprobe uio $ insmod ./x86_64-native-linuxapp-gcc/kmod/igb_uio.ko $ echo 0000:00:03.0 > /sys/bus/pci/devices/0000\:00\:03.0/driver/unbind $ echo 1af4 1000 > /sys/bus/pci/drivers/igb_uio/new_id $ ./x86_64-native-linuxapp-gcc/app/testpmd -c 0x6 -n 3 -w 0000:00:03.0 -- -i --txqflags=0xf01 --total-num-mbufs 2048 [snip] EAL: PCI device 0000:00:03.0 on NUMA socket -1 EAL: probe driver: 1af4:1000 rte_virtio_pmd Interactive-mode selected Configuring Port 0 (socket 0) Port 0: DE:AD:DE:01:02:03 Checking link statuses... Port 0 Link Up - speed 10000 Mbps - full-duplex Done testpmd> Then, from qemu monitor: (qemu) set_link virtio-net-pci.0 off testpmd> Segmentation fault Fixes: 565b85dcd9f4 ("eal: set iopl only when needed") Reported-by: Stephen Hemminger <shemming@brocade.com> Suggested-by: Thomas Monjalon <thomas.monjalon@6wind.com> Signed-off-by: David Marchand <david.marchand@6wind.com>