Message ID | 20230215130605.31583-5-ilpo.jarvinen@linux.intel.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp180591wrn; Wed, 15 Feb 2023 05:09:36 -0800 (PST) X-Google-Smtp-Source: AK7set8xqJssEklKKAxkoUeAlljji7HhwTg1Oo3d1Uiysk7tArwaF1nlX/HgQur5aAEAMHhk1q7h X-Received: by 2002:a05:6a20:35a5:b0:bd:c7b2:725e with SMTP id j37-20020a056a2035a500b000bdc7b2725emr1501373pze.22.1676466576542; Wed, 15 Feb 2023 05:09:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676466576; cv=none; d=google.com; s=arc-20160816; b=DqBasWy6aYfG+DdhRvr/y8TKZ0dl+FL4zRjayvrDQK6g4QfM3VhG9EhpB5qA1iJySn OyZ8d5eIqsUc9KJSYQdwp+P6zvDBbaoUtEdybAZc9nXY7VaB+XIPqm60lceY8Z5hvLOc 1N7iLoCGgWv4S9boi0boBpg5n9RT7bAGI/Lk9JTG8oKhPeCUq88RlMTf/q8c4qjrVcwf P8MN1M7vx+dJWBg4MK8HcRqVnS5hwFuaFLnSsX24cf18rCowkUHE7VJbc/qI9hI/XbtW /UDv8VtLhyccw7zPCEt4M5CqtpsCFv6PlKRx4khMaaQtyWTeHOmvntVV0ev77aHn8vTD 7q6A== 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=aVcQUpS3nOXEqvIrd+IybVfPcMuRCtiMwjfAG/2vB0g=; b=N8kBZ0FgxDPBd+DycQHRGw6FiawLELFs+eSkR95xuDS1b5dePuTGHySD3sV2VT/5Ni NUdCNbJWeVfqXCTRJ3jsEvckMqpvxmiVQf/U4du4r4PzuG5hnyegNupMUcnM3R1bmL2N 97+s6JTJ2QH/KJPxb6EuWIV0ZQVmVkspl5A4w3c3hF9Eiq4ad9eQwgBx8s/USuUwT0Bu pc9ZkaS8sr+M97VzPnYwxoHFAELptGlXZQ/nfAgNWgExb15YpRMPztC81g7xU+RVW2VK zu1asX/FWwuzdvwLefRmakR5+d/WqpiFWp2KkaXfozUprnoKOBy3NiV4HPtZXivFIh2/ yjew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=LSZNhPqQ; 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 l190-20020a6391c7000000b004fb99dd149fsi10153505pge.239.2023.02.15.05.09.23; Wed, 15 Feb 2023 05:09:36 -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=LSZNhPqQ; 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 S234037AbjBONGp (ORCPT <rfc822;tebrre53rla2o@gmail.com> + 99 others); Wed, 15 Feb 2023 08:06:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234106AbjBONGh (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 15 Feb 2023 08:06:37 -0500 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 54F2738B56; Wed, 15 Feb 2023 05:06:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1676466393; x=1708002393; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=4x8SNti8bzuAAFLkH7pvwnNAsALE/29/ahp/VHLzAMg=; b=LSZNhPqQ7oRTtDVKW6sPfLMOcuC3amyGCJ8Ptm0L3H82yum/AJf15icI LMP/XiPXDNRw/WubMxsZ0ww983vz8bb/uaq+ZsazVZMJnYSmkrHZlUsjf U1hbrZbKawOQO3yGleMjSMED7RAd5q/cM2fITb3EICt7t/7BQrTWMIbgg NYvqPVQCbsgLhjIrYS+jOEjqDte6MCaMSY+dFoajqxtQlyGX93joqfWTg ffYIU+tTKNe15EiiWbTZiIt0b8aaUZnerXo1EWoln31pjTaHHch3YA5ES HMyNwVWGhgerCK2wVYRVKvXgFSj22rs/Ns7uiNd5+ZPfaUaxc+AQ4FQMb g==; X-IronPort-AV: E=McAfee;i="6500,9779,10621"; a="319456268" X-IronPort-AV: E=Sophos;i="5.97,299,1669104000"; d="scan'208";a="319456268" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Feb 2023 05:06:33 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10621"; a="812436060" X-IronPort-AV: E=Sophos;i="5.97,299,1669104000"; d="scan'208";a="812436060" Received: from hshannan-mobl1.ger.corp.intel.com (HELO ijarvine-MOBL2.ger.corp.intel.com) ([10.252.49.120]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Feb 2023 05:06:30 -0800 From: =?utf-8?q?Ilpo_J=C3=A4rvinen?= <ilpo.jarvinen@linux.intel.com> To: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Reinette Chatre <reinette.chatre@intel.com>, Fenghua Yu <fenghua.yu@intel.com>, Shuah Khan <shuah@kernel.org>, Babu Moger <babu.moger@amd.com>, Sai Praneeth Prakhya <sai.praneeth.prakhya@intel.com> Cc: =?utf-8?q?Ilpo_J=C3=A4rvinen?= <ilpo.jarvinen@linux.intel.com> Subject: [PATCH v2 4/9] selftests/resctrl: Check for return value after write_schemata() Date: Wed, 15 Feb 2023 15:06:00 +0200 Message-Id: <20230215130605.31583-5-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230215130605.31583-1-ilpo.jarvinen@linux.intel.com> References: <20230215130605.31583-1-ilpo.jarvinen@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757902617328447539?= X-GMAIL-MSGID: =?utf-8?q?1757902617328447539?= |
Series |
selftests/resctrl: Fixes to error handling logic and cleanups
|
|
Commit Message
Ilpo Järvinen
Feb. 15, 2023, 1:06 p.m. UTC
MBA test case writes schemata but it does not check if the write is successful or not. Add the error check and return error properly. Fixes: 01fee6b4d1f9 ("selftests/resctrl: Add MBA test") Co-developed-by: Fenghua Yu <fenghua.yu@intel.com> Signed-off-by: Fenghua Yu <fenghua.yu@intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> --- tools/testing/selftests/resctrl/mba_test.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
Comments
Hi Ilpo, On 2/15/2023 5:06 AM, Ilpo Järvinen wrote: > MBA test case writes schemata but it does not check if the write is > successful or not. > > Add the error check and return error properly. > > Fixes: 01fee6b4d1f9 ("selftests/resctrl: Add MBA test") > Co-developed-by: Fenghua Yu <fenghua.yu@intel.com> > Signed-off-by: Fenghua Yu <fenghua.yu@intel.com> > Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> > --- Thank you Reviewed-by: Reinette Chatre <reinette.chatre@intel.com> Reinette
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;