Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp7964311rdb; Thu, 4 Jan 2024 13:37:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IF7p/r0FlTZjFZpQDHxb/b5wXSCdJCIyXNlOIpYWtRMiq/jFWKc3QKS0qtse++raTAm1srO X-Received: by 2002:a05:6358:528f:b0:174:b348:3a96 with SMTP id g15-20020a056358528f00b00174b3483a96mr1588218rwa.20.1704404253624; Thu, 04 Jan 2024 13:37:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704404253; cv=none; d=google.com; s=arc-20160816; b=CkEoc3YHNfJbQmVjdlTBC38WdzuMGF2txCiBD7LubGIDIzqSQ1qCIAgRqZi56u8OEB yHcczLGH9PiMS2T6ojF5weIR7MxIhT/VhCj5GEvGxQ64JKt9z2V0fs8NKcmABgLHsrPM KrBHVuFgbCKs11Rih7TtXwqGT24PwG+6O8LZcBXA/Etw5hSXterK5aBbNcRO8iYq2Wsp ZArlzG6VuMvo7Q1Pcr0WXy773jRi3mJvML3i1DXGvc1L9IvHxEiWx/90QmI/hq04tcjV 42qAfQUoo8IbLARLyPTAtc0GdyF++Qm4tq4fGxS/8Iy67Nd1ZS2axemAkPHQ1/QFrnNt FEEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=TswUjOEAhg3N75qmaiYjejtfwKdXhO5F6QGd/S4RM8M=; fh=A0qHSgc+LFI6ONAV7b4P7e9BuXPZptsQo0GTmFK+5gc=; b=BiSnPDXSA7XA+jC7+9OOgFTSxhEzWfxrTAdkHb7MMZEv/o6GwWhlFy/i7vn4MsYC3+ m4fISdHa/VS57PKxZKQ2SYngR+Ri5bj5gRRJ800onq3bwOiqwo48TJfxig0oX7dGJbNo mpELRKB58Ck8KxJ7IAwmd02e7omnn6iTISXcMj+a7hGlGk/edkmi2gFRLA0H14d6ie6j 0DRL58Cqf5WU44Uq9zjL+oShMqag2vi1DmMtWmfE00w6Cc8HZqd/4EvBUQFuvAa72ZQ5 nShgHbZxvCNs3oqURDMGIIDOMGR1GkNN6iGecQsd3JmppLmZXmoL3SZv0nsvRx1xbvHC EayA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=Ok6K8gvc; spf=pass (google.com: domain of linux-kernel+bounces-17250-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17250-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id s1-20020a056a00178100b006dabe46bf98si181771pfg.213.2024.01.04.13.37.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jan 2024 13:37:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-17250-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=Ok6K8gvc; spf=pass (google.com: domain of linux-kernel+bounces-17250-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17250-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 44B1B286E51 for ; Thu, 4 Jan 2024 21:37:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 812382C848; Thu, 4 Jan 2024 21:37:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="Ok6K8gvc" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-qt1-f177.google.com (mail-qt1-f177.google.com [209.85.160.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7DF3D2C844 for ; Thu, 4 Jan 2024 21:37:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-qt1-f177.google.com with SMTP id d75a77b69052e-4280e3ab14fso5584991cf.2 for ; Thu, 04 Jan 2024 13:37:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1704404242; x=1705009042; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=TswUjOEAhg3N75qmaiYjejtfwKdXhO5F6QGd/S4RM8M=; b=Ok6K8gvcELhRDhffY4a7Grals/CAIC3nFzkppm+6pLgxa4iMK5ov1kobIb8INgKM1Z eBI2299XUxr4IJvodPts44xk1nHgxGUvUmKKSUiRsxwHnDub78aUSLFdj4weJooBUDMN vR8KumsSf1kdUQCQ16vl0Fj2KdLe+VUqGlF3+WzIHSsY79KmiGVLAZ0onsW1jRwS6Wfp NZ8yAM7KLCuEZcdcFrve/rwwCnVigHCGhRPaWQTH84mJ13MKwZ5ZAtj+Pf/0kFsKxFyC RGtME8yuJalZDSfJloj5w1ClDQ/PN3aBoE4traVJnrgHfX3LGKLh+Oz105UaJiQsNbkA NiqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704404242; x=1705009042; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=TswUjOEAhg3N75qmaiYjejtfwKdXhO5F6QGd/S4RM8M=; b=HRdZPW+jYwRLAh0wKRMqNIg6vxIeQ+ZsJa/vIhmJM1/syw6Wy6/TlkheARHQghC+ku kvLADUn3wYshKt0l8BQT6XbntIVaoLJp2SntYTaB6Kq4x43EtdXNMeUcm1M+yJtDx8Hv AWxqAeXiRUTVc06CznrCq5X91G2rZNSs5a389fkbuHLb2Dy+lCfcXNAw/td6Zl7oiegA Od5KIJXz3sjmWvW6GU5ld8wZRHmsRpohLgJVADLVz/y+t3kCodKGESfrc0Mdf7vNvJ29 b59xAiBHE+REdYHdOkBgA3IbQrZVHS6+FfA7ukHLyCu+o1vqEdfmbIxGsN2QYLIroXYu HPNw== X-Gm-Message-State: AOJu0YwYZ32E8MHTD2zW5uG2+KIk2OihLhoq8AOruTEVQxvU00knK9iz tWlr+e3x0PDa4K7trq0uy6LczfQS7fn9 X-Received: by 2002:ac8:5bc2:0:b0:427:ea89:dd78 with SMTP id b2-20020ac85bc2000000b00427ea89dd78mr1540779qtb.73.1704404242327; Thu, 04 Jan 2024 13:37:22 -0800 (PST) Received: from [192.168.1.31] (d-65-175-157-166.nh.cpe.atlanticbb.net. [65.175.157.166]) by smtp.gmail.com with ESMTPSA id w26-20020a05622a191a00b0042839736d9fsm150064qtc.19.2024.01.04.13.37.21 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 04 Jan 2024 13:37:22 -0800 (PST) Message-ID: <0d9f51e9-7e07-48dd-bf18-ea28ab6b1e83@google.com> Date: Thu, 4 Jan 2024 16:37:21 -0500 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH bpf-next 2/2] selftests/bpf: add inline assembly helpers to access array elements Content-Language: en-US To: Andrii Nakryiko Cc: Andrii Nakryiko , Alexei Starovoitov , Daniel Borkmann , Song Liu , Yonghong Song , mattbobrowski@google.com, bpf@vger.kernel.org, linux-kernel@vger.kernel.org References: <20240103153307.553838-1-brho@google.com> <20240103153307.553838-3-brho@google.com> From: Barret Rhoden In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 1/3/24 14:51, Andrii Nakryiko wrote: >> + >> +/* >> + * Helper to load and run a program. >> + * Call must define skel, map_elems, and bss_elems. >> + * Destroy the skel when you're done. >> + */ >> +#define load_and_run(PROG) ({ > does this have to be a macro? Can you write it as a function? can do. (if we keep these patches). i used a macro for the ## PROG below, but i can do something with ints and switches to turn on the autoload for a single prog. or just copy-paste the boilerplate. >> + int err; \ >> + skel = array_elem_test__open(); \ >> + if (!ASSERT_OK_PTR(skel, "array_elem_test open")) \ >> + return; \ >> + bpf_program__set_autoload(skel->progs.x_ ## PROG, true); \ thanks, barret