From patchwork Tue Oct 14 09:55:13 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jarek Poplawski X-Patchwork-Id: 4436 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 258FBDE095 for ; Tue, 14 Oct 2008 20:55:28 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755187AbYJNJzV (ORCPT ); Tue, 14 Oct 2008 05:55:21 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755181AbYJNJzT (ORCPT ); Tue, 14 Oct 2008 05:55:19 -0400 Received: from ug-out-1314.google.com ([66.249.92.170]:52657 "EHLO ug-out-1314.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755168AbYJNJzS (ORCPT ); Tue, 14 Oct 2008 05:55:18 -0400 Received: by ug-out-1314.google.com with SMTP id k3so850192ugf.37 for ; Tue, 14 Oct 2008 02:55:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:mime-version:content-type:content-disposition :in-reply-to:x-mutt-fcc:user-agent; bh=En2FUVK1AG5Wb0FpGSCuhEexCWS10NeMq9ZgHuXi6Sk=; b=Bcf7d4b1E+zyfVvOnNczztEdj/eWi71v60mAk8/hsNaBfMS+wiw6r/RMZtG2f3sXto fVZogLoBPbKQ2/sFClmLjseJ8nL0OzVV402a3CJXPQJxA4/amdBpdAK7qUcLbaYrwHyX tXf9Bcwd9flJLEVrh3EH3vhb8WuMyXG1bcqGw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:in-reply-to:x-mutt-fcc:user-agent; b=jKNzXE2zT9quYjd3pV9yxN44td9Ll5oVOvpjcCmPvX3/GJlABIZ2gaM5ZtoTj2bAAR xRZdkxFa/2nZyL/Sq7a7ACShXF84Ryf2boNVFQPKf87+JekkWLLUWsqiyUIe7jq0Ti9Z If0MR/+jiZ0Bio/z3/oSrMfLaU2Pzcr+UaJVQ= Received: by 10.66.239.16 with SMTP id m16mr4209360ugh.9.1223978117441; Tue, 14 Oct 2008 02:55:17 -0700 (PDT) Received: from ff.dom.local (bv170.internetdsl.tpnet.pl [80.53.205.170]) by mx.google.com with ESMTPS id l20sm489564uga.16.2008.10.14.02.55.16 (version=SSLv3 cipher=RC4-MD5); Tue, 14 Oct 2008 02:55:17 -0700 (PDT) Date: Tue, 14 Oct 2008 09:55:13 +0000 From: Jarek Poplawski To: David Miller Cc: netdev@vger.kernel.org Subject: [PATCH 11/14] pkt_sched: Use qdisc_requeue() wrapper instead of open-coding. Message-ID: <20081014095513.GL10804@ff.dom.local> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mutt-Fcc: =outbox User-Agent: Mutt/1.5.18 (2008-05-17) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Replace __skb_queue_head() and __skb_queue_tail() to sch->requeue list with qdisc_requeue(). This change adds btw. updates of sch->q.qlen and other stats, and uses __skb_queue_head() everywhere, which is proper replacement for qdisc->ops->requeue() previously used here. Signed-off-by: Jarek Poplawski --- net/sched/sch_atm.c | 2 +- net/sched/sch_hfsc.c | 2 +- net/sched/sch_netem.c | 4 ++-- net/sched/sch_tbf.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/net/sched/sch_atm.c b/net/sched/sch_atm.c index 7a34e3e..7f9e884 100644 --- a/net/sched/sch_atm.c +++ b/net/sched/sch_atm.c @@ -482,7 +482,7 @@ static void sch_atm_dequeue(unsigned long data) */ while ((skb = qdisc_dequeue(flow->q))) { if (!atm_may_send(flow->vcc, skb->truesize)) { - __skb_queue_tail(&flow->q->requeue, skb); + qdisc_requeue(flow->q, skb); break; } pr_debug("atm_tc_dequeue: sending on class %p\n", flow); diff --git a/net/sched/sch_hfsc.c b/net/sched/sch_hfsc.c index 5598e73..53153ba 100644 --- a/net/sched/sch_hfsc.c +++ b/net/sched/sch_hfsc.c @@ -896,7 +896,7 @@ qdisc_peek_len(struct Qdisc *sch) return 0; } len = qdisc_pkt_len(skb); - __skb_queue_head(&sch->requeue, skb); + qdisc_requeue(sch, skb); return len; } diff --git a/net/sched/sch_netem.c b/net/sched/sch_netem.c index 17d161b..0fc86b7 100644 --- a/net/sched/sch_netem.c +++ b/net/sched/sch_netem.c @@ -233,7 +233,7 @@ static int netem_enqueue(struct sk_buff *skb, struct Qdisc *sch) */ cb->time_to_send = psched_get_time(); q->counter = 0; - __skb_queue_tail(&q->qdisc->requeue, skb); + qdisc_requeue(q->qdisc, skb); ret = NET_XMIT_SUCCESS; } @@ -282,7 +282,7 @@ static struct sk_buff *netem_dequeue(struct Qdisc *sch) return skb; } - __skb_queue_tail(&q->qdisc->requeue, skb); + qdisc_requeue(q->qdisc, skb); qdisc_watchdog_schedule(&q->watchdog, cb->time_to_send); } diff --git a/net/sched/sch_tbf.c b/net/sched/sch_tbf.c index 708e1eb..9f1a9ce 100644 --- a/net/sched/sch_tbf.c +++ b/net/sched/sch_tbf.c @@ -201,7 +201,7 @@ static struct sk_buff *tbf_dequeue(struct Qdisc* sch) (cf. CSZ, HPFQ, HFSC) */ - __skb_queue_tail(&q->qdisc->requeue, skb); + qdisc_requeue(q->qdisc, skb); sch->qstats.overlimits++; } return NULL;