From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sonic Zhang Subject: Re: [PATCH 06/11] netdev: bfin_mac: avoid tx skb overflows in the tx DMA ring Date: Thu, 20 May 2010 18:36:08 +0800 Message-ID: References: <20100519.131219.172592870.davem@davemloft.net> <20100520.030835.267363374.davem@davemloft.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: netdev@vger.kernel.org To: David Miller Return-path: Received: from mail-pw0-f46.google.com ([209.85.160.46]:43204 "EHLO mail-pw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755053Ab0ETKgJ convert rfc822-to-8bit (ORCPT ); Thu, 20 May 2010 06:36:09 -0400 Received: by pwi5 with SMTP id 5so2019511pwi.19 for ; Thu, 20 May 2010 03:36:08 -0700 (PDT) In-Reply-To: <20100520.030835.267363374.davem@davemloft.net> Sender: netdev-owner@vger.kernel.org List-ID: On Thu, May 20, 2010 at 6:08 PM, David Miller wro= te: > From: Sonic Zhang > Date: Thu, 20 May 2010 17:38:07 +0800 > >> On Thu, May 20, 2010 at 4:12 AM, David Miller = wrote: >>> From: Sonic Zhang >>> Date: Wed, 19 May 2010 17:23:16 +0800 >>> >>>> No, this doesn't happen, because before ndo_start_xmit() returns, = the >>>> old TX buffers and skbs in the ring, which finished DMA operation,= are >>>> freed. The only difference is that the free operation of a skb is = done >>>> in next tx transfer. >>> >>> This is still illegal. >>> >>> What if TX activity stops right then, and there is no "next tx >>> transfer"? >>> >> The skb remain in the TX ring will be freed finally when ndo_stop() = is >> called to shutdown the network. So, this is not a problem. > > You really don't understand me, and I'm starting to get really > frustrated. =A0You must free all packets in your TX ring in a very > small, finite, amount of time. =A0This is not optional. =A0And this > must happen regardless of what TX traffic which occurs in the future, > that means it must happen even if TX traffic suddenly stops. > OK. I didn't figure out that the socket may not be closed if its skbs stay active somewhere in system for a long time. Thanks for your explanation. I will send a new patch to enabled tx interrupt and free skb from tx ring immediately. Sonic > Your driver's behavior is absolutely not acceptable. > > Leaving the SKB In the TX ring like that means that potentially there > is a socket in the system or other major resource that cannot be rele= ased > and freed up. > > Please stop your driver from keeping packets in the TX ring indefinit= ely. >