From mboxrd@z Thu Jan 1 00:00:00 1970 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="tWoNggRk" 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-Google-Smtp-Source: AGHT+IHBMSV1+MBkLmy7Z1dA3S1YsmNAWyf0LA6NmReZNlLiJ20oDpmaPkJVVjqaZsxjwDHM1wehZQ== 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