Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1235754imm; Wed, 25 Jul 2018 14:09:48 -0700 (PDT) X-Google-Smtp-Source: AAOMgpek8RTOiPUjIipYPhnHFYDksyLcOZKti3B0dfiXJPBvLQCXA6rmEvhneUzRj9TAVjLCnEa0 X-Received: by 2002:a62:3b89:: with SMTP id w9-v6mr23784915pfj.80.1532552988479; Wed, 25 Jul 2018 14:09:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532552988; cv=none; d=google.com; s=arc-20160816; b=pvpXS5hqTkwuQg5zHlmhGG5W10LyfU3K3Ftnwmcym8kvDrwegeu2iuo2IkyYiPyua9 quXOwe67Y7hXCr7ksZBsoFl5cCtwDBfcAIZKza4902yIOtnYkVXMTPopl2NlcsZJFxPF KuYOi3qZXZq5979V+gBVVSI5Mc9L4n+T9Ownc3Sxpt1fEffRYcDory+bm3FBaLPsGpqK 80ddh9U0haXOo/ho7Jy7Am3JuYbAV1w1zJuB1Qyb1rwe6bsdydn8ZLrXc1PfGLuCXlOJ yWm1TBlPJJoG5zAdwBUNJcNs9o2grq2ECWc167M0HfqoRJw4RHq+Ps7WBgjJTD7Q2AV1 wvGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=7PhOGjKwdw4TxOJ5GLTCvRnFYpd48EUQcmsr4BsgzzU=; b=t+7hBf1v4+kxjRs7SvtdFl8uWXVhcVwuYJd6iowI/pBfXv+TtmCfmDAMmh96JkpFsU vv9eijrPPuHBN+2bGJsplBInU0OlF1RJ47zirFlBqexA5yM2QybHVASCv5uE7qsKdf3h ATf3mEj5kWTXuxKo45vOUnvuhdxA+/chymOlIalNB9xzt40ewv3r3NXJTZbs3nOtL+Ny 3OSq+VLojPSBF0kfxWVVBm9GX/wetyGTeiyhjO0cDH7C1p1K8hvRTgEb9jH0BosPuPYK q6tKYhpL/gWagIMGeLo9MkZKckwPqo6PHWP8cCwhnWgzVwr7DQ2VL4NA4ArGo/P8n7rO UfCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="THG5Q+t/"; 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=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k11-v6si13799655pgm.154.2018.07.25.14.09.33; Wed, 25 Jul 2018 14:09:48 -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=@linaro.org header.s=google header.b="THG5Q+t/"; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731328AbeGYWWK (ORCPT + 99 others); Wed, 25 Jul 2018 18:22:10 -0400 Received: from mail-oi0-f68.google.com ([209.85.218.68]:44734 "EHLO mail-oi0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731150AbeGYWWK (ORCPT ); Wed, 25 Jul 2018 18:22:10 -0400 Received: by mail-oi0-f68.google.com with SMTP id s198-v6so16421263oih.11 for ; Wed, 25 Jul 2018 14:08:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=7PhOGjKwdw4TxOJ5GLTCvRnFYpd48EUQcmsr4BsgzzU=; b=THG5Q+t/bFFXG1X5aF3K5yaWb4wGci1j9WLT36yJxiz5PsgPaDeArVjDStp/6F7q3k c2VNSXsN1CxNgYiE/LtaTJKxxcYwK5OqviccyIGxJoymuJGDK2qBXkmJszDFhEOQ5qLp bYWBkEGTaL9DjGt1c6wNqyLjpzr8Qa1OiqOBw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=7PhOGjKwdw4TxOJ5GLTCvRnFYpd48EUQcmsr4BsgzzU=; b=WbgQdcf8Mt2pd99f51GBXF1u26lL3ZsmLcgpSCOrYJLBCwJvYwfVAv5e4J/yq1LGyK erWFALKrRXQqJHZ6UhjilHzMGK6sR7D6esardXCCy8QjD2A8VS4B+nEkfmqBM87ch7a7 adB1Oxu+i311OHPVkLSsgJoNKi+owr7S6Ga8svPKRP4aVuMrgctVYEuaajj9jhd2H99W lFgnmNG09k/MmsBMCmhnQnEylfGQCFzOFh+YIZc4S/dpdi7eO7IeJsoTbvBQbq75rl03 EHzUxVSgN0ttJ4h9N3taHyd726101z9K091o8Os4oQR2/wkUFBLqWHBIOM5fL9glfecL +mZQ== X-Gm-Message-State: AOUpUlE1MmoSH2IQMQ1uu/U56SoL6SEORcH+bGQkNYKJiewdm1hTIWg9 Yz8/sW+4IvLY5uFrZ8d7a8ZZkw== X-Received: by 2002:aca:4914:: with SMTP id w20-v6mr4942755oia.5.1532552921909; Wed, 25 Jul 2018 14:08:41 -0700 (PDT) Received: from di3.localdomain (68-248-140-212.lightspeed.austtx.sbcglobal.net. [68.248.140.212]) by smtp.gmail.com with ESMTPSA id p4-v6sm19265960oig.43.2018.07.25.14.08.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Jul 2018 14:08:41 -0700 (PDT) From: Brian Brooks To: ast@kernel.org, daniel@iogearbox.net, bjorn.topel@intel.com, magnus.karlsson@intel.com Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Brian Brooks Subject: [PATCH v2 bpf-next] samples/bpf: xdpsock: order memory on AArch64 Date: Wed, 25 Jul 2018 16:08:19 -0500 Message-Id: <20180725210819.1458-1-brian.brooks@linaro.org> X-Mailer: git-send-email 2.18.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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