From patchwork Mon Jun 15 09:15:23 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jarek Poplawski X-Patchwork-Id: 28695 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@bilbo.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from ozlabs.org (ozlabs.org [203.10.76.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx.ozlabs.org", Issuer "CA Cert Signing Authority" (verified OK)) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4E136B7112 for ; Mon, 15 Jun 2009 19:15:40 +1000 (EST) Received: by ozlabs.org (Postfix) id 40429DDDA1; Mon, 15 Jun 2009 19:15:40 +1000 (EST) 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 AD3DDDDDA0 for ; Mon, 15 Jun 2009 19:15:39 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751358AbZFOJPa (ORCPT ); Mon, 15 Jun 2009 05:15:30 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1750900AbZFOJP3 (ORCPT ); Mon, 15 Jun 2009 05:15:29 -0400 Received: from mail-fx0-f206.google.com ([209.85.220.206]:41179 "EHLO mail-fx0-f206.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750786AbZFOJP2 (ORCPT ); Mon, 15 Jun 2009 05:15:28 -0400 Received: by fxm2 with SMTP id 2so135469fxm.37 for ; Mon, 15 Jun 2009 02:15:30 -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:references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=iBfDV8IzBZfVQZaXbtf2vphmfTy2ULfcnIabaA7KcoE=; b=GLnGsUO7ZOfoDeMEahdgacgBdhUoLLSd3PmJHKaLL9MqSPdsYgzoIvgSKKI2hv22aa 8kUJ3d9mzNQj8pNqvHpF7XHG5JA937Vr9A3MN3aGU5svm2RUOV9ys9vLR7t27u5t2iu6 0Cy4AGmBylYPRTIQNwJjSCtLs1UqDvdSMZblI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=DXRfMvVbkJmdArNAEU/k+1DTumFzmGCaSH/pBGGSj/7OXep32qQnDf5gBycb/ER2Mf vpdAGzUFKGGDLGeDJ6Dkq7NOJYqLRLFrgMYPpCD5XIH0TuOY5AyzhC27EmKA4qrUhX2z nzwR58J45h5uY+6NNHWApZqUsgi1cL9ecMqkY= Received: by 10.86.30.5 with SMTP id d5mr6449538fgd.26.1245057329809; Mon, 15 Jun 2009 02:15:29 -0700 (PDT) Received: from ff.dom.local (bv170.internetdsl.tpnet.pl [80.53.205.170]) by mx.google.com with ESMTPS id 4sm9747345fgg.23.2009.06.15.02.15.27 (version=SSLv3 cipher=RC4-MD5); Mon, 15 Jun 2009 02:15:29 -0700 (PDT) Date: Mon, 15 Jun 2009 09:15:23 +0000 From: Jarek Poplawski To: David Miller Cc: Patrick McHardy , Antonio Almeida , Stephen Hemminger , netdev@vger.kernel.org, Martin Devera , Eric Dumazet , Vladimir Ivashchenko , Badalian Vyacheslav Subject: [PATCH 3/2] pkt_sched: Rename PSCHED_US2NS and PSCHED_NS2US Message-ID: <20090615091523.GA10411@ff.dom.local> References: <20090609080513.GB5237@ff.dom.local> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20090609080513.GB5237@ff.dom.local> 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 On Tue, Jun 09, 2009 at 08:05:13AM +0000, Jarek Poplawski wrote: ... > This change breaks ticks - microseconds similarity, so some minor code > fixes might be needed. It is also planned to change naming adequately > eg. to PSCHED_TICKS2NS() etc. in the near future. --------------------> pkt_sched: Rename PSCHED_US2NS and PSCHED_NS2US Let's use TICKS instead of US, so PSCHED_TICKS2NS and PSCHED_NS2TICKS (like in PSCHED_TICKS_PER_SEC already) to avoid misleading. Signed-off-by: Jarek Poplawski --- include/net/pkt_sched.h | 8 ++++---- net/sched/sch_api.c | 4 ++-- net/sched/sch_cbq.c | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h index 120935b..82a3191 100644 --- a/include/net/pkt_sched.h +++ b/include/net/pkt_sched.h @@ -43,15 +43,15 @@ typedef long psched_tdiff_t; /* Avoid doing 64 bit divide */ #define PSCHED_SHIFT 6 -#define PSCHED_US2NS(x) ((s64)(x) << PSCHED_SHIFT) -#define PSCHED_NS2US(x) ((x) >> PSCHED_SHIFT) +#define PSCHED_TICKS2NS(x) ((s64)(x) << PSCHED_SHIFT) +#define PSCHED_NS2TICKS(x) ((x) >> PSCHED_SHIFT) -#define PSCHED_TICKS_PER_SEC PSCHED_NS2US(NSEC_PER_SEC) +#define PSCHED_TICKS_PER_SEC PSCHED_NS2TICKS(NSEC_PER_SEC) #define PSCHED_PASTPERFECT 0 static inline psched_time_t psched_get_time(void) { - return PSCHED_NS2US(ktime_to_ns(ktime_get())); + return PSCHED_NS2TICKS(ktime_to_ns(ktime_get())); } static inline psched_tdiff_t diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c index 3200979..24d17ce 100644 --- a/net/sched/sch_api.c +++ b/net/sched/sch_api.c @@ -484,7 +484,7 @@ void qdisc_watchdog_schedule(struct qdisc_watchdog *wd, psched_time_t expires) wd->qdisc->flags |= TCQ_F_THROTTLED; time = ktime_set(0, 0); - time = ktime_add_ns(time, PSCHED_US2NS(expires)); + time = ktime_add_ns(time, PSCHED_TICKS2NS(expires)); hrtimer_start(&wd->timer, time, HRTIMER_MODE_ABS); } EXPORT_SYMBOL(qdisc_watchdog_schedule); @@ -1680,7 +1680,7 @@ static int psched_show(struct seq_file *seq, void *v) hrtimer_get_res(CLOCK_MONOTONIC, &ts); seq_printf(seq, "%08x %08x %08x %08x\n", - (u32)NSEC_PER_USEC, (u32)PSCHED_US2NS(1), + (u32)NSEC_PER_USEC, (u32)PSCHED_TICKS2NS(1), 1000000, (u32)NSEC_PER_SEC/(u32)ktime_to_ns(timespec_to_ktime(ts))); diff --git a/net/sched/sch_cbq.c b/net/sched/sch_cbq.c index d728d81..23a1676 100644 --- a/net/sched/sch_cbq.c +++ b/net/sched/sch_cbq.c @@ -509,7 +509,7 @@ static void cbq_ovl_delay(struct cbq_class *cl) q->pmask |= (1<delay_timer) && ktime_to_ns(ktime_sub( hrtimer_get_expires(&q->delay_timer), @@ -620,7 +620,7 @@ static enum hrtimer_restart cbq_undelay(struct hrtimer *timer) ktime_t time; time = ktime_set(0, 0); - time = ktime_add_ns(time, PSCHED_US2NS(now + delay)); + time = ktime_add_ns(time, PSCHED_TICKS2NS(now + delay)); hrtimer_start(&q->delay_timer, time, HRTIMER_MODE_ABS); }