Received: by 2002:a05:7412:40d:b0:e2:908c:2ebd with SMTP id 13csp191757rdf; Mon, 20 Nov 2023 22:50:06 -0800 (PST) X-Google-Smtp-Source: AGHT+IGiKkQqYc7d1c08DmmJ3gwuNTEwT0vQ1+nUGF0hOngjNDMtnuxx45ZRHjK13koknS9cnQZY X-Received: by 2002:a17:90b:33d0:b0:27d:5964:4ee6 with SMTP id lk16-20020a17090b33d000b0027d59644ee6mr9994326pjb.2.1700549405766; Mon, 20 Nov 2023 22:50:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700549405; cv=none; d=google.com; s=arc-20160816; b=foY4kzo0z4Z3ZyLuCh2kVyp+KP89sEAa6NvcCfVN5vRRS3MkzxCugd1zZnhZ9D8U/M AKt79NjP+Yu8MRiLOGcWHyFaMNtrPcCo9kG4UktDjAMrj42Z+SXAiyh2s5X9yPsJZmDS OpyxOpGA2x8SCiGKP/bjKalTouDX+2vEwb0Wo99u47w0JG/5TTYZ/w8/G01VA9h4hwrc Z97wTMEhn0iDPFAGKaUjeCgVEaQWXJAJsrYlkCbGKGqueYB84di9E6ugjrQP2HOkmxaJ woQeu5IB90G9QaejWUO9M1rx0cmGr9JvgfMRInJ95fHarrFF0uQxnYWKbisJ54yX7UsD isxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:mime-version:date :dkim-signature:message-id; bh=9BS9UBYsSndFAg/kFykIgLfKwkfc0tziM6o2ZmXP0yc=; fh=bVNnXavJOuIXlvm9QgOND80VFP7K637CvgwD0cPs1eU=; b=gGmWDV6tyYPipzOwUHO+UBENenDnNkPHsGnfhe6LcFK7Mdf8oaPM7nFp/5ijQtWcmA UnxI0vczKqHKUH57HtC7F2ci7jKXIN2MPEXJswvel2s1su2s9WR4KcbOakBCKn049u9c bFBNp0zrHXnnIPUa1rBqc8b8plX2E/aX/EOHwkUagO4N+9w4r3x5rLYk7kfhv8CDDXwU 8aP1/uYnm/fdjmxK2HK10DvG6e9f3pJpYpt1QOBvYG09y/LVWE95yGaIV2LrsJtB/F9t asGC+95R156akQWMuPeCGC/quDO+9KOn1fvBozeAR5otuyDayYkXohgJ0LIPjBYBXvD8 xjQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=qgqcvbKw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id bo19-20020a17090b091300b00283e07a6d3esi7295582pjb.79.2023.11.20.22.50.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Nov 2023 22:50:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=qgqcvbKw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 343F8802F569; Mon, 20 Nov 2023 22:50:03 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229618AbjKUGtx (ORCPT + 99 others); Tue, 21 Nov 2023 01:49:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33184 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229471AbjKUGtw (ORCPT ); Tue, 21 Nov 2023 01:49:52 -0500 Received: from out-187.mta1.migadu.com (out-187.mta1.migadu.com [IPv6:2001:41d0:203:375::bb]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 94EFA90 for ; Mon, 20 Nov 2023 22:49:48 -0800 (PST) Message-ID: <11bf3c0f-f78b-4dd3-97d3-c39b5b2ae7bd@linux.dev> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1700549386; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9BS9UBYsSndFAg/kFykIgLfKwkfc0tziM6o2ZmXP0yc=; b=qgqcvbKwWn9QXxkyQuD1VkO3P4AyGBcuxrKWDxsoKY9R187ET2HSTLU1/mpggl0ZFcCOSo J4HWCyhfEAj0QBgrQ9Otqfwl3Odl6dBAXBJfOD8Jn+f/+BDybL5NQDEZn7c5MB2AuPHU+4 MZlYVZ0uuDvxw/O3hNk3Sj1YR8igVLc= Date: Mon, 20 Nov 2023 22:49:39 -0800 MIME-Version: 1.0 Subject: Re: [PATCH bpf-next v3 0/4] selftests/bpf: Update multiple prog_tests to use ASSERT_ macros Content-Language: en-GB To: Yuran Pereira , bpf@vger.kernel.org Cc: andrii@kernel.org, ast@kernel.org, haoluo@google.com, john.fastabend@gmail.com, jolsa@kernel.org, kpsingh@kernel.org, linux-kernel-mentees@lists.linuxfoundation.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, martin.lau@linux.dev, mykolal@fb.com, sdf@google.com, shuah@kernel.org, song@kernel.org References: X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Yonghong Song In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Mon, 20 Nov 2023 22:50:03 -0800 (PST) On 11/20/23 7:03 PM, Yuran Pereira wrote: > Multiple files/programs in `tools/testing/selftests/bpf/prog_tests/` still > heavily use the `CHECK` macro, even when better `ASSERT_` alternatives are > available. > > As it was already pointed out by Yonghong Song [1] in the bpf selftests the use > of the ASSERT_* series of macros is preferred over the CHECK macro. > > This patchset replaces the usage of `CHECK(` macros to the equivalent `ASSERT_` > family of macros in the following prog_tests: > - bind_perm.c > - bpf_obj_id.c > - bpf_tcp_ca.c > - vmlinux.c > > [1] https://lore.kernel.org/lkml/0a142924-633c-44e6-9a92-2dc019656bf2@linux.dev > > Changes in v3: > - Addressed the following points mentioned by Yonghong Song > - Improved `bpf_map_lookup_elem` assertion in bpf_tcp_ca. > - Replaced assertion introduced in v2 with one that checks `thread_ret` > instead of `pthread_join`. This ensures that `server`'s return value > (thread_ret) is the one being checked, as oposed to `pthread_join`'s > return value, since the latter one is less likely to fail. > > Changes in v2: > - Fixed pthread_join assertion that broke the previous test > > Previous version: > v2 - https://lore.kernel.org/lkml/GV1PR10MB6563AECF8E94798A1E5B36A4E8B6A@GV1PR10MB6563.EURPRD10.PROD.OUTLOOK.COM > v1 - https://lore.kernel.org/lkml/GV1PR10MB6563FCFF1C5DEBE84FEA985FE8B0A@GV1PR10MB6563.EURPRD10.PROD.OUTLOOK.COM > > Yuran Pereira (4): > Replaces the usage of CHECK calls for ASSERTs in bpf_tcp_ca > Replaces the usage of CHECK calls for ASSERTs in bind_perm > Replaces the usage of CHECK calls for ASSERTs in bpf_obj_id > selftests/bpf: Replaces the usage of CHECK calls for ASSERTs in > vmlinux > > .../selftests/bpf/prog_tests/bind_perm.c | 6 +- > .../selftests/bpf/prog_tests/bpf_obj_id.c | 204 +++++++----------- > .../selftests/bpf/prog_tests/bpf_tcp_ca.c | 48 ++--- > .../selftests/bpf/prog_tests/vmlinux.c | 16 +- > 4 files changed, 105 insertions(+), 169 deletions(-) > Ack for the whole series: Acked-by: Yonghong Song Yuran, next time when you submit patches, you can carry 'Acked-by' tag from previous revision if there are no significant changes. This will reduce some of reviewers and maintainers' work.