From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by dpdk.org (Postfix) with ESMTP id DFAEF1B5E0 for ; Fri, 23 Nov 2018 16:39:53 +0100 (CET) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20181123153953euoutp0224374f6c036065710e8fe4089dd211c6~pywp2mSXj1089210892euoutp02C for ; Fri, 23 Nov 2018 15:39:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20181123153953euoutp0224374f6c036065710e8fe4089dd211c6~pywp2mSXj1089210892euoutp02C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1542987593; bh=dCeaowDAPx2oGnMlO74WPqzv9iHRArTYspqF3nVvJEA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eu29jHr0GYjC895xtN5kHADbJ0JjzwxWJw1EDZWYJjxnivsRawI50cx2zmhFIMB7f 0Ga0QTLU9nC0NIQqb4vynznatUyYmvD29NM5jYy5VGkyRCzkEeLiwUbuOv4YhCbXa9 AekURQUnXMsrE2e0fM1pzr2aJgO4cczcBQqkmM5Y= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20181123153952eucas1p2da517ca57203578945c6a5f0be695e35~pywparYd32214922149eucas1p2C; Fri, 23 Nov 2018 15:39:52 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 42.B8.04441.84F18FB5; Fri, 23 Nov 2018 15:39:52 +0000 (GMT) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20181123153951eucas1p1218331b7e51db8eae3073fa6a14f3bcd~pywoZkfEA0134401344eucas1p1G; Fri, 23 Nov 2018 15:39:51 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20181123153951eusmtrp226e565ce26daef956c2ddddeeea33f49~pywoJb3ZW3195431954eusmtrp2o; Fri, 23 Nov 2018 15:39:51 +0000 (GMT) X-AuditID: cbfec7f2-5e3ff70000001159-c1-5bf81f481b67 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 8F.86.04284.74F18FB5; Fri, 23 Nov 2018 15:39:51 +0000 (GMT) Received: from imaximets.rnd.samsung.ru (unknown [106.109.129.180]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20181123153950eusmtip20822f5a7e4d882c16b2bc25272c29914~pywnbhVFd1868318683eusmtip27; Fri, 23 Nov 2018 15:39:50 +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 , Bruce Richardson , Ilya Maximets Date: Fri, 23 Nov 2018 18:39:20 +0300 Message-Id: <20181123153920.12398-3-i.maximets@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181123153920.12398-1-i.maximets@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupmleLIzCtJLcpLzFFi42LZduznOV0P+R/RBue6hS1urLK32L6ii83i 3aftTBZ39p5mt7jS/pPdYuPDs6wWaw99YLc41rmHxeLTgxMsFlsb/jNZbL44icmB2+PXgqWs Hov3vGTyOHZzGrvH+31X2Tz6tqxiDGCN4rJJSc3JLEst0rdL4MpY8e0fY8EC3oq2by/ZGhgb uLsYOTkkBEwkzi17wdLFyMUhJLCCUWL7+o/sEM4XRom7TVegMp8ZJTb+fcfWxcgB1vLgkiZI t5DAckaJ66eSIGp+MErMWzaLDSTBJqAjcWr1EUaQehEBG4nrn4pAapgF3jNJ7H/zlxWkRljA W2LanDks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OTc8tNtQrTswtLs1L10vOz93ECAzsbcd+ bt7BeGlj8CFGAQ5GJR5eA+Yf0UKsiWXFlbmHGCU4mJVEeJsUv0cL8aYkVlalFuXHF5XmpBYf YjQFumkis5Rocj4w6vJK4g1NDc0tLA3Njc2NzSyUxHnPG1RGCQmkJ5akZqemFqQWwfQxcXBK NTBqpbu9LfffVCnX1GXUefrkk2h2J/NVW+yKVnfuC7rFcsXu/B1Fw4x3lv5igpr3ru9crXSE Y+mi12714UWKizUM87Z5OLhd+HE1WWjZxNCIV2aTUu7OLrhxJG/f0peS+3IenD28a/v8NReu rb+fPi3kjvAG57bwdx7CNjHCb7lPPzQL71gRMPWmEktxRqKhFnNRcSIAtPK/coICAAA= X-CMS-MailID: 20181123153951eucas1p1218331b7e51db8eae3073fa6a14f3bcd X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20181123153951eucas1p1218331b7e51db8eae3073fa6a14f3bcd X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20181123153951eucas1p1218331b7e51db8eae3073fa6a14f3bcd References: <20181123143620.10480-1-i.maximets@samsung.com> <20181123153920.12398-1-i.maximets@samsung.com> Subject: [dpdk-dev] [PATCH v3 2/2] 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 15:39:54 -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 breaks 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 Reviewed-by: David Marchand --- 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