From patchwork Sun Dec 5 00:09:08 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Changli Gao X-Patchwork-Id: 74283 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.180.67]) by ozlabs.org (Postfix) with ESMTP id 59872B70FD for ; Sun, 5 Dec 2010 11:09:46 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755312Ab0LEAJ3 (ORCPT ); Sat, 4 Dec 2010 19:09:29 -0500 Received: from mail-yw0-f46.google.com ([209.85.213.46]:37149 "EHLO mail-yw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755004Ab0LEAJ3 (ORCPT ); Sat, 4 Dec 2010 19:09:29 -0500 Received: by ywl5 with SMTP id 5so5410543ywl.19 for ; Sat, 04 Dec 2010 16:09:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:date :message-id:x-mailer; bh=XEzOlUkfQpyCPzUjGOBzW9AkBSz0swoQJpvFYARuFZU=; b=aekacCK7aXtlxFqu7tFuRvxzVO9tDRjttgysCtwLmbME8VJzaQI7vJjz0KhVnEMLEV 3BlUpqRtuzo3vqFwX+6Q2hVKlmHeTK+BxJtCkm+EZ21MrFYVI+edT6Rp3KmAEmur0NS5 mXDV8rg5QaV0HAmLKHx6fg0mxPsuzOzFGhuSc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; b=YmthRYqHsihIcoCihtYFRy8zSIMr9LbM0JAN8/naLh8pYk15R7bnQbLB9wc99BYVA8 F+p5yEBt1ZSqJqyCuO15TlMdcwMiKA+VnSHSgKoCAK+7+TLVdK4TlwfufA3VsgLFiEyw 62TYy7Nd5fItfQr8NjJkuDzRA168KtqoHTMmc= Received: by 10.150.186.15 with SMTP id j15mr6522692ybf.395.1291507768414; Sat, 04 Dec 2010 16:09:28 -0800 (PST) Received: from localhost.localdomain ([221.239.34.230]) by mx.google.com with ESMTPS id u68sm2098943yhc.47.2010.12.04.16.09.22 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 04 Dec 2010 16:09:27 -0800 (PST) From: Changli Gao To: "David S. Miller" Cc: Jarek Poplawski , jamal , netdev@vger.kernel.org, Changli Gao Subject: [PATCH net-2.6] ifb: goto resched directly if error happens and dp->tq isn't empty Date: Sun, 5 Dec 2010 08:09:08 +0800 Message-Id: <1291507748-4958-1-git-send-email-xiaosuo@gmail.com> X-Mailer: git-send-email 1.7.1 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org If we break the loop when there are still skbs in tq and no skb in rq, the skbs will be left in txq until new skbs are enqueued into rq. In rare cases, no new skb is queued, then these skbs will stay in rq forever. After this patch, if tq isn't empty when we break the loop, we goto resched directly. Signed-off-by: Changli Gao Signed-off-by: Jamal Hadi Salim --- drivers/net/ifb.c | 2 ++ 1 file changed, 2 insertions(+) -- 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/ifb.c b/drivers/net/ifb.c index ab9f675..fe337bd 100644 --- a/drivers/net/ifb.c +++ b/drivers/net/ifb.c @@ -104,6 +104,8 @@ static void ri_tasklet(unsigned long dev) rcu_read_unlock(); dev_kfree_skb(skb); stats->tx_dropped++; + if (skb_queue_len(&dp->tq) != 0) + goto resched; break; } rcu_read_unlock();