Received: with ECARTIS (v1.0.0; list netdev); Wed, 04 Aug 2004 12:53:21 -0700 (PDT) Received: from www.legaleagle.de (legaleagle.de [217.160.128.82]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i74JrDKN014860 for ; Wed, 4 Aug 2004 12:53:14 -0700 Received: from eru.coreworks.de (unknown [172.16.0.2]) by www.legaleagle.de (Postfix) with ESMTP id A49F519F356; Wed, 4 Aug 2004 21:53:04 +0200 (CEST) Received: from trash.net (unknown [172.16.0.123]) by eru.coreworks.de (Postfix) with ESMTP id E5586394133; Wed, 4 Aug 2004 21:53:03 +0200 (CEST) Message-ID: <41113F36.8050204@trash.net> Date: Wed, 04 Aug 2004 21:55:34 +0200 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040413 Debian/1.6-5 X-Accept-Language: en MIME-Version: 1.0 To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: Re: [PATCH 2.6 3/5]: Use double-linked list for dev->qdisc_list References: <410FAE42.2050909@trash.net> <20040804094308.606f79bd.davem@redhat.com> In-Reply-To: <20040804094308.606f79bd.davem@redhat.com> Content-Type: multipart/mixed; boundary="------------030100070902050203020709" X-archive-position: 7511 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev Content-Length: 1881 Lines: 75 This is a multi-part message in MIME format. --------------030100070902050203020709 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit David S. Miller wrote: >On Tue, 03 Aug 2004 17:24:50 +0200 >Patrick McHardy wrote: > > > >>This patch changes dev->qdisc_list to a double-linked list. This solves >>the performance problems when destroying qdiscs with large number of inner >>qdiscs. >> >> > >I don't see how this bit is correct: > > You're right. This patch on top fixes the problem. --------------030100070902050203020709 Content-Type: text/plain; name="x" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="x" # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2004/08/04 21:51:04+02:00 kaber@coreworks.de # [PKT_SCHED]: Fix q_idx calculation in tc_dump_qdisc # # Signed-off-by: Patrick McHardy # # net/sched/sch_api.c # 2004/08/04 21:50:44+02:00 kaber@coreworks.de +5 -2 # [PKT_SCHED]: Fix q_idx calculation in tc_dump_qdisc # diff -Nru a/net/sched/sch_api.c b/net/sched/sch_api.c --- a/net/sched/sch_api.c 2004-08-04 21:55:13 +02:00 +++ b/net/sched/sch_api.c 2004-08-04 21:55:13 +02:00 @@ -817,13 +817,16 @@ read_lock_bh(&qdisc_tree_lock); q_idx = 0; list_for_each_entry(q, &dev->qdisc_list, list) { - if (q_idx++ < s_q_idx) + if (q_idx < s_q_idx) { + q_idx++; continue; + } if (tc_fill_qdisc(skb, q, 0, NETLINK_CB(cb->skb).pid, cb->nlh->nlmsg_seq, NLM_F_MULTI, RTM_NEWQDISC) <= 0) { read_unlock_bh(&qdisc_tree_lock); goto done; } + q_idx++; } read_unlock_bh(&qdisc_tree_lock); } @@ -832,7 +835,7 @@ read_unlock(&dev_base_lock); cb->args[0] = idx; - cb->args[1] = q_idx - 1; + cb->args[1] = q_idx; return skb->len; } --------------030100070902050203020709--