From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kamil Rytarowski Subject: Re: [PATCH v5 2/2] eal/linux: Add support for handling built-in kernel modules Date: Wed, 9 Dec 2015 17:45:48 +0100 Message-ID: <56685ABC.9060803@caviumnetworks.com> References: <1449588833-485-1-git-send-email-Kamil.Rytarowski@caviumnetworks.com> <1449667198-27218-1-git-send-email-Kamil.Rytarowski@caviumnetworks.com> <1449667198-27218-2-git-send-email-Kamil.Rytarowski@caviumnetworks.com> <20151209083858.6e812d0a@xeon-e3> Mime-Version: 1.0 Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org To: Stephen Hemminger Return-path: Received: from na01-by2-obe.outbound.protection.outlook.com (mail-by2on0100.outbound.protection.outlook.com [207.46.100.100]) by dpdk.org (Postfix) with ESMTP id A84233195 for ; Wed, 9 Dec 2015 17:46:04 +0100 (CET) In-Reply-To: <20151209083858.6e812d0a@xeon-e3> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" W dniu 09.12.2015 o 17:38, Stephen Hemminger pisze: > On Wed, 9 Dec 2015 14:19:58 +0100 > Kamil Rytarowski wrote: > >> + /* Check if there is sysfs mounted */ >> + if (stat("/sys/module", &st) != 0) { >> + RTE_LOG(DEBUG, EAL, "sysfs is not mounted! error %i (%s)\n", >> + errno, strerror(errno)); >> return -1; >> } > This check is redundant. Remove it. > If the later "/sys/module/foo" would fail if /sys/module was not present. This check isn't redundant. It checks different thing (sysfs mounted vs module loaded) and formulates different error message. Please see pci_vfio_enable(): module_vfio_type1 = rte_eal_check_module("vfio_iommu_type1"); /* return error directly */ if (module_vfio_type1 == -1) { RTE_LOG(INFO, EAL, "Could not get loaded module details!\n"); return -1; } /* return 0 if VFIO modules not loaded */ if (module_vfio_type1 == 0) { RTE_LOG(INFO, EAL, "VFIO modules not all loaded, " "skip VFIO support...\n"); return 0; }