From patchwork Fri Feb 27 15:51:05 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guo-Fu Tseng X-Patchwork-Id: 23815 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.176.167]) by ozlabs.org (Postfix) with ESMTP id C9B98DDD0B for ; Sat, 28 Feb 2009 02:52:47 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755739AbZB0Pwf (ORCPT ); Fri, 27 Feb 2009 10:52:35 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755740AbZB0Pwe (ORCPT ); Fri, 27 Feb 2009 10:52:34 -0500 Received: from cooldavid.org ([220.133.139.86]:55157 "EHLO cooldavid.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755720AbZB0Pwe (ORCPT ); Fri, 27 Feb 2009 10:52:34 -0500 Received: from cooldavid.org (localhost [127.0.0.1]) by cooldavid.org (Postfix) with ESMTP id 1DC1CF554; Fri, 27 Feb 2009 23:51:06 +0800 (CST) From: "Guo-Fu Tseng" To: roel kluin Cc: "David S. Miller" , netdev@vger.kernel.org, Andrew Morton Reply-To: cooldavid@cooldavid.org Subject: Re: [PATCH] net: more timeouts that reach -1 Date: Fri, 27 Feb 2009 23:51:05 +0800 Message-Id: <20090227154440.M53654@cooldavid.org> In-Reply-To: <25e057c00902270737x529fb5b8m2fdbb044fa75ab0d@mail.gmail.com> References: <49A5286D.80304@gmail.com> <20090227114015.M80857@cooldavid.org> <25e057c00902270737x529fb5b8m2fdbb044fa75ab0d@mail.gmail.com> X-Mailer: Open WebMail 2.51 20050228 X-OriginatingIP: 140.117.176.176 (cooldavid) MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Fri, 27 Feb 2009 16:37:30 +0100, roel kluin wrote > On Fri, Feb 27, 2009 at 12:43 PM, Guo-Fu Tseng wrote: > > There should be no difference after this modification. > > The return value of this function is: "limit > 0 ? limit : 0;" > > There is: > In the last iteration limit is 1 during the test before it is decremented to 0. > > rxdesc = rxring->desc; > rxdesc += i; > > If then we break out of the loop by the 'goto out;', we continue with: > > out: > atomic_set(&rxring->next_to_clean, i); > > out_inc: > atomic_inc(&jme->rx_cleaning); > > but since limit is already decremented, 0 is returned. > > > > > Guo-Fu Tseng > > > > Roel I see. But the correct patch should be following one, right? Guo-Fu Tseng --- 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 =================================================================== --- jme.c (revision 580) +++ jme.c (working copy) @@ -958,13 +958,14 @@ goto out_inc; i = atomic_read(&rxring->next_to_clean); - while (limit-- > 0) { + while (limit > 0) { rxdesc = rxring->desc; rxdesc += i; if ((rxdesc->descwb.flags & RXWBFLAG_OWN) || !(rxdesc->descwb.desccnt & RXWBDCNT_WBCPL)) goto out; + --limit; desccnt = rxdesc->descwb.desccnt & RXWBDCNT_DCNT;