From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f169.google.com (mail-wi0-f169.google.com [209.85.212.169]) by dpdk.org (Postfix) with ESMTP id C5AD85693 for ; Wed, 14 Oct 2015 11:51:11 +0200 (CEST) Received: by wicgb1 with SMTP id gb1so122549143wic.1 for ; Wed, 14 Oct 2015 02:51:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=Deax5j8GXNvWK3DalGaTyMGJeRhuhVRFP/3L1hJ3azI=; b=AvhAC8mM31tgtrLD3lKiDgQCWmQrxbnOJE3riPOxq6M6n9kUVVYb1hatPceUi6t+Pb X73Wfa2GVfG/DiFZsJEDuWDXGs0FML4BuQnfuobf7xbNgEjxLJpPdQafM6K9F6wpmkkU OQ52AORx4vt2TdCdi+g5onN5743+DYn8k7LT7XWXPAWvqZnuFRGSSn/zugfXN7b+ktzR 7ivUXkCxDzLcnU/grYrYKEo2ibQpQgxMPBai0l0B2ICAe+8vtUZc4/UQAH/3jg6HpidZ bOLHpL3Ke27Zy0fSN+Wr5XXpfGhIMPHK09YZx+W2ftjtdGZZwehWB3z4Rn+hhtybUvFf ZMow== X-Gm-Message-State: ALoCoQmge88Cgzm+4t1Eg+LT8uJf44Jsegtinf1BzYhzs17BqnOpyfyIAGuWwAGqipjH/IJ83RoW X-Received: by 10.194.87.198 with SMTP id ba6mr2848899wjb.6.1444816271545; Wed, 14 Oct 2015 02:51:11 -0700 (PDT) Received: from alcyon.dev.6wind.com (guy78-3-82-239-227-177.fbx.proxad.net. [82.239.227.177]) by smtp.gmail.com with ESMTPSA id x16sm6386600wia.7.2015.10.14.02.51.10 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Oct 2015 02:51:10 -0700 (PDT) From: David Marchand To: dev@dpdk.org Date: Wed, 14 Oct 2015 11:50:49 +0200 Message-Id: <1444816250-2402-1-git-send-email-david.marchand@6wind.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: References: Subject: [dpdk-dev] [PATCH] eal: move interrupt init after device init X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Oct 2015 09:51:12 -0000 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: "eal: set iopl only when needed" (565b85d) Reported-by: Stephen Hemminger Suggested-by: Thomas Monjalon Signed-off-by: David Marchand --- lib/librte_eal/linuxapp/eal/eal.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/eal/eal.c index 33e1067..e0ad1d7 100644 --- a/lib/librte_eal/linuxapp/eal/eal.c +++ b/lib/librte_eal/linuxapp/eal/eal.c @@ -817,9 +817,6 @@ rte_eal_init(int argc, char **argv) if (rte_eal_alarm_init() < 0) rte_panic("Cannot init interrupt-handling thread\n"); - if (rte_eal_intr_init() < 0) - rte_panic("Cannot init interrupt-handling thread\n"); - if (rte_eal_timer_init() < 0) rte_panic("Cannot init HPET or TSC timers\n"); @@ -845,6 +842,9 @@ rte_eal_init(int argc, char **argv) if (rte_eal_dev_init() < 0) rte_panic("Cannot init pmd devices\n"); + if (rte_eal_intr_init() < 0) + rte_panic("Cannot init interrupt-handling thread\n"); + RTE_LCORE_FOREACH_SLAVE(i) { /* -- 1.7.10.4