From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id C840F4705A for ; Tue, 16 Dec 2025 17:12:02 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 910364026D; Tue, 16 Dec 2025 17:12:02 +0100 (CET) Received: from mail-qt1-f178.google.com (mail-qt1-f178.google.com [209.85.160.178]) by mails.dpdk.org (Postfix) with ESMTP id 721914026D for ; Tue, 16 Dec 2025 17:12:01 +0100 (CET) Received: by mail-qt1-f178.google.com with SMTP id d75a77b69052e-4ee0084fd98so41620271cf.3 for ; Tue, 16 Dec 2025 08:12:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytheb-org.20230601.gappssmtp.com; s=20230601; t=1765901520; x=1766506320; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=qLWSyobkvDHULLhqxxUwMyuwx1AkFeL1tRaIzJkL+eI=; b=Z76bfm8CE5v3LA9wtAXD/cLVyCXeTQaxwJ+xB4y40ftgfWXssywhiWgj2pr7UDjXmA zeRYnAUg5sZjZnJtusKq3Pw/8kjEzeUrLfjDItUS4uAagp9HER+u0LOnzG/b4q9URV2Y ao6u2gvtTeTApSFJQpfbJxIXywkf3MemF4VJqsKpa5T77D+bQbd2qu6ebqGaegwVonSD wpUP80sfE/lP5+xM+Y3YXgJcxwdRQdCfH+Zy+a1+IpIYPKe7XdUpaNrp6f1z2+pKzxDK c6vebpkrLEE+8b5okdIlUsGL91bPQn9x512J5bYyL3O6GK8tD+8va1xfvbFVsoExboUF +zZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765901520; x=1766506320; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg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source: AGHT+IHL7b+ez5mNEn2eTkBcEcNhHTBl16Ay2KRRyoRPRFkYVtPhNR3rY2fnuqod0ljYeFF+htf01g== X-Received: by 2002:a05:622a:7506:b0:4f1:e97b:2896 with SMTP id d75a77b69052e-4f1e97b38bemr85533141cf.46.1765901519812; Tue, 16 Dec 2025 08:11:59 -0800 (PST) Received: from RHTRH0061144.redhat.com ([47.14.5.10]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-4f345c31460sm18987901cf.17.2025.12.16.08.11.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Dec 2025 08:11:59 -0800 (PST) From: 0-day Robot To: test-report@dpdk.org, Stephen Hemminger Subject: |SUCCESS| pw159212 [PATCH v5 01/17] eal: use C library to parse filesystem table Date: Tue, 16 Dec 2025 11:11:57 -0500 Message-ID: <20251216161157.762451-1-robot@bytheb.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251207191242.165619-2-stephen@networkplumber.org> References: <20251205022948.327743-1-stephen@networkplumber.org> <20251207191242.165619-1-stephen@networkplumber.org> <20251207191242.165619-2-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: test-report@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: automatic DPDK test reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: test-report-bounces@dpdk.org Test-Label: 0day Robot - Claude SONNET Test-Status: SUCCESS http://dpdk.org/patch/159212 _AI Review Comments Available_ Git SHA: cd60dcd503 Author: Stephen Hemminger Subject: eal: use C library to parse filesystem table This patch replaces custom string parsing of /proc/mounts with standard C library routines getmntent_r() and related functions to parse the filesystem mount table. > Rather than doing parsing of /proc/mounts with open coded string > handling, use the standard C library routines. > These exist in BSD and Linux. > > It also avoids any possible issues with escaped strings etc > which the library handles. See getmntent(3) man page. > > Signed-off-by: Stephen Hemminger > Acked-by: Bruce Richardson > --- > lib/eal/linux/eal_hugepage_info.c | 58 ++++++++++--------------------- > 1 file changed, 18 insertions(+), 40 deletions(-) > > diff --git a/lib/eal/linux/eal_hugepage_info.c b/lib/eal/linux/eal_hugepage_info.c > index d47a19c56a..7161b1a2fb 100644 > --- a/lib/eal/linux/eal_hugepage_info.c > +++ b/lib/eal/linux/eal_hugepage_info.c > @@ -13,6 +13,7 @@ > #include > #include > #include > +#include > #include > #include [ ... ] > @@ -226,56 +217,43 @@ get_hugepage_dir(uint64_t hugepage_sz, char *hugedir, int len) > return -1; > } > > - FILE *fd = fopen(proc_mounts, "r"); > - if (fd == NULL) > + FILE *mounts = setmntent(proc_mounts, "r"); > + if (mounts == NULL) > rte_panic("Cannot open %s\n", proc_mounts); > > if (default_size == 0) > default_size = get_default_hp_size(); > > - while (fgets(buf, sizeof(buf), fd)){ > + while (getmntent_r(mounts, &entry, buf, sizeof(buf))) { Does this code check for ENOENT or ERANGE return values from getmntent_r()? The function can return NULL but set errno to indicate different types of failures, and partial reads might cause issues. > const char *pagesz_str; > - size_t mountpt_len = 0; > - > - if (rte_strsplit(buf, sizeof(buf), splitstr, _FIELDNAME_MAX, > - split_tok) != _FIELDNAME_MAX) { > - EAL_LOG(ERR, "Error parsing %s", proc_mounts); > - break; /* return NULL */ > - } > + uint64_t pagesz = default_size; > + size_t mountpt_len; > > - if (strncmp(splitstr[FSTYPE], hugetlbfs_str, htlbfs_str_len) != 0) > + if (strcmp(entry.mnt_type, "hugetlbfs") != 0) > continue; > > - pagesz_str = strstr(splitstr[OPTIONS], pagesize_opt); > + pagesz_str = strstr(entry.mnt_opts, pagesize_opt); > + if (pagesz_str) > + pagesz = rte_str_to_size(&pagesz_str[pagesize_opt_len]); Could entry.mnt_opts be NULL? The mntent structure fields might not always be populated, and strstr() would segfault on a NULL pointer. Also, does rte_str_to_size() handle malformed input gracefully? If the pagesize option exists but has invalid data, this could cause issues. [ ... ]