Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp3837861rwb; Mon, 5 Sep 2022 20:31:38 -0700 (PDT) X-Google-Smtp-Source: AA6agR60ZhGMSMaGcMZK7IlPW7BFNHkJMVNC3irMy7TQ+Oleuiq+G7cHBBv+qVmuu8tUPNvc9x55 X-Received: by 2002:a17:907:2d2a:b0:76f:ab1:d25b with SMTP id gs42-20020a1709072d2a00b0076f0ab1d25bmr211914ejc.459.1662435097765; Mon, 05 Sep 2022 20:31:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662435097; cv=none; d=google.com; s=arc-20160816; b=bkP7zu7V8hxoLVN/f9XllQMA68z5cL912DoVHEGi7fztZOjVbftkk/CI6xvfkDs01k pZmD2Z1RXkhjrcI3LfrS0W/5kykM4heDWEaeYuIgwybClUgmqvSG/5JyvuugytfjHB19 wboPDJYQYbtoakrl2t1MLSxF8ART+zkmI4X1iw35AZJum4egqfqLxfeadF2K3yMXFJb2 B998lTkgaMS3a+hSqVXvK+rDzt0h1umMoo54/sLjjcpoZpolTAJwRMTHeQVpmt7koDCb vBURVFBarnoGWp3X6bt8E/0kjzoPhRQMoelU0U7zxtLAtzeIrBvLhcxDHVXokKDSQhb7 dCjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=edqEW8K/wxMVRZ77yuARzYVZRubfPFDmCU9QJYmWr3A=; b=XHnC3Atk+j7NrRXpPztPHcI/xy4+1T1p4BH8VV/QIAiLF0zs2NqDc4lC3lDm542X+A CvRuBr8k8mOpRZgj9Lho+/CoYSSjVO7xkGFQEQZ5N9z92zrfDc9w4kT7lzl28qqABvF/ nxx4h86UfGqVLpDdVTZ2PVqcZ+TkiZEa//23lEYE6M/1tFVj6nIWZpoee6O5BzL7EwmU w8XfZB4/ZxXnnVsIzQL415+tMITiHBz2QaKlRN7x30mMYCZ9FcQLQNHHmVuFyI3sIw87 +xpRfcHIundXLqN1jjDgxMKLuRr248hr6DJ/bA7zah89AlgpGi5+C1Ky6HaDFsq1srNQ vQLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=MLwGeAaD; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t21-20020aa7d715000000b0044ea16b9b43si2252946edq.300.2022.09.05.20.31.13; Mon, 05 Sep 2022 20:31:37 -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=@gmail.com header.s=20210112 header.b=MLwGeAaD; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238347AbiIFD3D (ORCPT + 99 others); Mon, 5 Sep 2022 23:29:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51582 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238278AbiIFD2U (ORCPT ); Mon, 5 Sep 2022 23:28:20 -0400 Received: from mail-io1-xd41.google.com (mail-io1-xd41.google.com [IPv6:2607:f8b0:4864:20::d41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D84E76D559; Mon, 5 Sep 2022 20:27:50 -0700 (PDT) Received: by mail-io1-xd41.google.com with SMTP id q81so7953947iod.9; Mon, 05 Sep 2022 20:27:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=edqEW8K/wxMVRZ77yuARzYVZRubfPFDmCU9QJYmWr3A=; b=MLwGeAaD9znffyX/kWEqH875dsCLjLaKVS4+g2FKPQR7nWcZ7pD6/jY9dFb61amb4t hJlTn4vnrh/k8Wuko4UunAbnzAP2Ypu4ybqL5zfK3z6lq0GlOVfWyORMIfOJn6RSDixy mfs2zYMPGjd+EXtn9USuUM5909gZ8I9dLsNuFYsnjwoE4glRl8VT/PwuJcQUpKy5JDb+ slCkhaOv0wplD3HU88SF5Q4+kqG1/usozqeZ+WSA93AHZNJcmYva96j4WUXQnkTexw8J WgtiRWEzHwDTbqhFnLd46Z8SJYeIe/IgxrRxSNdKqcBALSjNRF+P5t9nfmDMZl6A671+ wKrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=edqEW8K/wxMVRZ77yuARzYVZRubfPFDmCU9QJYmWr3A=; b=x9S0xf30rZFMZ7k/ewMIWJPkz3YTHwU6CL278RDDNzpdFGWcJkNJhHxNu2LpVc7SzA RNZJfIZ+HwNGx9C/9EHyotC6LWACxesw7K2hSAUL71pWZFMGC9b+dVN1W+RlzP/F+hz+ L63hDjS1U20Ycbc1s7P9pr22V4N9d703aG6YfNmLUXiMXjQOoRNK/yBaphQyypgsXnrl ncKLgy9OIYKNMveWvmFn1jEbsYKD4VO4bcHR80JWfsnCxGQKd9Q3XwgoxluTb4eVQ2J+ smxXKyxCDZXT5VxPINsfp7Iicyt+kcYn/1TDE2GPaqMMhEuVOVNY0qhjgbED8o1R/dCV SqRg== X-Gm-Message-State: ACgBeo3uhPmvHtJzA+pKXQPnzFnXpgGZXyWlGrnogwNQpVch1Nl7iV7i 6lmVZ+0afNXvn4+yY3M4YMOKwGS4xJLaqYw8M/I= X-Received: by 2002:a05:6638:3802:b0:351:d8a5:6d58 with SMTP id i2-20020a056638380200b00351d8a56d58mr5441296jav.206.1662434870210; Mon, 05 Sep 2022 20:27:50 -0700 (PDT) MIME-Version: 1.0 References: <20220902132938.2409206-1-benjamin.tissoires@redhat.com> <20220902132938.2409206-2-benjamin.tissoires@redhat.com> In-Reply-To: From: Kumar Kartikeya Dwivedi Date: Tue, 6 Sep 2022 05:27:14 +0200 Message-ID: Subject: Re: [PATCH bpf-next v10 01/23] selftests/bpf: regroup and declare similar kfuncs selftests in an array To: Benjamin Tissoires Cc: Greg KH , Jiri Kosina , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Shuah Khan , Dave Marchevsky , Joe Stringer , Jonathan Corbet , Tero Kristo , linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, netdev@vger.kernel.org, bpf@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-doc@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Tue, 6 Sept 2022 at 05:25, Kumar Kartikeya Dwivedi wrote: > > On Fri, 2 Sept 2022 at 15:29, Benjamin Tissoires > wrote: > > > > Similar to tools/testing/selftests/bpf/prog_tests/dynptr.c: > > we declare an array of tests that we run one by one in a for loop. > > > > Followup patches will add more similar-ish tests, so avoid a lot of copy > > paste by grouping the declaration in an array. > > > > To be able to call bpf_object__find_program_by_name(), we need to use > > plain libbpf calls, and not light skeletons. So also change the Makefile > > to not generate light skeletons. > > > > Signed-off-by: Benjamin Tissoires > > > > --- > > I see your point, but this is also a test so that we keep verifying > kfunc call in light skeleton. > Code for relocating both is different in libbpf (we generate BPF ASM > for light skeleton so it is done inside a loader BPF program instead > of userspace). Err, hit send too early. We can probably use a macro to hide how program is called, then do X(prog1) X(prog2) in a series, won't look too bad and avoids duplication at the same time. > You might then be able to make it work for both light and normal skeleton. > WDYT?