From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id CDEBD1B4AA for ; Thu, 29 Nov 2018 14:24:28 +0100 (CET) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 42F2A3082129; Thu, 29 Nov 2018 13:24:28 +0000 (UTC) Received: from ktraynor.remote.csb (ovpn-117-230.ams2.redhat.com [10.36.117.230]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7A13F1019626; Thu, 29 Nov 2018 13:24:24 +0000 (UTC) From: Kevin Traynor To: Ilya Maximets Cc: David Marchand , Maxime Coquelin , dpdk stable Date: Thu, 29 Nov 2018 13:21:22 +0000 Message-Id: <20181129132128.7609-82-ktraynor@redhat.com> In-Reply-To: <20181129132128.7609-1-ktraynor@redhat.com> References: <20181129132128.7609-1-ktraynor@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Thu, 29 Nov 2018 13:24:28 +0000 (UTC) Subject: [dpdk-stable] patch 'net/virtio: avoid annoying IOPL error log' has been queued to stable release 18.08.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 13:24:29 -0000 Hi, FYI, your patch has been queued to stable release 18.08.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 12/08/18. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. If the code is different (ie: not only metadata diffs), due for example to a change in context or macro names, please double check it. Thanks. Kevin Traynor --- >>From 78a772363801eff514bce37236d0a6006a423dec Mon Sep 17 00:00:00 2001 From: Ilya Maximets Date: Fri, 23 Nov 2018 18:39:20 +0300 Subject: [PATCH] net/virtio: avoid annoying IOPL error log [ upstream commit 705dced4a72a1053368c84c4b68f04f028a78b30 ] 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. Fixes: 565b85dcd9f4 ("eal: set iopl only when needed") Signed-off-by: Ilya Maximets Reviewed-by: David Marchand Reviewed-by: Maxime Coquelin --- 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 b8693ff80..e14862a97 100644 --- a/drivers/net/virtio/virtio_ethdev.c +++ b/drivers/net/virtio/virtio_ethdev.c @@ -1764,4 +1764,9 @@ 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)) @@ -1789,9 +1794,5 @@ 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.19.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2018-11-29 13:11:37.061915245 +0000 +++ 0081-net-virtio-avoid-annoying-IOPL-error-log.patch 2018-11-29 13:11:35.000000000 +0000 @@ -1,8 +1,10 @@ -From 705dced4a72a1053368c84c4b68f04f028a78b30 Mon Sep 17 00:00:00 2001 +From 78a772363801eff514bce37236d0a6006a423dec Mon Sep 17 00:00:00 2001 From: Ilya Maximets Date: Fri, 23 Nov 2018 18:39:20 +0300 Subject: [PATCH] net/virtio: avoid annoying IOPL error log +[ upstream commit 705dced4a72a1053368c84c4b68f04f028a78b30 ] + 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 @@ -14,7 +16,6 @@ constructor to have privileges as early as possible as it was before. Fixes: 565b85dcd9f4 ("eal: set iopl only when needed") -Cc: stable@dpdk.org Signed-off-by: Ilya Maximets Reviewed-by: David Marchand @@ -24,10 +25,10 @@ 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 +index b8693ff80..e14862a97 100644 --- a/drivers/net/virtio/virtio_ethdev.c +++ b/drivers/net/virtio/virtio_ethdev.c -@@ -1761,4 +1761,9 @@ static int eth_virtio_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, +@@ -1764,4 +1764,9 @@ 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) { @@ -37,7 +38,7 @@ + /* virtio pmd skips probe if device needs to work in vdpa mode */ if (vdpa_mode_selected(pci_dev->device.devargs)) -@@ -1786,9 +1791,5 @@ static struct rte_pci_driver rte_virtio_pmd = { +@@ -1789,9 +1794,5 @@ static struct rte_pci_driver rte_virtio_pmd = { RTE_INIT(rte_virtio_pmd_init) { - if (rte_eal_iopl_init() != 0) {