Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp7363629rdb; Wed, 3 Jan 2024 13:21:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IH0P6AOIFzXotCX2rmKzi+AEp1is3jjneQnw/xe19OZoWIQygsxIv2gLj8fZnc0QMt5SXUA X-Received: by 2002:a05:6e02:1585:b0:360:5840:64be with SMTP id m5-20020a056e02158500b00360584064bemr3056957ilu.38.1704316907217; Wed, 03 Jan 2024 13:21:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704316907; cv=none; d=google.com; s=arc-20160816; b=VGy/s798XDfbOMiWASgCH3AeXY4dqK2H+ixHD1NToT/Re+AUgC8FS3Kl11WdUg+8lz gJE4ZrqMQkeiyh8nUqujL5MYIWFuKq7IcuiDCafpcleAu101tQATz6JghWRMrK/yCscr h34S6sArrzYhBHW7OXR1THUipkzqVHxORATrJ3Q83AyqYSFoRQlr3Q8mZ5/Ja8v4wbbP hbwEpDwYm1QyW2uceL4K97qke6LeTnzk0GvWE3e0u38Z9Ag6Ub91vr9HsWHiiV1IPNlP CqGRqcY5A/LcF3+1OrZLEvJ5/tTqnP2AGq4sM5ue+YKzcsYnkabC/IG3GSKO3IpEvZ3i pdnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=L0iw+hpV8wxgrKsZGg0zSp1wRcZs0IBXJOFpUhcELjs=; fh=kWZtVRr3OqUr9cTIRnamcvwoPDzGPV8zB4X9oxIpA3M=; b=dMBTkowB5I1JYYnYEfs5268qZtCTUXovyFmn8FqSwQ4tl6USwkkxQvTj0CWxGMstB3 GVh7vrKw+R5JJk+O5oxLRTG5gNtIp21KVjagEHw2P5s5drBCcR/rf/MDx0/Y+sQ7VG1d zV6pepQlnpu/sDg7+zPtNuSS0eSdvAfRcqBsB1B4QWODkjZgFIeeHRtv5BXhQPiUJdvJ OP73ivKSIhbWFlELsFtn4qQ7tNQhQSXYTujJmcPmrx/mZWFG9DVBaMNadYCbA5GJuF6W dG7VSCn6hfireiMGJCt4ezeUPdsbLmz3MLg9cMNYXo7f4HwDdVjETu3aoFBGwWK8TmS4 krbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="fID/+AY0"; spf=pass (google.com: domain of linux-kernel+bounces-16017-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-16017-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id e71-20020a63694a000000b005ce0b38a6dbsi18140799pgc.580.2024.01.03.13.21.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 13:21:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-16017-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="fID/+AY0"; spf=pass (google.com: domain of linux-kernel+bounces-16017-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-16017-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 6A570B21A91 for ; Wed, 3 Jan 2024 21:21:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 490991D6A9; Wed, 3 Jan 2024 21:21:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="fID/+AY0" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-ed1-f47.google.com (mail-ed1-f47.google.com [209.85.208.47]) (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 1D6601D691; Wed, 3 Jan 2024 21:21:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ed1-f47.google.com with SMTP id 4fb4d7f45d1cf-555144cd330so8685404a12.2; Wed, 03 Jan 2024 13:21:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1704316891; x=1704921691; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=L0iw+hpV8wxgrKsZGg0zSp1wRcZs0IBXJOFpUhcELjs=; b=fID/+AY0RC6GMJ95JpqXi0IZF792zZ4L534Dh9w29QH5RcaREhhVstKg4zga/zSFzD E94cJUlCEYJDDmLkz6SKdWXrVXxSfHwzaFMoAdNAtBkbxke9tnmonHgahlvQPjt57637 rCU9tvGDKhDtI7Bt3sp2//tX1cBEt14ALHhUJdGxizbE7dRzF5x+L0Uz7v47FcZgVoCo jptN/uhcNMdyY1ktk5kJ6w453hP3Hm1mlNVA1p0XC8CPsHMyjNFIK+G5ODjHSDoUT2CI YB2jHSFLKeg/Bo64qbEuz0iD23Li+L3nlXMycMZzqXnFl1Owvr6/7EA5HmCLF0NrpUwS dV1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704316891; x=1704921691; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=L0iw+hpV8wxgrKsZGg0zSp1wRcZs0IBXJOFpUhcELjs=; b=ndMt4Mi6pcwDdtSpHVERs+aRMj/ObD1+F0xm0eoau92y99esuueJ4b3f0l0oe3gKuJ A55nMYJrD1VevMEHQj92FQkcWA3NF/2MvkRk4WESK1bwTATGVD++ZVG7W39LwDy2FCea JJATt1hpkxikrh3M7OBx/9uiRKK0p4l51NixFadUVrS7/+YhTWdtdlRsFr2lxeZElzuV RYbwXobVmT1CNUuoZ5mb6+dmkECw3F5Wrmeg7fxIA9tZ6ZrGu4Jn6aThXuL7oyAyd631 OciiENXh7qQDRlu+1aky/IVR9tRkJ0GCAgJ/yEMDFPA+f32L6ofKl2GLjE2BmuJbFYEI hiyg== X-Gm-Message-State: AOJu0YzdaF1D16udspU/Xr126xnE7//vbJj0S77vAqDQGYQcPbyhkUQ6 ZAxN0RkL0PaoBIYwpjEUfkV+zB7pven3TDpv3Lw= X-Received: by 2002:a05:6402:3888:b0:556:38d5:b38a with SMTP id fd8-20020a056402388800b0055638d5b38amr3635924edb.54.1704316891184; Wed, 03 Jan 2024 13:21:31 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240103153307.553838-1-brho@google.com> <20240103153307.553838-3-brho@google.com> In-Reply-To: From: Andrii Nakryiko Date: Wed, 3 Jan 2024 13:21:19 -0800 Message-ID: Subject: Re: [PATCH bpf-next 2/2] selftests/bpf: add inline assembly helpers to access array elements To: Barret Rhoden Cc: Andrii Nakryiko , Alexei Starovoitov , Daniel Borkmann , Song Liu , Yonghong Song , mattbobrowski@google.com, bpf@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Jan 3, 2024 at 12:06=E2=80=AFPM Barret Rhoden wro= te: > > 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] =3D 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. ok, cool, thanks for checking! The less special macros, the better. > > thanks, > > barret > >