From patchwork Thu Apr 18 15:05:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aaron Conole X-Patchwork-Id: 1087644 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44lMqv2DfLz9s55 for ; Fri, 19 Apr 2019 01:06:02 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 35F69186D; Thu, 18 Apr 2019 15:06:00 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 1807F13D3 for ; Thu, 18 Apr 2019 15:05:45 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id C0AD3108 for ; Thu, 18 Apr 2019 15:05:44 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3B940330278; Thu, 18 Apr 2019 15:05:39 +0000 (UTC) Received: from dhcp-25.97.bos.redhat.com (ovpn-123-161.rdu2.redhat.com [10.10.123.161]) by smtp.corp.redhat.com (Postfix) with ESMTP id 424BC19C58; Thu, 18 Apr 2019 15:05:30 +0000 (UTC) From: Aaron Conole To: dev@openvswitch.org Date: Thu, 18 Apr 2019 11:05:28 -0400 Message-Id: <20190418150528.10284-1-aconole@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Thu, 18 Apr 2019 15:05:39 +0000 (UTC) X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Cc: Flavio Leitner , Alex Williamson Subject: [ovs-dev] [PATCH] rhel: update udev rules to allow vfio access X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org On some systems, it's possible that the initialization of the misc chardev associated with /dev/vfio/vfio is delayed. This happens on machines with large numbers of cores (at least 88+). If this delay exceeds the time required for ovs-vswitchd to call the dpdk initialization routine, the permissions won't be updated and the open call will return EACCES. To fix this, we explicitly allow global open. This means any user may open() the vfio device before the vfio modules are initialized, thus triggering a module load. The applications (including ovs-vswitchd) would be pended while the module loads. This should be safe, as any user may open the vfio device once the module is loaded anyway, since the. module rewrites the permissions as 0666. Signed-off-by: Aaron Conole --- rhel/usr_lib_udev_rules.d_91-vfio.rules | 1 + 1 file changed, 1 insertion(+) diff --git a/rhel/usr_lib_udev_rules.d_91-vfio.rules b/rhel/usr_lib_udev_rules.d_91-vfio.rules index 8e34b2a2b..c0504ab5a 100644 --- a/rhel/usr_lib_udev_rules.d_91-vfio.rules +++ b/rhel/usr_lib_udev_rules.d_91-vfio.rules @@ -1 +1,2 @@ ACTION=="add", SUBSYSTEM=="vfio*", GROUP="hugetlbfs", MODE="0660" +ACTION=="add", SUBSYSTEM=="misc", KERNEL=="vfio", MODE="0666"