From patchwork Sat Nov 5 02:32:56 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Soltys X-Patchwork-Id: 123805 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 913C3B70BB for ; Sat, 5 Nov 2011 13:33:26 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753719Ab1KECdY (ORCPT ); Fri, 4 Nov 2011 22:33:24 -0400 Received: from tha.ppgk.com.pl ([77.252.116.179]:15225 "EHLO tha.ppgk.com.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753635Ab1KECdM (ORCPT ); Fri, 4 Nov 2011 22:33:12 -0400 Received: from localhost.ppgk.com.pl (localhost [127.0.0.1]) by tha.ppgk.com.pl (Postfix) with ESMTP id B06E73761F; Sat, 5 Nov 2011 03:33:11 +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 RVPSvY6e0YUY; Sat, 5 Nov 2011 03:33:11 +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 B60D237622; Sat, 5 Nov 2011 03:33:05 +0100 (CET) From: Michal Soltys To: kaber@trash.net Cc: davem@davemloft.net, netdev@vger.kernel.org Subject: [PATCH 10/11] sch_hfsc.c: make sure classes are able to use 1st segment on fresh backlog period Date: Sat, 5 Nov 2011 03:32:56 +0100 Message-Id: <1320460377-8682-11-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 This change guarantees, that when a class starts fresh backlog period, it will be able to use its 1st segment for subsequent vt update. --- net/sched/sch_hfsc.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/net/sched/sch_hfsc.c b/net/sched/sch_hfsc.c index 26cdfaa..2109878 100644 --- a/net/sched/sch_hfsc.c +++ b/net/sched/sch_hfsc.c @@ -88,6 +88,7 @@ struct internal_sc { u64 dy; /* the y-projection of the 1st segment */ u64 sm2; /* scaled slope of the 2nd segment */ u64 ism2; /* scaled inverse-slope of the 2nd segment */ + u64 i2dy; /* x-projection of dy, using 2nd slope */ }; /* runtime service curve */ @@ -531,6 +532,7 @@ sc2isc(struct tc_service_curve *sc, struct internal_sc *isc) isc->dy = seg_x2y(isc->dx, isc->sm1); isc->sm2 = m2sm(sc->m2); isc->ism2 = m2ism(sc->m2); + isc->i2dy = seg_y2x(isc->dy, isc->ism2); } /* @@ -885,8 +887,8 @@ set_passive(struct hfsc_class *cl) break; /* update cl_cvtoff of the parent class */ - if (cl->cl_vt > cl->cl_parent->cl_cvtoff) - cl->cl_parent->cl_cvtoff = cl->cl_vt; + if (cl->cl_vt + cl->cl_fsc.i2dy > cl->cl_parent->cl_cvtoff) + cl->cl_parent->cl_cvtoff = cl->cl_vt + cl->cl_fsc.i2dy; /* remove this class from the parent's vt & cf trees */ vttree_remove(cl);