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: 11700337 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 12826913 for ; Tue, 4 Aug 2020 12:33:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 11F0C208A9 for ; Tue, 4 Aug 2020 12:33:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726947AbgHDMaZ (ORCPT ); Tue, 4 Aug 2020 08:30:25 -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: linux-kselftest-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@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 Acked-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