Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp571566rwb; Thu, 6 Oct 2022 01:04:30 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6d+hp9XL6C28Ac2qNqcTn8HUDmSTCBtXrq7xNBgO6Y9fAsk9YkV1bwaVhRkEXTpfQKybaG X-Received: by 2002:a17:907:969e:b0:782:6b92:6b1f with SMTP id hd30-20020a170907969e00b007826b926b1fmr2894692ejc.140.1665043469923; Thu, 06 Oct 2022 01:04:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665043469; cv=none; d=google.com; s=arc-20160816; b=u7fgBnl+nh1FqjivpDiWa4ZGwSW8Udrho/nJp5a6LtNffMRTQLdf5RtiFH87BpgdVu czuG4XQF4rxLVoZqqp245KGgvIzgO6VIdXxDcU3Roc4kS4h3YL3ovgqcqiVTTcPydY7K krikocRbcdqPlQgydg8ISP7oX9Ysz09GD8Zu9yH4uxm2YCpcmrUW3qhqH7//WI4/sROH OoiKdErCpxaYduOu+QKieW9gSC6uNn33+pUviDhV4Sl5cvC7v7KEPZ2zq99Xpg19pIjK flOqLDfkuljYrRmPspjtgm15JTcHlbg8Kgib+EUVTEhxFjZubIvX4k2MM327pKqvcwrx Ywog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:mail-followup-to:message-id:subject:cc:to:from:date :dkim-signature; bh=rBenCr/sddYb9hESJpfA+ABk7j5KAPKQpHD+BrNJZy8=; b=goLK+2hHXRteogAQfJQv4HCW1EZzRKqwzUmryfMfCK9Z6PXICUTMFMrW6x3BGElASu G30R2oFjt1ntG1gIlZM1zIabdBwz5Tgj70UBl1xmHwIfaVSK9NhnjQmpLB366btbtIhM nZwa/YIyiFs04yiOukgfmGxoBRVua33vDLy19TQIxqdI+kzaJm8qslXrm14FP6c8vCbB F6UBCp+/VIROFIahjHQ6xle74tGTm1AIC8ULKI/YIz+WiEeHjcjm+DAhskmVLJW6u/af 0OMmxJXP5imqfpBmojDwUAT8/zq3hXbtmjeeLKge+L5rqyjGa+tFlKYCm344GsP6eoTj 1YDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ZkdgVnei; 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=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hu9-20020a170907a08900b0078219af8361si15764369ejc.883.2022.10.06.01.04.02; Thu, 06 Oct 2022 01:04:29 -0700 (PDT) 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=@redhat.com header.s=mimecast20190719 header.b=ZkdgVnei; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230243AbiJFH1Q (ORCPT + 99 others); Thu, 6 Oct 2022 03:27:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230138AbiJFH1N (ORCPT ); Thu, 6 Oct 2022 03:27:13 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C6F3C8993C for ; Thu, 6 Oct 2022 00:27:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1665041229; 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: in-reply-to:in-reply-to:references:references; bh=rBenCr/sddYb9hESJpfA+ABk7j5KAPKQpHD+BrNJZy8=; b=ZkdgVneihp+d6kHeOL92tTV1I2VFvA+4gdFq7EvhyvXNcClHMgUXpZB3tOZgzaU/Eme/V9 xP2iq0mWix2kpTOQI7vWoEttI0gwyrPUj78W1ihx/6eydSzOjaaMRcSwnYmwqIFLt9E1yN mgb/Q2JrYah/iHmDUTWYxPSyHiK37Cw= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-269-wYbxRUKcMDGrqZYky-yHUw-1; Thu, 06 Oct 2022 03:27:05 -0400 X-MC-Unique: wYbxRUKcMDGrqZYky-yHUw-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E9AC7862FDC; Thu, 6 Oct 2022 07:27:04 +0000 (UTC) Received: from samus.usersys.redhat.com (unknown [10.43.17.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A936239DB3; Thu, 6 Oct 2022 07:27:03 +0000 (UTC) Date: Thu, 6 Oct 2022 09:27:01 +0200 From: Artem Savkov To: Andrii Nakryiko Cc: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , bpf@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, jbenc@redhat.com Subject: Re: [PATCH bpf-next] selftests/bpf: make libbpf_probe_prog_types testcase aware of kernel configuration Message-ID: Mail-Followup-To: Andrii Nakryiko , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , bpf@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, jbenc@redhat.com References: <20220930110900.75492-1-asavkov@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, 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: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 03, 2022 at 05:03:18PM -0700, Andrii Nakryiko wrote: > On Sun, Oct 2, 2022 at 11:56 PM Artem Savkov wrote: > > > > On Fri, Sep 30, 2022 at 04:06:41PM -0700, Andrii Nakryiko wrote: > > > On Fri, Sep 30, 2022 at 4:09 AM Artem Savkov wrote: > > > > > > > > At the moment libbpf_probe_prog_types test iterates over all available > > > > BPF_PROG_TYPE regardless of kernel configuration which can exclude some > > > > of those. Unfortunately there is no direct way to tell which types are > > > > available, but we can look at struct bpf_ctx_onvert to tell which ones > > > > are available. > > > > > > > > Signed-off-by: Artem Savkov > > > > --- > > > > > > Many selftests assume correct kernel configuration which is encoded in > > > config and config. files. So it seems fair to assume that all > > > defined program types are available on kernel-under-test. > > > > Ok. Wasn't sure if this is the assumption being made. > > > > > If someone is running selftests under custom more minimal kernel they > > > can use denylist to ignore specific prog type subtests? > > > > Thanks for the suggestion. Denylist is a bit too broad in this case as > > it means we'll be disabling the whole libbpf_probe_prog_types test while > > only a single type is a problem. Looks like we'll have to live with a > > downstream-only patch in this case. > > Allow/deny lists allow to specify subtests as well, so you can have > very granular control. E.g., > > [vmuser@archvm bpf]$ sudo ./test_progs -a 'libbpf_probe_prog_types/*SK*' > Failed to load bpf_testmod.ko into the kernel: -22 > WARNING! Selftests relying on bpf_testmod.ko will be skipped. > #96/8 libbpf_probe_prog_types/BPF_PROG_TYPE_CGROUP_SKB:OK > #96/14 libbpf_probe_prog_types/BPF_PROG_TYPE_SK_SKB:OK > #96/16 libbpf_probe_prog_types/BPF_PROG_TYPE_SK_MSG:OK > #96/21 libbpf_probe_prog_types/BPF_PROG_TYPE_SK_REUSEPORT:OK > #96/30 libbpf_probe_prog_types/BPF_PROG_TYPE_SK_LOOKUP:OK > #96 libbpf_probe_prog_types:OK > Summary: 1/5 PASSED, 0 SKIPPED, 0 FAILED > > > As you can see each program type is a subtest, so you can pick and > choose which ones to run. Right, didn't know it can do that. Thanks for the pointer. -- Artem