From patchwork Fri May 25 04:13:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Venkatesh Srinivas X-Patchwork-Id: 920224 X-Patchwork-Delegate: jeffrey.t.kirsher@intel.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=osuosl.org (client-ip=140.211.166.136; helo=silver.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.b="WHiUY9RT"; dkim-atps=neutral Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40sYTV3V5jz9s15 for ; Fri, 25 May 2018 14:40:29 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 4F59825E17; Fri, 25 May 2018 04:40:27 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2TfQgiIzMaql; Fri, 25 May 2018 04:40:26 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id B1473256D8; Fri, 25 May 2018 04:40:26 +0000 (UTC) X-Original-To: intel-wired-lan@lists.osuosl.org Delivered-To: intel-wired-lan@lists.osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 781861C2197 for ; Fri, 25 May 2018 04:40:24 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 7476D256D8 for ; Fri, 25 May 2018 04:40:24 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Nz711LT-MuC4 for ; Fri, 25 May 2018 04:40:23 +0000 (UTC) X-Greylist: delayed 00:20:38 by SQLgrey-1.7.6 Received: from mail-yb0-f202.google.com (mail-yb0-f202.google.com [209.85.213.202]) by silver.osuosl.org (Postfix) with ESMTPS id BB3A5254B3 for ; Fri, 25 May 2018 04:40:23 +0000 (UTC) Received: by mail-yb0-f202.google.com with SMTP id t12-v6so1943924ybg.5 for ; Thu, 24 May 2018 21:40:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:date:message-id:subject:from:to:cc; bh=Mvo6ldG41DI9E6c0vlknrTBzVZCKgfFajLa0oeIEN4w=; b=WHiUY9RT8zy/uo5yr6nfg4L4E+8UPHE25ewbi8JdpKeXJgkTogF/kiEycR9AAnZFHE pb7RiHfQk66tbt86T6sUnES41aVb2/1z3/rJoMdvl/gJbTj3npX8gz4bfFwadr/AQILr fIW8daRJk1C3huUjgovNF+eIt2P9elBWjTyHaXKmrvcRJr88O0OjnC06sEIzZKfKi+No qerZNTe+/tpPlRp8+spIqowomM9UwHPabm2EXNwdsrlekYn+RXXdUGsRvzeqxbG/q8+L ao2UQHtybLOK+dI2neGP5C/2n0bdXEQEpZ1ThvRmsZbXyzNWwdLpK4Ia1Bicj+8tXoSi sSKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:date:message-id:subject:from:to:cc; bh=Mvo6ldG41DI9E6c0vlknrTBzVZCKgfFajLa0oeIEN4w=; b=GA5cNodoQo8LKJK3WZZ1lSTunl8IY555tE55+4y8ShyceqVygnD9BxMX26kwRtGp6j YM+sRcQHeeqQF/1SOmAsa9zpWS+CuLyPufM8Ar7e403chQVvZ+PNwJAP7SE0flw5DdxJ sNkA6sAbIqR+7ReIeacwzF9L2zWla3h9i8dsSeHjxcZXQYHxfCWdr9ZPT6D+jkSTmmQd o+pofck+w5PmAlp5/2w9rSiIKcTZIxyZ1ai3oaETt4LrP+yzjnMGP3AlKUvMcOuXUeAe wrdykstD3sOx/hru9+5wTFwSWwtGIFk/Nj9MgSeHB9qPzNgLSdbQINfVIWHTGZ6fRGgH 3kfQ== X-Gm-Message-State: ALKqPwfYzjeR6IvzdpWfbl5H8+UB9sZTmM48nIdo3DsuENdASFHPUG4h RISuO0UZOFQTNF0b4w15b55gP2vMma5L3GxD X-Google-Smtp-Source: ADUXVKIUvV/QIV8Pylqlaed3NCeNmIjU2sgY+FJ+DiZ8pNJ4FyEgx0H6yDLQp12xUc7MfAMIhJnvZaSmgjJk0DKe MIME-Version: 1.0 X-Received: by 2002:a5b:542:: with SMTP id r2-v6mr181445ybp.28.1527221612614; Thu, 24 May 2018 21:13:32 -0700 (PDT) Date: Fri, 25 May 2018 00:13:21 -0400 Message-Id: <20180525041321.140516-1-venkateshs@google.com> X-Mailer: git-send-email 2.17.0.921.gf22659ad46-goog From: Venkatesh Srinivas To: jeffrey.t.kirsher@intel.com, intel-wired-lan@lists.osuosl.org, vsrinivas@ops101.org, venkateshs@google.com Subject: [Intel-wired-lan] [PATCH] igb: Use dma_wmb() instead of wmb() before doorbell writes X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.24 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: vsrinivas@ops101.org Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" igb writes to doorbells to post transmit and receive descriptors; after writing descriptors to memory but before writing to doorbells, use dma_wmb() rather than wmb(). wmb() is more heavyweight than necessary before doorbell writes. On x86, this avoids SFENCEs before doorbell writes in both the tx and rx refill paths. Signed-off-by: Venkatesh Srinivas Tested-by: Aaron Brown --- drivers/net/ethernet/intel/igb/igb_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c index cce7ada89255..8aea50867a5d 100644 --- a/drivers/net/ethernet/intel/igb/igb_main.c +++ b/drivers/net/ethernet/intel/igb/igb_main.c @@ -5674,7 +5674,7 @@ static int igb_tx_map(struct igb_ring *tx_ring, * We also need this memory barrier to make certain all of the * status bits have been updated before next_to_watch is written. */ - wmb(); + dma_wmb(); /* set next_to_watch value indicating a packet is present */ first->next_to_watch = tx_desc; @@ -8093,7 +8093,7 @@ void igb_alloc_rx_buffers(struct igb_ring *rx_ring, u16 cleaned_count) * applicable for weak-ordered memory model archs, * such as IA-64). */ - wmb(); + dma_wmb(); writel(i, rx_ring->tail); } }