From patchwork Fri Oct 31 13:20:10 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jarek Poplawski X-Patchwork-Id: 6697 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 5953DDDE1A for ; Sat, 1 Nov 2008 00:20:26 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750842AbYJaNUW (ORCPT ); Fri, 31 Oct 2008 09:20:22 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1750800AbYJaNUV (ORCPT ); Fri, 31 Oct 2008 09:20:21 -0400 Received: from ug-out-1314.google.com ([66.249.92.174]:49657 "EHLO ug-out-1314.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750790AbYJaNUU (ORCPT ); Fri, 31 Oct 2008 09:20:20 -0400 Received: by ug-out-1314.google.com with SMTP id 39so1224393ugf.37 for ; Fri, 31 Oct 2008 06:20:18 -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:x-mutt-fcc :user-agent; bh=CPxa1j/PaZLbO+YiWt0aXlT1mv/V+PBrczfbB7/qqaA=; b=I5lFHyvo8ZKQ6Uf76D+RVhgyQJr/2NyUMrf15E/MhabfOe3sZWDrz/ZqScVECz2SMl frhgte2yYEfX7er6ye84Z5S4rUDF/njI0TNXbkZhXTCiJIAYaLOj5s6kvZA3esYZzN1g OXa3THO+6y8cGgHkQDGAJz6e2RZPjsUu6QIzs= 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:x-mutt-fcc:user-agent; b=eU9OjJCa8R4y9BBMgTnBQxJByh44A3+zPBy/4CQrFve3NUtotMx75yLge6GHPljQ13 TJZhEfZtaNY2YEwDIoVpUS9zb7MCOnCGcuQZSfm+aaaWJNpqTdRW1P06COLNrc8ZwWWT 9erKd84Ve5Q4L08NcPxavVJsaWZAASFdtBBXU= Received: by 10.67.15.2 with SMTP id s2mr2655099ugi.38.1225459217295; Fri, 31 Oct 2008 06:20:17 -0700 (PDT) Received: from ff.dom.local (bv170.internetdsl.tpnet.pl [80.53.205.170]) by mx.google.com with ESMTPS id d24sm15794119nfh.16.2008.10.31.06.20.15 (version=SSLv3 cipher=RC4-MD5); Fri, 31 Oct 2008 06:20:16 -0700 (PDT) Date: Fri, 31 Oct 2008 13:20:10 +0000 From: Jarek Poplawski To: Patrick McHardy Cc: David Miller , Stephen Hemminger , Herbert Xu , netdev@vger.kernel.org Subject: [PATCH 1/2] sch_netem: Remove classful functionality Message-ID: <20081031132010.GA18895@ff.dom.local> MIME-Version: 1.0 Content-Disposition: inline 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 Patrick McHardy noticed that: "a lot of the functionality of netem requires the inner tfifo anyways and rate-limiting is usually done on top of netem. So I would suggest so either hard-wire the tfifo qdisc or at least make the assumption that inner qdiscs are work-conserving.", and later: "- a lot of other qdiscs still don't work as inner qdiscs of netem [...]". So, according to his suggestion, this patch removes classful options of netem. The main reason of this change is to remove ops->requeue() method, which is currently used only by netem. Signed-off-by: Jarek Poplawski diff --git a/net/sched/sch_netem.c b/net/sched/sch_netem.c index 3080bd6..2ad0959 100644 --- a/net/sched/sch_netem.c +++ b/net/sched/sch_netem.c @@ -622,95 +622,8 @@ nla_put_failure: return -1; } -static int netem_dump_class(struct Qdisc *sch, unsigned long cl, - struct sk_buff *skb, struct tcmsg *tcm) -{ - struct netem_sched_data *q = qdisc_priv(sch); - - if (cl != 1) /* only one class */ - return -ENOENT; - - tcm->tcm_handle |= TC_H_MIN(1); - tcm->tcm_info = q->qdisc->handle; - - return 0; -} - -static int netem_graft(struct Qdisc *sch, unsigned long arg, struct Qdisc *new, - struct Qdisc **old) -{ - struct netem_sched_data *q = qdisc_priv(sch); - - if (new == NULL) - new = &noop_qdisc; - - sch_tree_lock(sch); - *old = xchg(&q->qdisc, new); - qdisc_tree_decrease_qlen(*old, (*old)->q.qlen); - qdisc_reset(*old); - sch_tree_unlock(sch); - - return 0; -} - -static struct Qdisc *netem_leaf(struct Qdisc *sch, unsigned long arg) -{ - struct netem_sched_data *q = qdisc_priv(sch); - return q->qdisc; -} - -static unsigned long netem_get(struct Qdisc *sch, u32 classid) -{ - return 1; -} - -static void netem_put(struct Qdisc *sch, unsigned long arg) -{ -} - -static int netem_change_class(struct Qdisc *sch, u32 classid, u32 parentid, - struct nlattr **tca, unsigned long *arg) -{ - return -ENOSYS; -} - -static int netem_delete(struct Qdisc *sch, unsigned long arg) -{ - return -ENOSYS; -} - -static void netem_walk(struct Qdisc *sch, struct qdisc_walker *walker) -{ - if (!walker->stop) { - if (walker->count >= walker->skip) - if (walker->fn(sch, 1, walker) < 0) { - walker->stop = 1; - return; - } - walker->count++; - } -} - -static struct tcf_proto **netem_find_tcf(struct Qdisc *sch, unsigned long cl) -{ - return NULL; -} - -static const struct Qdisc_class_ops netem_class_ops = { - .graft = netem_graft, - .leaf = netem_leaf, - .get = netem_get, - .put = netem_put, - .change = netem_change_class, - .delete = netem_delete, - .walk = netem_walk, - .tcf_chain = netem_find_tcf, - .dump = netem_dump_class, -}; - static struct Qdisc_ops netem_qdisc_ops __read_mostly = { .id = "netem", - .cl_ops = &netem_class_ops, .priv_size = sizeof(struct netem_sched_data), .enqueue = netem_enqueue, .dequeue = netem_dequeue,