From patchwork Tue Aug 4 12:30:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin King X-Patchwork-Id: 262732 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.0 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D92CEC433E0 for ; Tue, 4 Aug 2020 12:33:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C5467207FC for ; Tue, 4 Aug 2020 12:33:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727039AbgHDMaf (ORCPT ); Tue, 4 Aug 2020 08:30:35 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:47558 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726533AbgHDMaU (ORCPT ); Tue, 4 Aug 2020 08:30:20 -0400 Received: from 1.general.cking.uk.vpn ([10.172.193.212] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1k2w57-0005bE-2S; Tue, 04 Aug 2020 12:30:13 +0000 From: Colin King To: "David S . Miller" , Shuah Khan , netdev@vger.kernel.org, linux-kselftest@vger.kernel.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] selftests/net: skip msg_zerocopy test if we have less than 4 CPUs Date: Tue, 4 Aug 2020 13:30:12 +0100 Message-Id: <20200804123012.378750-1-colin.king@canonical.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Colin Ian King The current test will exit with a failure if it cannot set affinity on specific CPUs which is problematic when running this on single CPU systems. Add a check for the number of CPUs and skip the test if the CPU requirement is not met. Signed-off-by: Colin Ian King --- tools/testing/selftests/net/msg_zerocopy.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/testing/selftests/net/msg_zerocopy.sh b/tools/testing/selftests/net/msg_zerocopy.sh index 825ffec85cea..97bc527e1297 100755 --- a/tools/testing/selftests/net/msg_zerocopy.sh +++ b/tools/testing/selftests/net/msg_zerocopy.sh @@ -21,6 +21,11 @@ readonly DADDR6='fd::2' readonly path_sysctl_mem="net.core.optmem_max" +if [[ $(nproc) -lt 4 ]]; then + echo "SKIP: test requires at least 4 CPUs" + exit 4 +fi + # No arguments: automated test if [[ "$#" -eq "0" ]]; then $0 4 tcp -t 1