From patchwork Wed Feb 8 09:30:16 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: 54309 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp3355889wrn; Wed, 8 Feb 2023 01:33:42 -0800 (PST) X-Google-Smtp-Source: AK7set/ZdYUsbzyTbvQs11WBbZxGrQvzaFy9NnfnuM6vJeXkOikEjX9xtxXckbFsIr2V5IBrvmS3 X-Received: by 2002:a05:6a20:e416:b0:bc:ce49:79a7 with SMTP id nh22-20020a056a20e41600b000bcce4979a7mr5027565pzb.18.1675848822023; Wed, 08 Feb 2023 01:33:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675848822; cv=none; d=google.com; s=arc-20160816; b=bDxuF4SrqE180W25VUZ6uv+gX9XrMqBIuGtJW/ldrPJkxaMDPvkJJhZzFFcfRDXO07 akePl1nV2P+QhfsTCyjf8YjvLr/8iZ2FY3lba6tPdmWETRv00VE90H/z4iGD6g49wr60 fPkA6me1ro/otEsd56f65XOL1GZujFspocMEQLn8W2nAjTrZhFHaC/v9m14k9FaMzv9V QjMJwoPodCFsPIBhuXBRtuwPP95/FxehuhbMIZUrmCO4eGJAkTafqrqicH/8YyGjy8XV 3I3dGlRVcJ/EcCaPbniwiD2DO5qMf4Si+QRV50KO3LkCHpbuA7J3BrloPQWmHG276tIY HWlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=WWziEUBiv2cNxkI7jhj0LDfn+uGaNzZzDKFUuFVFm68=; b=kAGU5R0biDc57UPQV+8spsQ/PDhqlx0+93m6ETFssd+9/uWsuJWSSY0tZEMPRXkRBZ nd7JB+eO4rcUsRwLBtpgvxqMKbhUegWBkoimD5rveUXzo+UvKOt/b1bUl5ZzgfgSRgwd /gu0xZwTgG0zyshwS0bgTv+IH+sT9UYuRpeR+e3lv4KGWuqUQH44w9pTviTSUfSlKcwt RwwhtXRtifUw5Qm9rKk+9cC/f0kFX1ISEXWlXXOVdjPQG1qpW8WhCV/KKiMEO72JK2+0 VhbT0woNCF1e7b0h+7emilyqVvpdZR4s2GL86Spk6S26siMadsDPlhaQnS8qQMwjD8HL gEeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=b3tHZEIn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m25-20020a638c19000000b004fabbf79150si14243716pgd.307.2023.02.08.01.33.29; Wed, 08 Feb 2023 01:33:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=b3tHZEIn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230252AbjBHJcB (ORCPT + 99 others); Wed, 8 Feb 2023 04:32:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48298 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230450AbjBHJba (ORCPT ); Wed, 8 Feb 2023 04:31:30 -0500 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5973110D0; Wed, 8 Feb 2023 01:31:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1675848668; x=1707384668; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=+bOX5BBL2eeaqq9jlV7GStORno+/xHgQmrDAzhBVJp8=; b=b3tHZEInbL1Y/IOeHZFaj6WNemZWaGaQYcLWplGAR9lHGpvYT9XH7bYC YL9ERzUOBGt5FrJnH9K3iAJwtVHmH7hlMQvPjLQOXTho2amSqtHL0rnO7 QJPrcWfzebx59+Emp+5GmXUdo/xLCvtCu6lZ5T0w8hJeAPODoFYz0LnLU RduwV99vStVg3lE0VAhlD6iAGvtXJPg7z98xcN/8iNU57cwRDCX/xYqA+ 71W6itIFKfS5GCVZ/VX3OQ0pQp1E+8zCTLInGZr0leQdk7kK5xjRlv61f EZZbZLu8n4lpIz7bN0Me6i8AyTE+girQwxeQwJtrwZ7tE5j0jxav9gYQK Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10614"; a="415974570" X-IronPort-AV: E=Sophos;i="5.97,280,1669104000"; d="scan'208";a="415974570" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2023 01:30:41 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10614"; a="697613971" X-IronPort-AV: E=Sophos;i="5.97,280,1669104000"; d="scan'208";a="697613971" Received: from jstelter-mobl.ger.corp.intel.com (HELO ijarvine-MOBL2.ger.corp.intel.com) ([10.252.38.39]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2023 01:30:38 -0800 From: =?utf-8?q?Ilpo_J=C3=A4rvinen?= To: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Reinette Chatre , Fenghua Yu , Shuah Khan , Babu Moger , Sai Praneeth Prakhya Cc: =?utf-8?q?Ilpo_J=C3=A4rvinen?= Subject: [PATCH 4/4] selftests/resctrl: Check for return value after write_schemata() Date: Wed, 8 Feb 2023 11:30:16 +0200 Message-Id: <20230208093016.20670-5-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230208093016.20670-1-ilpo.jarvinen@linux.intel.com> References: <20230208093016.20670-1-ilpo.jarvinen@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757254854510464989?= X-GMAIL-MSGID: =?utf-8?q?1757254854510464989?= MBA test case writes schemata but it forgets to check if the write is successful or not. Hence, add the check and return error properly. Fixes: 01fee6b4d1f9 ("selftests/resctrl: Add MBA test") Co-developed-by: Fenghua Yu Signed-off-by: Fenghua Yu Signed-off-by: Ilpo Järvinen --- tools/testing/selftests/resctrl/mba_test.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/resctrl/mba_test.c b/tools/testing/selftests/resctrl/mba_test.c index f32289ae17ae..97dc98c0c949 100644 --- a/tools/testing/selftests/resctrl/mba_test.c +++ b/tools/testing/selftests/resctrl/mba_test.c @@ -28,6 +28,7 @@ static int mba_setup(int num, ...) struct resctrl_val_param *p; char allocation_str[64]; va_list param; + int ret; va_start(param, num); p = va_arg(param, struct resctrl_val_param *); @@ -45,7 +46,11 @@ static int mba_setup(int num, ...) sprintf(allocation_str, "%d", allocation); - write_schemata(p->ctrlgrp, allocation_str, p->cpu_no, p->resctrl_val); + ret = write_schemata(p->ctrlgrp, allocation_str, p->cpu_no, + p->resctrl_val); + if (ret < 0) + return ret; + allocation -= ALLOCATION_STEP; return 0;