From patchwork Fri Sep 29 11:20:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ilpo_J=C3=A4rvinen?= X-Patchwork-Id: 727924 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 50370E7F156 for ; Fri, 29 Sep 2023 11:22:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233088AbjI2LWE (ORCPT ); Fri, 29 Sep 2023 07:22:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37968 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233102AbjI2LWA (ORCPT ); Fri, 29 Sep 2023 07:22:00 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F109CD3; Fri, 29 Sep 2023 04:21:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1695986515; x=1727522515; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=5l0ZHuykukESFgWvvhf6YnavKoa3byGUAMZS0+yfFSI=; b=HXE2UCMY2u3nmGx39Avlik5FQtNktHAMvCTOEW4nAKH+JPSGEnWxH4dk 7KeP9KcqhBiGpiwxpe4joj/D5ePcwU0TazNd5sEBwsceEwSc1zrgSEap1 htUbr3dCiuSm0zr1HG+NztHeLWaUXPc/2jc2hAF3oDECxO70z/+NwTTy+ +Il+8gMXE2kJhOiBlm4H4xr4r9mIZQ9HLAHEDpu4GS1cc6yRCOLAwENOt 1KlJ8fFecIKJCL62I+qSQ0tV55PbMf6uvlylJqNGsBgggdEo45cvC3U0t 2TLTBPO+J8Qh/LMWQ9ZrQiL57M2p1tLSiOOx5Tmr1UxO7/lInUGbHaIs+ w==; X-IronPort-AV: E=McAfee;i="6600,9927,10847"; a="361655039" X-IronPort-AV: E=Sophos;i="6.03,187,1694761200"; d="scan'208";a="361655039" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Sep 2023 04:21:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10847"; a="996901553" X-IronPort-AV: E=Sophos;i="6.03,187,1694761200"; d="scan'208";a="996901553" Received: from valeks2x-mobl.ger.corp.intel.com (HELO localhost) ([10.252.53.242]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Sep 2023 04:21:51 -0700 From: =?utf-8?q?Ilpo_J=C3=A4rvinen?= To: linux-kselftest@vger.kernel.org, Shuah Khan , Reinette Chatre , =?utf-8?q?Maciej_Wiecz=C3=B3r-?= =?utf-8?q?Retman?= , Shaopeng Tan Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, =?utf-8?q?Ilpo_J?= =?utf-8?q?=C3=A4rvinen?= Subject: [PATCH v3 6/7] selftests/resctrl: Fix feature checks Date: Fri, 29 Sep 2023 14:20:38 +0300 Message-Id: <20230929112039.7488-7-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230929112039.7488-1-ilpo.jarvinen@linux.intel.com> References: <20230929112039.7488-1-ilpo.jarvinen@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@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 file 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 detection") Signed-off-by: Ilpo Järvinen 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/testing/selftests/resctrl/resctrl_tests.c index 7836bf0655fe..063fc3e50e48 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; } - if (!validate_resctrl_feature_request("MB", NULL) || (get_vendor() != ARCH_INTEL)) { + if (!validate_resctrl_feature_request("MB", NULL) || + !validate_resctrl_feature_request("L3_MON", "mbm_local_bytes") || + (get_vendor() != 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; } - 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; }