Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756970AbbEESx5 (ORCPT ); Tue, 5 May 2015 14:53:57 -0400 Received: from smtprelay0042.hostedemail.com ([216.40.44.42]:51360 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751155AbbEESxz (ORCPT ); Tue, 5 May 2015 14:53:55 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::::::,RULES_HIT:41:355:379:421:541:599:800:960:973:982:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2194:2199:2393:2559:2562:2693:2729:2828:2892:2895:2904:3138:3139:3140:3141:3142:3354:3622:3865:3866:3867:3870:3871:3872:3873:3874:4225:4321:5007:6261:7576:7903:10004:10400:10848:11232:11658:11914:12043:12517:12519:12740:13069:13311:13357:13972:14096:14097:21080,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0 X-HE-Tag: pen79_481aecc2714c X-Filterd-Recvd-Size: 2890 Message-ID: <1430852029.6575.13.camel@perches.com> Subject: Re: [PATCH 02/12] net: axienet: Handle 0 packet receive gracefully From: Joe Perches To: Michal Simek Cc: netdev@vger.kernel.org, Peter Crosthwaite , =?ISO-8859-1?Q?S=F6ren?= Brinkmann , monstr@monstr.eu, John Linn , Anirudha Sarangi , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Date: Tue, 05 May 2015 11:53:49 -0700 In-Reply-To: <554910D1.1030706@xilinx.com> References: <7fb84f65a61bbe0fdb4b61a871cf4d4f7910955d.1430817941.git.michal.simek@xilinx.com> <55b3c89b3549c61d62b8440636516fd572870842.1430817941.git.michal.simek@xilinx.com> <1430834264.7191.9.camel@perches.com> <554910D1.1030706@xilinx.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.12.11-0ubuntu3 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1875 Lines: 42 On Tue, 2015-05-05 at 20:49 +0200, Michal Simek wrote: > On 05/05/2015 03:57 PM, Joe Perches wrote: > > On Tue, 2015-05-05 at 11:25 +0200, Michal Simek wrote: > >> From: Peter Crosthwaite > >> > >> The AXI-DMA rx-delay interrupt can sometimes be triggered > >> when there are 0 outstanding packets received. This is due > >> to the fact that the receive function will greedily consume > >> as many packets as possible on interrupt. So if two packets > >> (with a very particular timing) arrive in succession they > >> will each cause the rx-delay interrupt, but the first interrupt > >> will consume both packets. > >> This means the second interrupt is a 0 packet receive. > >> > >> This is mostly OK, except that the tail pointer register is > >> updated unconditionally on receive. Currently the tail pointer > >> is always set to the current bd-ring descriptor under > >> the assumption that the hardware has moved onto the next > >> descriptor. What this means for length 0 recv is the current > >> descriptor that the hardware is potentially yet to use will > >> be marked as the tail. This causes the hardware to think > >> its run out of descriptors deadlocking the whole rx path. > >> > >> Fixed by updating the tail pointer to the most recent > >> successfully consumed descriptor. > > > > I think some of this would be good to have as comments > > in the code instead of just in the changelog. > Is it really needed? If yes, no problem to add it but git blame can > point you to that. That's up to you. I think that useful but concealed information is always hard to follow or find. -- 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/