[dpdk-dev] [PATCH v5 2/2] eal/linux: Add support for handling built-in kernel modules

Kamil Rytarowski krytarowski at caviumnetworks.com
Wed Dec 9 17:45:48 CET 2015



W dniu 09.12.2015 o 17:38, Stephen Hemminger pisze:
> On Wed, 9 Dec 2015 14:19:58 +0100
> Kamil Rytarowski <Kamil.Rytarowski at caviumnetworks.com> 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;
         }



More information about the dev mailing list