From patchwork Sun May 31 02:57:49 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zhang, Sonic" X-Patchwork-Id: 27878 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@bilbo.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from ozlabs.org (ozlabs.org [203.10.76.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx.ozlabs.org", Issuer "CA Cert Signing Authority" (verified OK)) by bilbo.ozlabs.org (Postfix) with ESMTPS id 420F0B707D for ; Sun, 31 May 2009 12:57:38 +1000 (EST) Received: by ozlabs.org (Postfix) id 2B6A5DDDA0; Sun, 31 May 2009 12:57:38 +1000 (EST) Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id C09FADDD0C for ; Sun, 31 May 2009 12:57:37 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754460AbZEaC4o (ORCPT ); Sat, 30 May 2009 22:56:44 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752891AbZEaC4n (ORCPT ); Sat, 30 May 2009 22:56:43 -0400 Received: from nwd2mail10.analog.com ([137.71.25.55]:11865 "EHLO nwd2mail10.analog.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752508AbZEaC4m convert rfc822-to-8bit (ORCPT ); Sat, 30 May 2009 22:56:42 -0400 From: "Zhang, Sonic" X-IronPort-AV: E=Sophos;i="4.41,277,1241409600"; d="scan'208";a="88179745" Received: from nwd2hubcas2.ad.analog.com ([10.64.73.30]) by nwd2mail10.analog.com with ESMTP; 30 May 2009 22:56:44 -0400 Received: from nwd2exm4.ad.analog.com (10.64.53.123) by NWD2HUBCAS2.ad.analog.com (10.64.73.30) with Microsoft SMTP Server id 8.1.358.0; Sat, 30 May 2009 22:56:44 -0400 Received: from chinexm1.ad.analog.com ([10.99.27.42]) by nwd2exm4.ad.analog.com with Microsoft SMTPSVC(6.0.3790.3959); Sat, 30 May 2009 22:56:43 -0400 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-Class: urn:content-classes:message MIME-Version: 1.0 Subject: RE: [PATCH 2/4 v2] netdev: bfin_mac: fix malformed UDP packet transmission when polling with KGDB Date: Sun, 31 May 2009 10:57:49 +0800 Message-ID: <0F1B54C89D5F954D8535DB252AF412FA041F17F9@chinexm1.ad.analog.com> In-Reply-To: <1243604443-27204-1-git-send-email-vapier@gentoo.org> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PATCH 2/4 v2] netdev: bfin_mac: fix malformed UDP packet transmission when polling with KGDB Thread-Index: AcngYxb6SpfJ1eN4Rdu7x7N8FZqvLQBOHaDQ References: <1243404615-25879-3-git-send-email-vapier@gentoo.org> <1243604443-27204-1-git-send-email-vapier@gentoo.org> To: "Mike Frysinger" , CC: , "Bryan Wu" X-OriginalArrivalTime: 31 May 2009 02:56:43.0872 (UTC) FILETIME=[6E043600:01C9E19B] Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org OK. Mike's explanation is correct. Sonic -----Original Message----- From: Mike Frysinger [mailto:vapier@gentoo.org] Sent: Friday, May 29, 2009 9:41 PM To: netdev@vger.kernel.org Cc: uclinux-dist-devel@blackfin.uclinux.org; Zhang, Sonic; Bryan Wu Subject: [PATCH 2/4 v2] netdev: bfin_mac: fix malformed UDP packet transmission when polling with KGDB From: Sonic Zhang Writes to the DMA descriptors may sit in the internal Blackfin data buffers and not actually be available when the DMA engine goes to fetch them. This does not typically happen, but when dealing with short/fast packets such as UDP and polling KGDB, this occurs much more frequently. Same goes for heavy loads as seen by netperf tests or large scp transfers. So force the buffers to drain with SSYNC otherwise we get random malformed packets. Signed-off-by: Sonic Zhang Signed-off-by: Mike Frysinger Signed-off-by: Bryan Wu --- v2 - make comment/changelog reflect what is actually going on drivers/net/bfin_mac.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) -- 1.6.3.1 -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/net/bfin_mac.c b/drivers/net/bfin_mac.c index 1905532..38d34ce 100644 --- a/drivers/net/bfin_mac.c +++ b/drivers/net/bfin_mac.c @@ -688,6 +688,12 @@ static int bfin_mac_hard_start_xmit(struct sk_buff *skb, } } + /* make sure the internal data buffers in the core are drained + * so that the DMA descriptors are completely written when the + * DMA engine goes to fetch them below + */ + SSYNC(); + /* enable this packet's dma */ current_tx_ptr->desc_a.config |= DMAEN;