Received: by 10.213.65.68 with SMTP id h4csp606225imn; Fri, 23 Mar 2018 11:26:38 -0700 (PDT) X-Google-Smtp-Source: AG47ELsq5y89B70Y3dwXSLWN8hkHpGbKHbm8Rx/pFp2HF1vofkfDheXWKXlmxKnVz3gJDQo6Cnkr X-Received: by 2002:a17:902:70c4:: with SMTP id l4-v6mr15683734plt.344.1521829598724; Fri, 23 Mar 2018 11:26:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521829598; cv=none; d=google.com; s=arc-20160816; b=ZZNo68S269Cbj3L+uXsQX2u53LM9ObduNh60nAXjh3kGw9K4iOptp7+8dyAPhW9MOr yZmb5UuHzTD4P4/nbSvm3mx1tzZwUx11HLOsHt5DOJC6Dan8E48wkUbaDMwrzLTZdKcw 6AEkrcSv7L9rWpU/ClJC/ztZ5OpoiOMRPA6QnpKEUCnm09eoFCWTds7ONlQNqAuU4vZg /tGGm+hCj5bu0cAXDj2HtltZfPyM0B9ldTdbvx0yER9aCgmuMNpxElagcc3c5kwFO8vE 9TIlf7gtP8UEjUCgxWfURmMgq3WVeEYehNzxRY9RUk8KD6xownwKL1OgnBytlK2M8Gkq +M6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=8s+XTBwY4CrUJNCIyyanCFoXHL9D0VFk46ebLlrhFIg=; b=JIC0SY+o0+FR0qGWweTpb3MEjKYkenDweD+2awpsMt5Oej5oOCwvPu3wKZyOX9Tsee vZw41WYf1n0RJI0QRO2xMpB6lMTJRR23RiHO/OjDOGen6EkHEZ95RNL83PxDW/s6LXag 5ArJ8jC6kp/lycBeQRq0c/2v7c7Bfzg+rGAUx4h8SDCgURxqCUhOvPrGyXU99JBrwslH WP0CRelJT+pbJBtEG1vFw6HK+aTyPNv5jmg/85Y/b6bZ2WVBhX9W5yfOUeYfa2g3wIAP 3VitmrgkhP/ul8MGhbOIonabFn3T1HqpEL0XWu/WQCSFsiYBGyZUsX4GPJN6za1amFaj tXKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=RT70sCXV; 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 y72-v6si9497165plh.72.2018.03.23.11.26.24; Fri, 23 Mar 2018 11:26:38 -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=RT70sCXV; 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 S1752286AbeCWSZ2 (ORCPT + 99 others); Fri, 23 Mar 2018 14:25:28 -0400 Received: from mail-wr0-f196.google.com ([209.85.128.196]:44861 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751976AbeCWSZ0 (ORCPT ); Fri, 23 Mar 2018 14:25:26 -0400 Received: by mail-wr0-f196.google.com with SMTP id u46so13042811wrc.11; Fri, 23 Mar 2018 11:25:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=8s+XTBwY4CrUJNCIyyanCFoXHL9D0VFk46ebLlrhFIg=; b=RT70sCXVF8H70HHS4bwGwHkSbgW/hwkliws6Wj4jUsWqhAZ+god5No0uSRoqWm4kN+ OOkNRyzK3LvwslqHhtGNMl7/hsuI/s409L7Kw5Cm47ND3Mjpy0QiZBSJ09/Bie2SEVm6 z8lMU30G8whDXyx5m5D20I9oALRfDrlf1tKCl7H1//A1OahiuIFJZ+OEpWeTSvDJt4kO Njyk3pjXjVYG4/Hn3bJ00dnO1bGD4RxwY6VZu6fkuL0fVmB3MrDfQyzKFBQQlBcd9zuY WkIoa+hxzDHctaBXl16GpUWj9xGYQzOgsSCdl2IIg8WtUq7zW+bByBDnAOq0q+c3pbBs 14LA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=8s+XTBwY4CrUJNCIyyanCFoXHL9D0VFk46ebLlrhFIg=; b=NHA5+1AUj+JlU0fhLDkXUeOE62QSJwrF0+bu4BGD4++5mn+WpBzZOJv343XHa0aeZU p7DDldJ3khyhxWz3KFaoMayNlb94gb6EsEkUjHp0gtw/hcUI4RruLF6+rVy3W/EC72cu 0IlaKaizILLBqvqTP3OvbGLYWPxqlWI3HuuAfvIKIYiRwTxjX/zmeM9GcLyOQ+LPmPrg dnHrnimBcKooveH5uCAbJQsDGXSCdr2BpSdNHBdZJRMtq/h7EkPjII48AxBuYUCBerPF B23QnHDLeDGdzpAMw74VxYaMPUaieRKptV02H+wXn/M7rsdgOtAppxTTjNOSVKra1lFT Ebvw== X-Gm-Message-State: AElRT7GFg3YDMFAvRQcivbakzsTJKEDcbXUF5BgN8cUTJWdD+jPKbxGj oGAxfS7Wq1p+E5n3l937O+3J0pUyEGjOup6i9Img9g== X-Received: by 10.223.192.3 with SMTP id z3mr15875963wre.177.1521829524697; Fri, 23 Mar 2018 11:25:24 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.184.189 with HTTP; Fri, 23 Mar 2018 11:25:24 -0700 (PDT) In-Reply-To: <1521829277-9398-8-git-send-email-okaya@codeaurora.org> References: <1521829277-9398-1-git-send-email-okaya@codeaurora.org> <1521829277-9398-8-git-send-email-okaya@codeaurora.org> From: Alexander Duyck Date: Fri, 23 Mar 2018 11:25:24 -0700 Message-ID: Subject: Re: [Intel-wired-lan] [PATCH v6 7/7] ixgbevf: eliminate duplicate barriers on weakly-ordered archs To: Sinan Kaya Cc: Jeff Kirsher , sulrich@codeaurora.org, Netdev , Timur Tabi , LKML , intel-wired-lan , linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 23, 2018 at 11:21 AM, Sinan Kaya wrote: > 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 | 21 ++++++++++++++++++--- > 1 file changed, 18 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..9e684b1 100644 > --- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c > +++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c > @@ -725,7 +725,12 @@ 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); > + > + /* We need this if more than one processor can write to our tail > + * at a time, it synchronizes IO on IA64/Altix systems > + */ > + mmiowb(); > } The mmiowb shouldn't be needed for Rx. Only one CPU will be running NAPI for the queue and we will synchronize this with a full writel anyway when we re-enable the interrupts. > } > > @@ -1232,7 +1237,12 @@ 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); > + > + /* We need this if more than one processor can write to our tail > + * at a time, it synchronizes IO on IA64/Altix systems > + */ > + mmiowb(); > } > > u64_stats_update_begin(&rx_ring->syncp); > @@ -4004,7 +4014,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 > > _______________________________________________ > Intel-wired-lan mailing list > Intel-wired-lan@osuosl.org > https://lists.osuosl.org/mailman/listinfo/intel-wired-lan