Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp376959imm; Thu, 26 Jul 2018 05:19:43 -0700 (PDT) X-Google-Smtp-Source: AAOMgpd85Lo/AakoGYQ+Xj5jutHU39frhgxhVfnZbppuh29yzmEWeLydT/JaU36Q+N0w132LqEet X-Received: by 2002:a17:902:28a6:: with SMTP id f35-v6mr1777905plb.110.1532607583821; Thu, 26 Jul 2018 05:19:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532607583; cv=none; d=google.com; s=arc-20160816; b=icAF50xvOfrtB7/LXIsrW9Mzpe5p8yGhIIyDDDp8tJ5OvlVLk5e2kVGv8h23lvtbJc +JoT4UyPuTWnpZAmCB/pKyA4uKSguAmlwJqXByTgyPXnUiYIgZ7eogj014B5OzgZWzWD +3zQ4VBTJxx3lxFdNP2oJhz5x3WOq1UJiHs7GR69EYKYaNox0AIu/yqOttNuy5ujq/CD aCJHuj4BHVxu15le7I0ptgfN1Xqd9oTk6L4PV4AZvshGyLevCozWYh+KtznhI3Vfr4iH 5R/OqZQvkBL5kMUXNJgZp4dU7Xzr7yM45V6DwKX/MiM8wtmW2e+IQ1/hkv0Ud4JEXoS1 qnUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature:arc-authentication-results; bh=wMG5Kl7sCZ9L9pOOdZJT3wJiDRE44fMECHYum9lJbzQ=; b=UmKzU1UF51+SJ0PXhJb7iX/dhpOl8XZegQlPK1Nt0dt/dIIK4FEyRVNNjxCoY6u5Qc +Mz38/EFA5SXn2UFCN4PlJrKGa1VqodH/fsvFxhrQs4PyPOVXgAt1f3IlyekigWaPQZN ow0VgKaeKUomHsb7bVrLZW3JNi96Mdt4mzgk1Ussufv7hbFnWEBIcJ2AtuCk2Z7k2MJ6 r71rpRX8o0amiCW0ylgBh4v7a5MjIpDzkc8FEsBDIPpbhep/kZsztNlT3yfExwHeQKjz KJC8ml1FIqm34uxSnuWCrNpg3PUkLaPdj/2tWJNQRfx2q8DLCWP92HVfhrqpNCsXSxHQ 8PCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=qa4nFYd+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r17-v6si1143511pgd.682.2018.07.26.05.19.28; Thu, 26 Jul 2018 05:19:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=qa4nFYd+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730030AbeGZNfN (ORCPT + 99 others); Thu, 26 Jul 2018 09:35:13 -0400 Received: from mail-qk0-f193.google.com ([209.85.220.193]:40179 "EHLO mail-qk0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729479AbeGZNfN (ORCPT ); Thu, 26 Jul 2018 09:35:13 -0400 Received: by mail-qk0-f193.google.com with SMTP id c126-v6so813559qkd.7; Thu, 26 Jul 2018 05:18:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=wMG5Kl7sCZ9L9pOOdZJT3wJiDRE44fMECHYum9lJbzQ=; b=qa4nFYd+cDUNYN/AAnQTq5f2hO9bo4MK2As56wwhz7fUFajIAlh+mAbF5Tvb+W/ypZ VRnqx/28KW0+u/gJaC5cxa+VfI+998JGk+1OxurFlvfgbClGmzIT4Dd+u5iRM3EP8uFX yR5hHNOA+NZM65xen2nii3eaP4r8OhkgGgaLaFFaofpfewEtlYdgrv11SJ6orSjT+mSt Kd7nku4hD27NY74Kn8n7G/FzrrMbPkgAVabfpk07jtBNtfHqGXysujkXV+Wee6iDhiuh mX16nWsAy1Nr7FcAy1ijf1TVDbC3vZfwOQyalNgwHzO+rGdK1vrC7xPOy+U/tqLJwzoe eQLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=wMG5Kl7sCZ9L9pOOdZJT3wJiDRE44fMECHYum9lJbzQ=; b=ul0IJlp9a9Jxv/Zk2s+1b8iJxK5Uxk7qzuL9lBQ+9E6Tf02QfqRP6RhN5ycvdll7V7 Jau1pnca4fRIhYTuf7RK42bgkKJ1q9yttX+1i78FzxTjDAg/wlllWOf6RMo50lHsDnqO iuNu8XPqekni3YZyWuoguzRmo+sKGg5uQc0g29LefQ/P1TGwS57pyzj4ZSnTILxHc7Es Ecwim7S7492e1hfLMyFgrN0V6ToHlnn4MCQ7ARD46azOanFMohIncH1shfV8cuxM+Lgt meegSRXRLDxRUiq3Ia5qw1c13LNt0uK7npn/JOfT74/SkcJDaWwJrvf7/X99I0+97p0n 4UKg== X-Gm-Message-State: AOUpUlHZWKYBmrwui/znsLVyGpaex9qQ6bnNpiyTZs/lf//RCMl/U/f+ 6BcJXj6Ya4tba2aPXCckqjXyG9iUzMdCqtZjXgk= X-Received: by 2002:a37:d706:: with SMTP id m6-v6mr1357130qki.123.1532607518987; Thu, 26 Jul 2018 05:18:38 -0700 (PDT) MIME-Version: 1.0 References: <20180725210819.1458-1-brian.brooks@linaro.org> In-Reply-To: <20180725210819.1458-1-brian.brooks@linaro.org> From: =?UTF-8?B?QmrDtnJuIFTDtnBlbA==?= Date: Thu, 26 Jul 2018 14:18:27 +0200 Message-ID: Subject: Re: [PATCH v2 bpf-next] samples/bpf: xdpsock: order memory on AArch64 To: Brian Brooks Cc: ast@kernel.org, Daniel Borkmann , =?UTF-8?B?QmrDtnJuIFTDtnBlbA==?= , "Karlsson, Magnus" , Netdev , LKML Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Den ons 25 juli 2018 kl 23:09 skrev Brian Brooks : > > Define u_smp_rmb() and u_smp_wmb() to respective barrier instructions. > This ensures the processor will order accesses to queue indices against > accesses to queue ring entries. > Thanks Brian! Acked-by: Bj=C3=B6rn T=C3=B6pel > Signed-off-by: Brian Brooks > --- > samples/bpf/xdpsock_user.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/samples/bpf/xdpsock_user.c b/samples/bpf/xdpsock_user.c > index 5904b1543831..1e82f7c617c3 100644 > --- a/samples/bpf/xdpsock_user.c > +++ b/samples/bpf/xdpsock_user.c > @@ -145,8 +145,13 @@ static void dump_stats(void); > } while (0) > > #define barrier() __asm__ __volatile__("": : :"memory") > +#ifdef __aarch64__ > +#define u_smp_rmb() __asm__ __volatile__("dmb ishld": : :"memory") > +#define u_smp_wmb() __asm__ __volatile__("dmb ishst": : :"memory") > +#else > #define u_smp_rmb() barrier() > #define u_smp_wmb() barrier() > +#endif > #define likely(x) __builtin_expect(!!(x), 1) > #define unlikely(x) __builtin_expect(!!(x), 0) > > -- > 2.18.0 >