Received: by 10.223.185.116 with SMTP id b49csp1409347wrg; Wed, 21 Feb 2018 18:35:39 -0800 (PST) X-Google-Smtp-Source: AH8x226y0YKfOr6JtIyVLkYsg3IXFgvxopQ5ZIlYbUKxTbofpEkhBRXHoqVOiZ5dgeXQDTvANAXu X-Received: by 10.99.120.199 with SMTP id t190mr4293611pgc.72.1519266939554; Wed, 21 Feb 2018 18:35:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519266939; cv=none; d=google.com; s=arc-20160816; b=FYuBPDbYE+YQAbb36tRJ0mTYQheU5AyxgW4u53cIebxo+/CHrj3SjE+6eP8FaquUep PaqLMYiia16q8IdEH7sKFXHNMrwrCkNJQSOFu1PBolf7GEzpW838Px3BYtaSBdDY1fvd Fq3Vt11lFcLVrS+yVYdWAmnQyxgLOgFlOcDRl81iDO9FunMuPiz/yGxwnr9htOEgj30q rdr8cxRHOfWIUJRVbuORzQXR1/vnh28e8HttC12w/aV1XPJIHqP2gnxty4xcBwuWqaNE SB58w6TIURpTu8ImirHUJB5sCuQFsijhXEtEw3AktaHDXtioz12TLpTR2ispVzoF1tDB SNEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=AyPtbbyFfsis8Pcbbf0L8OQwe8/nvyd2j47G6gE3Gxg=; b=zEtTTYm78ZvNNulrnxYZoL3UWbOdQSO1GQRnJ6QQ1yP+WxSGEbffOqwe4jj+cBfxDk wu0/rnKg8gKpv84phKND2EyYi9Ca+yOlulDDlFM8RK/AMwbxv8kqmygflzcUR5XxPZVS l2/YtvvMR/JOs/+NfvP0eNXRKjC7gGlK9Y9GDICz2DwPJDREbU044JemTs2OEV9Lqa+g 5OD1xwX0j5KJvvMh+3hw3Li2KGej+FAVJWt38H2DwmB5M3ICwJ7rtRR812YQSYXYBdIb XeK0sC0kh1mytwUsnoyu8DtbhnsDWOxCf9OO3x4608d5BWmarMXRDpf2rs7xEXvbEVD8 hLRA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c129si2650494pfa.362.2018.02.21.18.35.24; Wed, 21 Feb 2018 18:35:39 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751991AbeBVCem (ORCPT + 99 others); Wed, 21 Feb 2018 21:34:42 -0500 Received: from mga09.intel.com ([134.134.136.24]:7819 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751810AbeBVCek (ORCPT ); Wed, 21 Feb 2018 21:34:40 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Feb 2018 18:34:39 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,376,1515484800"; d="scan'208";a="20152533" Received: from tengfeip-mobl.ccr.corp.intel.com (HELO haswell-OptiPlex-9020.ccr.corp.intel.com) ([10.254.212.84]) by orsmga006.jf.intel.com with ESMTP; 21 Feb 2018 18:34:37 -0800 From: Li Zhijian To: shuah@kernel.org, ast@kernel.org, daniel@iogearbox.net, netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, Li Zhijian , Alexei Starovoitov , Philip Li Subject: [PATCH v2] selftests/bpf/test_maps: exit child process without error in ENOMEM case Date: Thu, 22 Feb 2018 10:34:02 +0800 Message-Id: <1519266842-29004-1-git-send-email-lizhijian@cn.fujitsu.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Li Zhijian test_maps contains a series of stress tests, and previously it will break the rest tests when it failed to alloc memory. ----------------------- Failed to create hashmap key=8 value=262144 'Cannot allocate memory' Failed to create hashmap key=16 value=262144 'Cannot allocate memory' Failed to create hashmap key=8 value=262144 'Cannot allocate memory' Failed to create hashmap key=8 value=262144 'Cannot allocate memory' test_maps: test_maps.c:955: run_parallel: Assertion `status == 0' failed. Aborted not ok 1..3 selftests: test_maps [FAIL] ----------------------- after this patch, the rest tests will be continue when it occurs an ENOMEM failure CC: Alexei Starovoitov CC: Philip Li Suggested-by: Daniel Borkmann Signed-off-by: Li Zhijian --- tools/testing/selftests/bpf/test_maps.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/testing/selftests/bpf/test_maps.c b/tools/testing/selftests/bpf/test_maps.c index 436c4c7..9e03a4c 100644 --- a/tools/testing/selftests/bpf/test_maps.c +++ b/tools/testing/selftests/bpf/test_maps.c @@ -126,6 +126,8 @@ static void test_hashmap_sizes(int task, void *data) fd = bpf_create_map(BPF_MAP_TYPE_HASH, i, j, 2, map_flags); if (fd < 0) { + if (errno == ENOMEM) + return; printf("Failed to create hashmap key=%d value=%d '%s'\n", i, j, strerror(errno)); exit(1); -- 2.7.4