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 B706B46054; Tue, 14 Jan 2025 21:00:43 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5004440299; Tue, 14 Jan 2025 21:00:43 +0100 (CET) Received: from mail-qk1-f181.google.com (mail-qk1-f181.google.com [209.85.222.181]) by mails.dpdk.org (Postfix) with ESMTP id C639240298 for ; Tue, 14 Jan 2025 21:00:42 +0100 (CET) Received: by mail-qk1-f181.google.com with SMTP id af79cd13be357-7b807057cc9so41130285a.1 for ; Tue, 14 Jan 2025 12:00:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1736884842; x=1737489642; darn=dpdk.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=L0pVekkxcpGim9wl05hqVU4XbR+0VK7TD41ilHkPz4U=; b=Qa5IAMYjPGNKOcsSmHsn+ToAmAUxy5go7fWNBuKXrbEp4S3GX+NzJGE8v/wZLyROLy BAdZsYdKsP1kCIL6TZpixUg8wDN083fIzDYqg/nzSkrJd3hcmbudMlGZGjZ638jPGOKw sDwx3iYILgW4KA3AjlpM7SE84u2nLjku79Q5U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736884842; x=1737489642; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=L0pVekkxcpGim9wl05hqVU4XbR+0VK7TD41ilHkPz4U=; b=dd5mXjfb+NBJ2pKc+boYQCQ3/bmlYLRzDa9v11dCPCUe96D3sFyGgs2+wfu6t7XG/N 5x4H+OI/LHk+bGPcjCKq4ISi9AQ9LV7czWAPKlj2i5evlXE/YN/LuxtahFVFbMt1FA4u xiFNgvh4RZKeRtw1AcTBKvJX+UGdY/ioam3I/+l5dw+vBpCKu6cvxMwmyosEbWn4dowP v0J05CgzBQ/Ua3UMVtUvosaavxG33hwszpH/0yU55JYs2OmGZUEaf2VgjGLU542bEnGr AqZ4+GnAps0OYVkMdw+bSPHBBNB4pZIvnEQucrfQ9RhTRVIrjDguJ/tCSEqbAREr0VZg H84A== X-Gm-Message-State: AOJu0YyLP8P0m0/Owlw7iRcL2B8UuX0mwEhRwm+Hz1b1r3baGUMqSxQp TrWXEW+f2BcDqA9lKZkljUVJsgF/cdoR2QkPLxP10N3GYR9JiqbSuiCk1z2Z92s= X-Gm-Gg: ASbGncsFC+jU5o1inAVaA3nbqJxxyYDjZlX42t4+hp03AaIMVY7hEPdTKqRoJyU1Llm Qh/yZmXljCenEfFDXoMbXtToEo614GrowpmnkkoDtlYz+883tT6ucvfPDPNmES5/zdVsGU2vBFu lPDc3IcvJGTSd9s1l+KVvGopC4zvv57ZqQXvENL7bLHmx6rsokKymZYFvlVriYQ0rU2H+TObHkH SwgtWt8Yy23rpr5A2sqrfga4UdhHN5j7RtBXiEKxuU1pW/mxe3a8pjRbriqv3Iji4Qwc980rhas A+bzjeGjq9WX6SVfsbbYJA== X-Google-Smtp-Source: AGHT+IE6/gFfFt/i/+dYQgvDG6VtEcCtlukkcvemxuP3KNt68+ud1nH5NHh9uuGyUpLqD1IR7K7aCg== X-Received: by 2002:a05:620a:2849:b0:7be:5020:6df1 with SMTP id af79cd13be357-7be50206df4mr90696785a.15.1736884842038; Tue, 14 Jan 2025 12:00:42 -0800 (PST) Received: from localhost.unh.edu ([2606:4100:3880:1271:e2f8:4ec3:8bf3:864c]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7bce3237f0bsm643334685a.7.2025.01.14.12.00.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jan 2025 12:00:41 -0800 (PST) From: Nicholas Pratte To: Honnappa.Nagarahalli@arm.com, luca.vizzarro@arm.com, probb@iol.unh.edu, yoan.picchi@foss.arm.com, thomas.wilks@arm.com, paul.szczepanek@arm.com, dmarx@iol.unh.edu Cc: dev@dpdk.org, Nicholas Pratte Subject: [PATCH] dts: fix hugepage configuration bug Date: Tue, 14 Jan 2025 15:00:38 -0500 Message-ID: <20250114200038.193700-1-npratte@iol.unh.edu> X-Mailer: git-send-email 2.47.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org The dts framework checks for total hugepages of a specific size on a system without first checking if such hugepages are supported. This results in unhelpful error messages, since attempting to grab information from a file/directory that does not exist creates undefined behavior. This quick reorientation of the code prevents this, and allows for easier error assessment. Signed-off-by: Nicholas Pratte --- dts/framework/testbed_model/linux_session.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dts/framework/testbed_model/linux_session.py b/dts/framework/testbed_model/linux_session.py index bda2d448f7..e3732f0827 100644 --- a/dts/framework/testbed_model/linux_session.py +++ b/dts/framework/testbed_model/linux_session.py @@ -90,12 +90,12 @@ def setup_hugepages(self, number_of: int, hugepage_size: int, force_first_numa: ConfigurationError: If the given `hugepage_size` is not supported by the OS. """ self._logger.info("Getting Hugepage information.") - hugepages_total = self._get_hugepages_total(hugepage_size) if ( f"hugepages-{hugepage_size}kB" not in self.send_command("ls /sys/kernel/mm/hugepages").stdout ): raise ConfigurationError("hugepage size not supported by operating system") + hugepages_total = self._get_hugepages_total(hugepage_size) self._numa_nodes = self._get_numa_nodes() if force_first_numa or hugepages_total < number_of: -- 2.47.1