Received: by 10.213.65.68 with SMTP id h4csp623732imn; Fri, 23 Mar 2018 11:54:36 -0700 (PDT) X-Google-Smtp-Source: AG47ELsiL0HU4eVTUmousuy1WdLVM3YyEmDQhKFij/Qm3ymt3k/ZgVezfGN5sqBEK11xJxZG860b X-Received: by 2002:a17:902:aa91:: with SMTP id d17-v6mr30919888plr.145.1521831276324; Fri, 23 Mar 2018 11:54:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521831276; cv=none; d=google.com; s=arc-20160816; b=NCoY40LLs3X3KH+ZNp0zStwLmPudyZHk6zLE2w/0G/PeqQP7BSWFmx849V3BYN1d9+ XH9/+6o4kK4J1IMmTLx5wY+6vzN+IW1PsWKUdRRRfC77knblcOV9LGsevZHEtp0RWdFm 2K1U+mNMy1PdrUq5o5Ht6FghmjyntO8VX98JhVDjEd+R7CCEuU8Olps5DV1tKsshSysJ INVWaLFh7QNo68NOv3uYWUz80vwyuv/cJ+eir9xkRaNhJzQ/CY0vLt9j6Nak00VracOX PVKkKg1ja6NOiP6/gSQBQgObwoktcP4aNRRcPji2UgcGwxe29aIKW8ydR4TirOjCulCJ dR4w== 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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dmarc-filter:dkim-signature:dkim-signature :arc-authentication-results; bh=xSNh51+sk8K9kbTR7KgbqwkEbp4lkf6L3JP26snpypE=; b=R8TJJHXj+EiHh0HoR1ecC/AUO5fTXRDT7djOOvd6HCNSGpcV7WRHGYCw+vpOU9y4vQ WrOXSFS9sMX3UXIOu9bvWjKOhpzGCYHWsxd3RE/lz+NwcBSX1Vc55t79fK75EZxD7AY5 4J6D9sR8fCSLmcFBL4zP7q3AflkCNuMl1bkbEoECGszcAeLBoQx/cJMqwlSOEekH5DzG ztXN2elQmx79G450RVLmL391b8tvWN5RThp0w9lUuBLmiIV/DxvjLNaHk4FMKqFEjaaD wlSCBJvj4scDYgk3rPacV/+Pudiu+WqJmYqyulUlEp60tbGdzHx8fXFqys26a56CSCCZ pH0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=cO5XgZwF; dkim=pass header.i=@codeaurora.org header.s=default header.b=dJVUOqlX; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u1-v6si8871824pls.488.2018.03.23.11.54.21; Fri, 23 Mar 2018 11:54:36 -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=@codeaurora.org header.s=default header.b=cO5XgZwF; dkim=pass header.i=@codeaurora.org header.s=default header.b=dJVUOqlX; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752331AbeCWSxY (ORCPT + 99 others); Fri, 23 Mar 2018 14:53:24 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:46740 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752279AbeCWSxS (ORCPT ); Fri, 23 Mar 2018 14:53:18 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 4C9D860C64; Fri, 23 Mar 2018 18:53:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1521831197; bh=wrUMizr/OXfvg736FBy5/SIV3Ee2UyUZVnbSk78vbtw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cO5XgZwF+444ygxqDbETVx+TKDQ6IJ11xD64BO0RZPO6o4ORMojj36A+MFEHaGqJo aTXTg3W4hvk9fX50TjIEVSaTfyARtWmei2htpXSh9xHmYNieQUIBL3IEOPsMwYCnne wxtJ1yOdHoM9lkO2A3yHXPAWABGZJL71GbyoBWcA= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from drakthul.qualcomm.com (global_nat1_iad_fw.qualcomm.com [129.46.232.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: okaya@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 5E26A60F92; Fri, 23 Mar 2018 18:53:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1521831195; bh=wrUMizr/OXfvg736FBy5/SIV3Ee2UyUZVnbSk78vbtw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dJVUOqlXDTyvSLCFpk3ZHR0H6OBBsXbE5wbUJuB7Wv1a7isCT7Q9w7Ma/zMdqoH8z vjlZ4aXG/3dNeBoxk2wkBjbnLERguLa0P3sERxcJZXCgaqS0gudduBdiPxKx6F7Pb7 AxI78W6g2XJVQrv/fl7Mic1DVciliHpHHQlQeXHw= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 5E26A60F92 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=okaya@codeaurora.org From: Sinan Kaya To: jeffrey.t.kirsher@intel.com Cc: netdev@vger.kernel.org, timur@codeaurora.org, sulrich@codeaurora.org, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Sinan Kaya , intel-wired-lan@lists.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH v7 7/7] ixgbevf: eliminate duplicate barriers on weakly-ordered archs Date: Fri, 23 Mar 2018 14:53:00 -0400 Message-Id: <1521831180-25014-8-git-send-email-okaya@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1521831180-25014-1-git-send-email-okaya@codeaurora.org> References: <1521831180-25014-1-git-send-email-okaya@codeaurora.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Code includes wmb() followed by writel() in multiple places. writel() already has a barrier on some architectures like arm64. This ends up CPU observing two barriers back to back before executing the register write. Since code already has an explicit barrier call, changing writel() to writel_relaxed(). Signed-off-by: Sinan Kaya --- drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c index 815cb1a..7277647 100644 --- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c +++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c @@ -725,7 +725,7 @@ static void ixgbevf_alloc_rx_buffers(struct ixgbevf_ring *rx_ring, * such as IA-64). */ wmb(); - writel(i, rx_ring->tail); + writel_relaxed(i, rx_ring->tail); } } @@ -1232,7 +1232,7 @@ static int ixgbevf_clean_rx_irq(struct ixgbevf_q_vector *q_vector, * know there are new descriptors to fetch. */ wmb(); - writel(xdp_ring->next_to_use, xdp_ring->tail); + writel_relaxed(xdp_ring->next_to_use, xdp_ring->tail); } u64_stats_update_begin(&rx_ring->syncp); @@ -4004,7 +4004,12 @@ static void ixgbevf_tx_map(struct ixgbevf_ring *tx_ring, tx_ring->next_to_use = i; /* notify HW of packet */ - writel(i, tx_ring->tail); + writel_relaxed(i, tx_ring->tail); + + /* We need this if more than one processor can write to our tail + * at a time, it synchronizes IO on IA64/Altix systems + */ + mmiowb(); return; dma_error: -- 2.7.4