From patchwork Tue Mar 9 16:55:01 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanislaw Gruszka X-Patchwork-Id: 47173 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 55014B7D16 for ; Wed, 10 Mar 2010 03:56:59 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754978Ab0CIQ4z (ORCPT ); Tue, 9 Mar 2010 11:56:55 -0500 Received: from mx1.redhat.com ([209.132.183.28]:39258 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753955Ab0CIQ4y (ORCPT ); Tue, 9 Mar 2010 11:56:54 -0500 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o29Gurj6020539 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 9 Mar 2010 11:56:53 -0500 Received: from localhost (dhcp-0-189.brq.redhat.com [10.34.0.189]) by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o29Guqvw031384; Tue, 9 Mar 2010 11:56:53 -0500 From: Stanislaw Gruszka To: netdev@vger.kernel.org Cc: Vladislav Zolotarov , Eilon Greenstein , Michael Chan , Stanislaw Gruszka Subject: [PATCH 2/4] bnx2x: remove not necessary compiler barrier Date: Tue, 9 Mar 2010 17:55:01 +0100 Message-Id: <1268153703-4186-2-git-send-email-sgruszka@redhat.com> In-Reply-To: <1268153703-4186-1-git-send-email-sgruszka@redhat.com> References: <1268153703-4186-1-git-send-email-sgruszka@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.17 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Access to fp->tx_bd_prod is protected by __netif_tx_lock, so we do not need any barrier for that. Update of fp->tx_bd_cons in bnx2x_tx_int() is not protected by lock, but barrier() nor smb_mb() in bnx2x_tx_avail() not guarantee we will see values that is written on other cpu. Ordering issues between netif_tx_stop_queue(), netif_tx_queue_stopped(), fp->tx_bd_cons = bd_cons and bnx2x_tx_avail() are already handled by smp_mb() in bnx2x_tx_int() and bnx2x_start_xmit(). Signed-off-by: Stanislaw Gruszka Signed-off-by: Eilon Greenstein --- drivers/net/bnx2x_main.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/drivers/net/bnx2x_main.c b/drivers/net/bnx2x_main.c index 9fc0f6a..ae62b67 100644 --- a/drivers/net/bnx2x_main.c +++ b/drivers/net/bnx2x_main.c @@ -893,7 +893,6 @@ static inline u16 bnx2x_tx_avail(struct bnx2x_fastpath *fp) u16 prod; u16 cons; - barrier(); /* Tell compiler that prod and cons can change */ prod = fp->tx_bd_prod; cons = fp->tx_bd_cons;