From patchwork Sat Nov 5 02:32:51 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Soltys X-Patchwork-Id: 123806 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 2779DB70BB for ; Sat, 5 Nov 2011 13:33:33 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753565Ab1KECdL (ORCPT ); Fri, 4 Nov 2011 22:33:11 -0400 Received: from tha.ppgk.com.pl ([77.252.116.179]:16183 "EHLO tha.ppgk.com.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753526Ab1KECdJ (ORCPT ); Fri, 4 Nov 2011 22:33:09 -0400 Received: from localhost.ppgk.com.pl (localhost [127.0.0.1]) by tha.ppgk.com.pl (Postfix) with ESMTP id 909A337627; Sat, 5 Nov 2011 03:33:08 +0100 (CET) X-PPGK-Scanned: amavisd-new 2.6.4 (20090625) at ppgk.com.pl Received: from tha.ppgk.com.pl ([127.0.0.1]) by localhost.ppgk.com.pl (tha.ppgk.com.pl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id Jur6k-kWcLtV; Sat, 5 Nov 2011 03:33:07 +0100 (CET) Received: from localhost.localdomain (89-68-135-233.dynamic.chello.pl [89.68.135.233]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by tha.ppgk.com.pl (Postfix) with ESMTPSA id A3FF3375FB; Sat, 5 Nov 2011 03:33:04 +0100 (CET) From: Michal Soltys To: kaber@trash.net Cc: davem@davemloft.net, netdev@vger.kernel.org Subject: [PATCH 05/11] sch_hfsc.c: don't subtract from cl_vtoff and cl_cvtoff Date: Sat, 5 Nov 2011 03:32:51 +0100 Message-Id: <1320460377-8682-6-git-send-email-soltys@ziu.info> X-Mailer: git-send-email 1.7.7.1 In-Reply-To: <1320460377-8682-1-git-send-email-soltys@ziu.info> References: <1320460377-8682-1-git-send-email-soltys@ziu.info> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Using pcvtoff to keep vtoff as close to 0 as possible is not necessary. All curves (based on real or virtual time) use the same mechanics, and real time based ones are obviously not even allowed anything like that. This might be some leftover from earlier hfsc versions (or perhaps versions [that are/were ?] limited to 32 bit values only, where such thing would help a bit against hitting overflow ... though what about RSC/USC ?). Signed-off-by: Michal Soltys --- net/sched/sch_hfsc.c | 11 +---------- 1 files changed, 1 insertions(+), 10 deletions(-) diff --git a/net/sched/sch_hfsc.c b/net/sched/sch_hfsc.c index 97d720c..e0cf11b 100644 --- a/net/sched/sch_hfsc.c +++ b/net/sched/sch_hfsc.c @@ -155,8 +155,6 @@ struct hfsc_class { u64 cl_vtoff; /* inter-period cumulative vt offset */ u64 cl_cvtmax; /* max child's vt in the last period */ u64 cl_cvtoff; /* cumulative cvtmax of all periods */ - u64 cl_pcvtoff; /* parent's cvtoff at initialization - time */ struct internal_sc cl_rsc; /* internal real-time service curve */ struct internal_sc cl_fsc; /* internal fair service curve */ @@ -719,17 +717,12 @@ init_vf(struct hfsc_class *cl, unsigned int len) cl->cl_vt = 0; } - cl->cl_vtoff = cl->cl_parent->cl_cvtoff - - cl->cl_pcvtoff; + cl->cl_vtoff = cl->cl_parent->cl_cvtoff; /* update the virtual curve */ vt = cl->cl_vt + cl->cl_vtoff; rtsc_min(&cl->cl_virtual, &cl->cl_fsc, vt, cl->cl_total); - if (cl->cl_virtual.x == vt) { - cl->cl_virtual.x -= cl->cl_vtoff; - cl->cl_vtoff = 0; - } cl->cl_vtadj = 0; cl->cl_vtperiod++; /* increment vt period */ @@ -1102,7 +1095,6 @@ hfsc_change_class(struct Qdisc *sch, u32 classid, u32 parentid, if (parent->level == 0) hfsc_purge_queue(sch, parent); hfsc_adjust_levels(parent); - cl->cl_pcvtoff = parent->cl_cvtoff; sch_tree_unlock(sch); qdisc_class_hash_grow(sch, &q->clhash); @@ -1500,7 +1492,6 @@ hfsc_reset_class(struct hfsc_class *cl) cl->cl_cvtmin = 0; cl->cl_cvtmax = 0; cl->cl_cvtoff = 0; - cl->cl_pcvtoff = 0; cl->cl_vtperiod = 0; cl->cl_parentperiod = 0; cl->cl_f = 0;