From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by dpdk.org (Postfix) with ESMTP id 291F81B57E for ; Fri, 23 Nov 2018 15:17:50 +0100 (CET) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20181123141749euoutp0184916af1e016307f98f9fd8ad583714b~pxpAqSr9C2569925699euoutp01C for ; Fri, 23 Nov 2018 14:17:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20181123141749euoutp0184916af1e016307f98f9fd8ad583714b~pxpAqSr9C2569925699euoutp01C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1542982669; bh=4+sNxRtpBk/uDl/sANQUhjHAH/2NM2qJ+n8GLp4/Sqo=; h=From:To:Cc:Subject:Date:References:From; b=T9pZUKIxwzh66igDt5OAeGl8PPqAcQ/bSSkLUq1ggek+6wNX6KjL9oSV7lDVYvzuN ej5C12SMW9ICs/5QlOChLMiUY2/aO+duTSF/BvlIkDRBAHomgLFmjDbzq4b3dDKsRw mEFtvJAE+aokHO8ItOmKpp2FYTC6xXyKJDQ7UJeU= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20181123141749eucas1p1e92d1c9e445b729795254cf6bf0aabff~pxpACTF9N3023830238eucas1p1y; Fri, 23 Nov 2018 14:17:49 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id BF.0E.04441.C0C08FB5; Fri, 23 Nov 2018 14:17:48 +0000 (GMT) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20181123141748eucas1p132a221972a87ec82b50d4a6c83bd9646~pxo-L1IsM1480814808eucas1p1Q; Fri, 23 Nov 2018 14:17:48 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20181123141747eusmtrp22ebab18eb2b99507ada3cc40e40536ac~pxo_7JEjS0957809578eusmtrp2X; Fri, 23 Nov 2018 14:17:47 +0000 (GMT) X-AuditID: cbfec7f2-5e3ff70000001159-6a-5bf80c0c5a3c Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 46.DC.04284.B0C08FB5; Fri, 23 Nov 2018 14:17:47 +0000 (GMT) Received: from imaximets.rnd.samsung.ru (unknown [106.109.129.180]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20181123141747eusmtip1401bc1cdbb429ee1765f4489c336c7a2~pxo_TRSYu3207932079eusmtip1i; Fri, 23 Nov 2018 14:17:47 +0000 (GMT) From: Ilya Maximets To: dev@dpdk.org, David Marchand Cc: Maxime Coquelin , Tiwei Bie , Zhihong Wang , Thomas Monjalon , Ferruh Yigit , Ian Stokes , Kevin Traynor , Ilya Maximets Date: Fri, 23 Nov 2018 17:17:39 +0300 Message-Id: <20181123141739.11214-1-i.maximets@samsung.com> X-Mailer: git-send-email 2.17.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmphleLIzCtJLcpLzFFi42LZduznOV0enh/RBofXmFms6GhnsXj3aTuT xZ29p9ktrrT/ZLfY+PAsq8XaQx/YLY517mGx+PTgBIvF1ob/TBabL05icuDyuNh/h9Hj14Kl rB6L97xk8jh2cxq7x/t9V9k8+rasYgxgi+KySUnNySxLLdK3S+DKaJ49ga3gK1/Fi9m/WBsY V/B0MXJySAiYSDTMesDaxcjFISSwglFix7HHbBDOF0aJLXNeskM4nxklZt9dyQbTMq1/EVRi OaPE37l/mSCcH4wSH5ffZwapYhPQkTi1+ggjiC0iYC3RtGoR2FxmgX1MErPfvwQrEhZwkWg7 0MIEYrMIqEr8fH+WHcTmBWronPiOEWKdvMTqDQ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5eA+Yf0UKs iWXFlbmHGCU4mJVEeJsUv0cL8aYkVlalFuXHF5XmpBYfYjQFWj6RWUo0OR8YTXkl8YamhuYW lobmxubGZhZK4rznDSqjhATSE0tSs1NTC1KLYPqYODilGhiz8l2OmDS0t5cGlhdK1iyxzRJ6 ERQinhVnYqKW/e765dMrqyMEj1gpp1n96y5L3dN02Uxe0Ere2uRDUKWj1Nqkgyr3vtz9czeV I6L/QeYrxiMV3r5H7k732HusdueyQysC03cXhCZ99+PJmpds9HFH+78Pb65rR3Bu7Lq5rbRf zGBe3wWxqUosxRmJhlrMRcWJALQpOxJuAgAA X-CMS-MailID: 20181123141748eucas1p132a221972a87ec82b50d4a6c83bd9646 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20181123141748eucas1p132a221972a87ec82b50d4a6c83bd9646 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20181123141748eucas1p132a221972a87ec82b50d4a6c83bd9646 References: Subject: [dpdk-dev] [PATCH] net/virtio: avoid annoying IOPL call related errors X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 14:17:51 -0000 In case of running with not enough capabilities, i.e. running as non-root user any application linked with DPDK prints the message about IOPL call failure even if it was just called like './testpmd --help'. For example, this beaks most of the OVS unit tests if it built with DPDK support. Let's register the virtio driver unconditionally and print error message while probing the device. Silent iopl() call left in the constructor to have privileges as early as possible as it was before. Signed-off-by: Ilya Maximets --- We can avoid test failures in OVS by filtering the output like this: https://patchwork.ozlabs.org/project/openvswitch/list/?series=77706 But it still looks very inconvenient for me to have this message in the output of every command for the DPDK linked app. drivers/net/virtio/virtio_ethdev.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c index e1fe36a23..2ba66d291 100644 --- a/drivers/net/virtio/virtio_ethdev.c +++ b/drivers/net/virtio/virtio_ethdev.c @@ -1760,6 +1760,11 @@ vdpa_mode_selected(struct rte_devargs *devargs) static int eth_virtio_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, struct rte_pci_device *pci_dev) { + if (rte_eal_iopl_init() != 0) { + PMD_INIT_LOG(ERR, "IOPL call failed - cannot use virtio PMD"); + return 1; + } + /* virtio pmd skips probe if device needs to work in vdpa mode */ if (vdpa_mode_selected(pci_dev->device.devargs)) return 1; @@ -1785,11 +1790,7 @@ static struct rte_pci_driver rte_virtio_pmd = { RTE_INIT(rte_virtio_pmd_init) { - if (rte_eal_iopl_init() != 0) { - PMD_INIT_LOG(ERR, "IOPL call failed - cannot use virtio PMD"); - return; - } - + rte_eal_iopl_init(); rte_pci_register(&rte_virtio_pmd); } -- 2.17.1