From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 842E7A3201 for ; Sun, 20 Oct 2019 14:30:35 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0D8625B3C; Sun, 20 Oct 2019 14:30:25 +0200 (CEST) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by dpdk.org (Postfix) with ESMTP id 4F11D58C4 for ; Sun, 20 Oct 2019 14:30:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571574622; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=P+ZpZUcFd1FRM+HkzRx1fL7EkbK7l0Kw9YLNG2pgQto=; b=VFXCAlu2ZLqmnMVVit1ADWdpP71BfnylR9V6A+gtk0V/9MZr/eL2v9kChtjmOE/xqDOLWF hsP2U5Yy52z9xCTn/WH9nm2H/9H5I0/7mPizscrEXdt+YJnE7YomD23fN1ZAcPJoo4fzpR L2Oq1ykE/auaXE7DJeMCEzfQr4SbeUE= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-182-vxYSMZEBMuOhWSxWEuC91g-1; Sun, 20 Oct 2019 08:30:19 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 55AA5800D53; Sun, 20 Oct 2019 12:30:18 +0000 (UTC) Received: from dmarchan.remote.csb (ovpn-204-16.brq.redhat.com [10.40.204.16]) by smtp.corp.redhat.com (Postfix) with ESMTP id 000F65D9C9; Sun, 20 Oct 2019 12:30:13 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: Maxime Coquelin , Tiwei Bie , Zhihong Wang Date: Sun, 20 Oct 2019 14:29:59 +0200 Message-Id: <1571574599-25022-3-git-send-email-david.marchand@redhat.com> In-Reply-To: <1571574599-25022-1-git-send-email-david.marchand@redhat.com> References: <1571313388-32142-1-git-send-email-david.marchand@redhat.com> <1571574599-25022-1-git-send-email-david.marchand@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-MC-Unique: vxYSMZEBMuOhWSxWEuC91g-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: quoted-printable Subject: [dpdk-dev] [PATCH v2 2/2] net/virtio: do not require IO permissions 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On x86, iopl permissions are only available to root user (or users that have the CAP_SYS_RAWIO capability). But those permissions are only needed when the virtio devices accesses are done with inb/outb instructions, which is when the device is bound to a UIO kernel module. So far, the virtio driver was refusing to register based on the check on IO permissions. This check does not make sense when binding the device to vfio. Now that the check on IO permissions has been abstracted in the ioport API, we can remove it on virtio side. We still need to call rte_eal_iopl_init() in the virtio constructor so that the interrupt thread inherits this permission in the case it could be used with UIO later. Signed-off-by: David Marchand --- Changelog since v1: - remove log message in constructor (thanks Tiwei), - reword commit log, --- drivers/net/virtio/virtio_ethdev.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio= _ethdev.c index 7261109..0a2ed2e 100644 --- a/drivers/net/virtio/virtio_ethdev.c +++ b/drivers/net/virtio/virtio_ethdev.c @@ -1995,11 +1995,6 @@ exit: static int eth_virtio_pci_probe(struct rte_pci_driver *pci_drv __rte_unuse= d, =09struct rte_pci_device *pci_dev) { -=09if (rte_eal_iopl_init() !=3D 0) { -=09=09PMD_INIT_LOG(ERR, "IOPL call failed - cannot use virtio PMD"); -=09=09return 1; -=09} - =09/* virtio pmd skips probe if device needs to work in vdpa mode */ =09if (vdpa_mode_selected(pci_dev->device.devargs)) =09=09return 1; --=20 1.8.3.1