Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp4408795pxu; Tue, 1 Dec 2020 04:23:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJwhG0H0dDM0qRqzqPR05++dSSPXRQTWUpXXtPf7McQaXVHTm70yIh9LJS75iujjxaNQYK2R X-Received: by 2002:a17:906:ddb:: with SMTP id p27mr427442eji.39.1606825410012; Tue, 01 Dec 2020 04:23:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606825410; cv=none; d=google.com; s=arc-20160816; b=k60eAf/UZ12hT2ZpbNog84v2/R6oYnrjNR4nVYpkB9ysPwaCkfoeyi2RJuAXi2ztKe 99tE4RWQSV+Wq8f1/V0BPzgWR/cqqlCJmfd3GKfA8j6eh1bjOrfXDmiiWgRoksJIUxH8 Vtat9/GaAB7ol9JZxSnOAU/OWR0kJd0hUjbfRrFmH8Zq1TjdIk9y6VzbLZTRTKpau7KB c9ahwylWjgwTg3v8h7GLxNnZj8V9I53kMgmZ+h4GFJnFiZfAYFmY2xeQaaRYHlTiA2Ad wjF2uRFjwkhsU4c5Q3IWLg1VJKodvCobklQoqAgP79m6tWogTD2qsSSvx9B7FdYf7DZW hEMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=g0cu2xo3t8omk7h4Os6v19y0TCwy8mGGWLP5k1GCMgQ=; b=fH4bmRGBdRwF1Y5BS31M/cdDf7ew7lgdhFFRe1hZ5AArJmwKo8JB7aM+X+tutgYpoI KXe+alLRFx47X1X70YO0EW+M+zbbjMkisyQIgN9gkp6x7P8pOEsanpac8EdqJovvzo9w LM5pWjC/0lhJFVfzZB1gjNVQWYGE79LJ5x3ouaYxsISkMjQz4C1oCgic8RnlvVF2QMHy 3oORJ8gvOaqAfRC8jOPqUpCz6DDUmpd3u2gpST3vIvUWiWfFeBHNy4S30Qzy0d5s0iYR zDUXRPrX311P06crPrbnd66DckyPVs/x9y6Mf2rFvca34BCX1JB0Jv/Y1BrHe0UTv5ID kxyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=KcwrvHs5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s18si900034eji.422.2020.12.01.04.23.06; Tue, 01 Dec 2020 04:23:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=KcwrvHs5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730720AbgLAMSN (ORCPT + 99 others); Tue, 1 Dec 2020 07:18:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53868 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728293AbgLAMSN (ORCPT ); Tue, 1 Dec 2020 07:18:13 -0500 Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C7090C0613CF for ; Tue, 1 Dec 2020 04:17:32 -0800 (PST) Received: by mail-wm1-x341.google.com with SMTP id k10so2414465wmi.3 for ; Tue, 01 Dec 2020 04:17:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=g0cu2xo3t8omk7h4Os6v19y0TCwy8mGGWLP5k1GCMgQ=; b=KcwrvHs5/3AUPjLyRvtTzh5o6y3YII7uhGJzAOCAprPrbdySnDD+0Wvsq6g9I2XlbS K080wgYe7nMSOCN+o1rDVdXFMu9JoNg5HJ4o/KZW2X/8EqORS2Dz6GyhSQd5r3LhOeE3 qLcPqbOzXXfQoKVQN7bDM7Jev2WOOCB5jgTEot0W9e3nv/5Yq5Gu/bZw92L9DdqmTKcy GPyE1KaiTfsnr2wjJHqIfXOG/LgiOYJK7bUr0bTLRCyGnEbrxQzgqWUfcKCiH9kQA9zi IFIr4573HxBCt4Y8/sMExGzo2cZ67Ui1KW9cjwXPVdTgG1RQGLm8o4IgOPHsRvgrLlfZ QusQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=g0cu2xo3t8omk7h4Os6v19y0TCwy8mGGWLP5k1GCMgQ=; b=DZX3KQO//5uPPQMk7zRufhPSJKg6MejMKk0XGA3PP1J1FhBAiGcvAVclRdYeL/Xc/Y JtXlWhMG9aj7BX6b319n3uHrOmbZFY1eChrXi0HKcuZwKvfW5ivZaraxydzGj911pxki UAGsa1rj/jKO63Oyi1k1b/dqO5b5vxXBYIjAEYD7asEdiFOF4gu9YA3ln4QffRyapVBQ 5SmmUtT2yn3CYef8SYjRRepzKrrYeRZZy/XgpMo8kp9ZYmgK9QPCfUrA3tkjZfZ6AsFf iymEQuSL7GyhAl2aQM44SEP+AW2ULOoAKqWIjFD0eVgcGLZNPWoAg0vWKOoF37yKYQte t67w== X-Gm-Message-State: AOAM532xHQonFScklRD7W7ixQXdV44UQqXr2+FWNMDjDdrO1nZrgCMYG d8sfQ0NnILfYOR5ST8rxnq2zNQ== X-Received: by 2002:a7b:cf08:: with SMTP id l8mr2474685wmg.189.1606825051432; Tue, 01 Dec 2020 04:17:31 -0800 (PST) Received: from google.com (203.75.199.104.bc.googleusercontent.com. [104.199.75.203]) by smtp.gmail.com with ESMTPSA id d8sm3020167wrp.44.2020.12.01.04.17.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Dec 2020 04:17:30 -0800 (PST) Date: Tue, 1 Dec 2020 12:17:26 +0000 From: Brendan Jackman To: Yonghong Song Cc: bpf@vger.kernel.org, Alexei Starovoitov , Daniel Borkmann , KP Singh , Florent Revest , linux-kernel@vger.kernel.org, Jann Horn Subject: Re: [PATCH v2 bpf-next 05/13] bpf: Rename BPF_XADD and prepare to encode other atomics in .imm Message-ID: <20201201121726.GC2114905@google.com> References: <20201127175738.1085417-1-jackmanb@google.com> <20201127175738.1085417-6-jackmanb@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 27, 2020 at 07:43:46PM -0800, Yonghong Song wrote: > > > On 11/27/20 9:57 AM, Brendan Jackman wrote: > > diff --git a/Documentation/networking/filter.rst b/Documentation/networking/filter.rst > [...] > > diff --git a/drivers/net/ethernet/netronome/nfp/bpf/jit.c b/drivers/net/ethernet/netronome/nfp/bpf/jit.c > > index 0a721f6e8676..1c9efc74edfc 100644 > > --- a/drivers/net/ethernet/netronome/nfp/bpf/jit.c > > +++ b/drivers/net/ethernet/netronome/nfp/bpf/jit.c > > @@ -3109,13 +3109,19 @@ mem_xadd(struct nfp_prog *nfp_prog, struct nfp_insn_meta *meta, bool is64) > > return 0; > > } > > -static int mem_xadd4(struct nfp_prog *nfp_prog, struct nfp_insn_meta *meta) > > +static int mem_atomic4(struct nfp_prog *nfp_prog, struct nfp_insn_meta *meta) > > { > > + if (meta->insn.off != BPF_ADD) > > + return -EOPNOTSUPP; > > You probably missed this change. it should be meta->insn.imm != BPF_ADD. > > > + > > return mem_xadd(nfp_prog, meta, false); > > } > > -static int mem_xadd8(struct nfp_prog *nfp_prog, struct nfp_insn_meta *meta) > > +static int mem_atomic8(struct nfp_prog *nfp_prog, struct nfp_insn_meta *meta) > > { > > + if (meta->insn.off != BPF_ADD) > > same as above. Dang. Many thanks for the careful review!