Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755562Ab2EIKsJ (ORCPT ); Wed, 9 May 2012 06:48:09 -0400 Received: from mx0.aculab.com ([213.249.233.131]:46773 "HELO mx0.aculab.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1751071Ab2EIKsH convert rfc822-to-8bit (ORCPT ); Wed, 9 May 2012 06:48:07 -0400 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT Subject: RE: [PATCH] pch_gbe: Adding read memory barriers Date: Wed, 9 May 2012 11:47:42 +0100 Message-ID: In-Reply-To: <4FA822C4.60809@gmail.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PATCH] pch_gbe: Adding read memory barriers Thread-Index: Ac0sh9V5cDAN6R5lTrK7GvkOPTf60gBSEEWA References: <4FA822C4.60809@gmail.com> From: "David Laight" To: "Erwan Velu" , , Cc: X-OriginalArrivalTime: 09 May 2012 10:47:44.0541 (UTC) FILETIME=[2A5794D0:01CD2DD1] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1698 Lines: 47 > Under a strong incoming packet stream and/or high cpu usage, > the pch_gbe driver reports "Receive CRC Error" and discards packet. > > It occurred on an Intel ATOM E620T while running a > 300mbit/sec multicast > network stream leading to a ~100% cpu usage. > > Adding rmb() calls before considering the network card's status solve > this issue. > > Getting it into stable would be perfect as it solves > reliability issues. > > Signed-off-by: Erwan Velu > --- > .../net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c | 3 +++ > 1 files changed, 3 insertions(+), 0 deletions(-) > > diff --git a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c > b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c > index 8035e5f..ace3654 100644 > --- a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c > +++ b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c > @@ -1413,6 +1413,7 @@ static irqreturn_t pch_gbe_intr(int > irq, void *data) > pch_gbe_mac_set_pause_packet(hw); > } > } > + smp_rmb(); /* prevent any other reads before*/ Under the assumption that your memory references are uncached, you only need to stop gcc reordering the object code, Rather than actually adding one of the 'fence' instructions. So you should only need: asm volatile(:::"memory") NFI which define generates that, the defines in the copy of sysdep.h I just looked at always include one of the fences. David -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/