From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f46.google.com (mail-pa0-f46.google.com [209.85.220.46]) by dpdk.org (Postfix) with ESMTP id CD1B1B62 for ; Wed, 9 Dec 2015 17:38:52 +0100 (CET) Received: by pabur14 with SMTP id ur14so32280405pab.0 for ; Wed, 09 Dec 2015 08:38:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=DX73wTrvD+KLopSn7Cl/f04cM2W5JVehb173C4tSAdw=; b=oGxPx0VVE5c9FaQQuif097pz9xQZgcDgheoHaqxuYpI1ldhkElnLxAKVmA3rgf0g/f 6ZC0BXiiEEc8xISXi9hZmiOxJIkfhTzG3smVAp7P64BMVL0hFHLDAwfbzd09aNw1gjuw NNs+VAIFNnfs3K04p0JYjIkQdJrK89JoXsBRuJDC0D9UX2iX6bzvucGfAFKQ6wHkp4X8 EUHnyFwldazvaLVYtMTm1au8FiwBlzwSTi2eK/fdLEDML2i3bZNFl7mUDrVyVKPBzi8q Ss8nW9+PnLuTlKPNoGxYGA8k1Dnqp6yEuPDxR26Ne5ll8NQqEpHGG5NnXzHAeuS05Wmz 6dxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=DX73wTrvD+KLopSn7Cl/f04cM2W5JVehb173C4tSAdw=; b=GJDMgk0dVzKESCPPrGesZo6S0zM4NGjEH4x3ZEp81zzsnsnqvznF23z83NGLQNSVfL RoqvYsYJYFunwBC2qb95FrXw3S4LojyugSG++aXU59t5RW/45kl/t41Jzn9NXuyoph+R nTk2jv9Qpg+QxVStmHxhyWRu/R3Q59OauXvmPYgrRKLGoEujECwxqySnRrKlt9aHP6d7 unzTokri7/pr9ld5X7Yqa/uUS1uqNIGIZHCBiQSnzDKYIoxIpFUBb+di4NRvLK4o5SVm cPx1eI86eY7LVSzJ9Mj4/CbmyC96qi41foaViDgHZ1rJhP1fKd9zaU7w5ksOEypNB997 c+nA== X-Gm-Message-State: ALoCoQnQJHbosr37sv5VdRGRLG9ZdqCOfiwwBjVqLxg4DLp+S0AWXfYDz8qzdrRZwbhqVEi0zBhYMFI2ubte1igf2SKs2P+BKQ== X-Received: by 10.66.236.229 with SMTP id ux5mr7738755pac.91.1449679132094; Wed, 09 Dec 2015 08:38:52 -0800 (PST) Received: from xeon-e3 (static-50-53-82-155.bvtn.or.frontiernet.net. [50.53.82.155]) by smtp.gmail.com with ESMTPSA id f67sm12744621pfd.9.2015.12.09.08.38.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Dec 2015 08:38:51 -0800 (PST) Date: Wed, 9 Dec 2015 08:38:58 -0800 From: Stephen Hemminger To: Kamil Rytarowski Message-ID: <20151209083858.6e812d0a@xeon-e3> In-Reply-To: <1449667198-27218-2-git-send-email-Kamil.Rytarowski@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> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH v5 2/2] eal/linux: Add support for handling built-in kernel modules X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2015 16:38:53 -0000 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. > - while (!feof(fd)) { > - n = fscanf(fd, "%29s %*[^\n]", mod_name); > - if ((n == 1) && !strcmp(mod_name, module_name)) { > - ret = 1; > - break; > - } > + > + /* A module might be built-in, therefore try sysfs */ > + n = snprintf(sysfs_mod_name, PATH_MAX, "/sys/module/%s", module_name);