Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp7332871rdb; Wed, 3 Jan 2024 12:07:15 -0800 (PST) X-Google-Smtp-Source: AGHT+IGGkktwTYNoMgfC5LnG+GyzbuDoYClKnhYwwE6ylxNtqzO7B2tV52b91gRrZDBEemjb7T3H X-Received: by 2002:a17:906:5d6:b0:a27:7076:9d79 with SMTP id t22-20020a17090605d600b00a2770769d79mr3427371ejt.96.1704312435492; Wed, 03 Jan 2024 12:07:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704312435; cv=none; d=google.com; s=arc-20160816; b=y/5LZaukYlJM8JEAJW3h08w8XeEjRVDUTqRJswJXU3TQMxi0+hJQjBf7DQbGGvdCB3 aUcPIBjrYEavcT5qnmEPVzCxPKbUzBrmnU6ZSxKzUGTH4jvi6RN2FZRS6PJBECwfJYCW +Dxz/yb8UelyNH3ko/28jm9Yu6OBUWpotDAIdRNsl8Uw4FooLoBmHLpZ0dTHh94EwX/e Lpi31uvqBgZ6U9TiK0MbVaLSRW+HzWCEjqCzOkmzI3PX8K5WhiCnRbV3izQigcynWgt1 cULCe5RI0ZSY3FnBWnpmwJXTH+QmPgxnKa+gtbEqE2Ww7lXjiSq2wp9LlOwJyQX7pdtM Mhkg== 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=HB9ce/ZYj/o4q+a999lFcCPcvK9JlN2H69sVtgUKvWI=; fh=A0qHSgc+LFI6ONAV7b4P7e9BuXPZptsQo0GTmFK+5gc=; b=ELPi5cOySSluifpb/voPodI6OV89OAPgmqJ+MjuMORjvmemyYP3CH9MDO6q2LNEmw3 SCAems5iosB6ksqtLVYxgDmllYOb2C1RAi/7lOr01Vmc/NbKS1x1U6B45T8pYZrXT7us lmpqEhA5XZmKSGV5E8GNLmoDj4l7ppyArVIi8enEbXy9dgi6qMjHW5paU9qvEX5SI9XI zY0jzDkq90A/oelJr9y+YDQmIRlKa561mQ65lQ4dUktZ1IAUuELC3scZLUnkdd/1eqLA w6tEaeQeyk524llRUCJmo3gvQjQbar46JAjGnMTCNQByodK7xklOU70SkZLh+sj4lDJO /F9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=tWoNggRk; spf=pass (google.com: domain of linux-kernel+bounces-15949-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-15949-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id qx7-20020a170906fcc700b00a278953a75csi4525055ejb.992.2024.01.03.12.07.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 12:07:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-15949-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=tWoNggRk; spf=pass (google.com: domain of linux-kernel+bounces-15949-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-15949-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 3F6E21F25656 for ; Wed, 3 Jan 2024 20:07:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8F3C91D528; Wed, 3 Jan 2024 20:06:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="tWoNggRk" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-qt1-f181.google.com (mail-qt1-f181.google.com [209.85.160.181]) (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 89CCE1D534 for ; Wed, 3 Jan 2024 20:06:54 +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-f181.google.com with SMTP id d75a77b69052e-42832ddd9d1so8206901cf.0 for ; Wed, 03 Jan 2024 12:06:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1704312413; x=1704917213; 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=HB9ce/ZYj/o4q+a999lFcCPcvK9JlN2H69sVtgUKvWI=; b=tWoNggRkLg77FZmoYe7r/lfrBBHM3Ymak81nFdFy8rtdL6E4Ido1HJSszoTzC2b7lH e47KteAuJO/nH7iDubjnutqlApc1wpiM+BbZrW43EX8iFiXOEKOlLrczDfFF1dWA6wa5 JK2beLjRMxoiZkYNOwvvgIq0RNLcLpRebpueQSCT5X/24qNme6M3CUWawxNLUi/sZ2as cbWBxglHsB46r5T8WtItdXiegj/cLIh+ieAxSa/0tfTdSfigfdTr8aCWBcHZqwyJrJ27 VTU4b0ENZWIkWawVYRZtm31UM4v1kZWf7s/RoKLbGS7695mXHm892DrGOnKNd5lus5/n T74Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704312413; x=1704917213; 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=HB9ce/ZYj/o4q+a999lFcCPcvK9JlN2H69sVtgUKvWI=; b=C7CDZ1XvMzEelW4tXYrwEN0K/Uiyw+EibHElEO3y4pEWVAkx1avcek6IHKYmlBxl6r eRDPqL9U0Cfk15TDtyI66LaK9kiZM3Ri98gwO9UjZ2fJe1NHrg1LLF1rR4Hibl+D/LiF RbJMtI9aFMW1jsz8NbJcMRC8s01gghx/WnWodWILGrzx0Wd97YwCE5Xe74mPCeP9G/s9 YqJVDRIradUqecRzNNeCGej9t+mPsEi516guVFofJOLp/ht4wkOTS0T9XsTpZfovE7B8 ABFVN17J/QfRASGLepZ17loIw5n5m8VScUo/5gU1gDBJY0GMdaUcYd+ijEUpxPOW1siD dUhw== X-Gm-Message-State: AOJu0Yxttdcfx1m1BomWbM2yuEhA2DzvQlO0fY2jPvlij+T/u/mshTxp njhdA5YhOUHV+VG7G+bKQnOl0XkeeLlR X-Received: by 2002:ac8:5782:0:b0:425:85b7:a784 with SMTP id v2-20020ac85782000000b0042585b7a784mr30392949qta.53.1704312413418; Wed, 03 Jan 2024 12:06:53 -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 j4-20020ac806c4000000b00427f02d072bsm7618575qth.95.2024.01.03.12.06.52 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 03 Jan 2024 12:06:53 -0800 (PST) Message-ID: Date: Wed, 3 Jan 2024 15:06:52 -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: > I'm curious how bpf_cmp_likely/bpf_cmp_unlikely (just applied to > bpf-next) compares to this? these work great! e.g. if (bpf_cmp_likely(idx, <, NR_MAP_ELEMS)) map_elems[idx] = i; works fine. since that's essentially the code that bpf_array_elem() was trying to replace, i'd rather just use the new bpf_cmp helpers than have the special array_elem helpers. thanks, barret