From nobody Fri Dec 19 04:07:42 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 48FFFE784B0 for ; Mon, 2 Oct 2023 09:49:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236268AbjJBJtg (ORCPT ); Mon, 2 Oct 2023 05:49:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41286 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236263AbjJBJte (ORCPT ); Mon, 2 Oct 2023 05:49:34 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 15B02AC; Mon, 2 Oct 2023 02:49:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1696240172; x=1727776172; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=74ZZ/564V4oDiXOyHfqgSxaGtj8l14K+TxF0BdYOyXM=; b=Rw4xOaGsK3ECrjctpWCSRWGZe849jkgHcFD1YdvgNJD1HXAXmM/hcD7L 5ok8f7r/uhJpE4Z/AeVLhi0jYN3LfC1ezK4Yd6Y23a+Zd2TGxLS9Q72bJ fnDRI3LsMG6Qx699qEwxkOe577iglHcxM2SS4XwLQSe7IFwIeTGO6f+Lf Q8QeAPQMS2bOXCH+s1mV2r6iAHkZ6nG5/Tuf8VU1WWLeQbGVfA0RqXi3P o7Wc7lDMIUOpFHrGcNJqDLpMzD1+sTytLuPMcIt25U6MeyJqbwjP1JOoK Sza0tjYIgmZtDokhUQJjweKmXkdBi6So4HyCk8BdVPBPc8pDNQYN9KKZn w==; X-IronPort-AV: E=McAfee;i="6600,9927,10850"; a="381495440" X-IronPort-AV: E=Sophos;i="6.03,194,1694761200"; d="scan'208";a="381495440" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Oct 2023 02:49:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10850"; a="866456931" X-IronPort-AV: E=Sophos;i="6.03,194,1694761200"; d="scan'208";a="866456931" Received: from aanantha-mobl.gar.corp.intel.com (HELO localhost) ([10.251.221.191]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Oct 2023 02:49:28 -0700 From: =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= To: linux-kselftest@vger.kernel.org, Shuah Khan , Reinette Chatre , =?UTF-8?q?Maciej=20Wiecz=C3=B3r-Retman?= , Shaopeng Tan Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= Subject: [PATCH v4 6/7] selftests/resctrl: Fix feature checks Date: Mon, 2 Oct 2023 12:48:12 +0300 Message-Id: <20231002094813.6633-7-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20231002094813.6633-1-ilpo.jarvinen@linux.intel.com> References: <20231002094813.6633-1-ilpo.jarvinen@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The MBA and CMT tests expect support of other features to be able to run. When platform only supports MBA but not MBM, MBA test will fail with: Failed to open total bw file: No such file or directory When platform only supports CMT but not CAT, CMT test will fail with: Failed to open bit mask file '/sys/fs/resctrl/info/L3/cbm_mask': No such fi= le or directory It leads to the test reporting test fail (even if no test was run at all). Extend feature checks to cover these two conditions to show these tests were skipped rather than failed. Fixes: ee0415681eb6 ("selftests/resctrl: Use resctrl/info for feature detec= tion") Signed-off-by: Ilpo J=C3=A4rvinen Tested-by: Shaopeng Tan Reviewed-by: Reinette Chatre Reviewed-by: Shaopeng Tan Cc: # selftests/resctrl: Refactor feature check to= use resource and feature name --- tools/testing/selftests/resctrl/resctrl_tests.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/resctrl/resctrl_tests.c b/tools/testin= g/selftests/resctrl/resctrl_tests.c index a19dcc3f8fb0..2bbe3045a018 100644 --- a/tools/testing/selftests/resctrl/resctrl_tests.c +++ b/tools/testing/selftests/resctrl/resctrl_tests.c @@ -130,7 +130,9 @@ static void run_mba_test(const char * const *benchmark_= cmd, int cpu_no) return; } =20 - if (!validate_resctrl_feature_request("MB", NULL) || (get_vendor() !=3D A= RCH_INTEL)) { + if (!validate_resctrl_feature_request("MB", NULL) || + !validate_resctrl_feature_request("L3_MON", "mbm_local_bytes") || + (get_vendor() !=3D ARCH_INTEL)) { ksft_test_result_skip("Hardware does not support MBA or MBA is disabled\= n"); goto cleanup; } @@ -153,7 +155,8 @@ static void run_cmt_test(const char * const *benchmark_= cmd, int cpu_no) return; } =20 - if (!validate_resctrl_feature_request("L3_MON", "llc_occupancy")) { + if (!validate_resctrl_feature_request("L3_MON", "llc_occupancy") || + !validate_resctrl_feature_request("L3", NULL)) { ksft_test_result_skip("Hardware does not support CMT or CMT is disabled\= n"); goto cleanup; } --=20 2.30.2