Netdev List
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Jiri Pirko <jiri@resnulli.us>
Cc: netdev@vger.kernel.org, davem@davemloft.net, edumazet@google.com,
	jhs@mojatatu.com, kuznet@ms2.inr.ac.ru
Subject: Re: [patch net-next 5/7] sch: make htb_rate_cfg and functions around that generic
Date: Fri, 08 Feb 2013 08:39:49 -0800	[thread overview]
Message-ID: <1360341589.28557.102.camel@edumazet-glaptop> (raw)
In-Reply-To: <1360328327-7144-6-git-send-email-jiri@resnulli.us>

On Fri, 2013-02-08 at 13:58 +0100, Jiri Pirko wrote:
> As it is going to be used in tbf as well, push these to generic code.
> 
> Signed-off-by: Jiri Pirko <jiri@resnulli.us>
> ---
>  include/net/sch_generic.h | 18 +++++++++++++
>  net/sched/sch_generic.c   | 37 +++++++++++++++++++++++++++
>  net/sched/sch_htb.c       | 65 +++++++----------------------------------------
>  3 files changed, 64 insertions(+), 56 deletions(-)
> 
> diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
> index 2d06c2a..c7e5512 100644
> --- a/include/net/sch_generic.h
> +++ b/include/net/sch_generic.h
> @@ -679,4 +679,22 @@ static inline struct sk_buff *skb_act_clone(struct sk_buff *skb, gfp_t gfp_mask,
>  }
>  #endif
>  
> +struct psched_ratecfg {
> +	u64 rate_bps;
> +	u32 mult;
> +	u32 shift;
> +};
> +
> +static inline u64 psched_l2t_ns(struct psched_ratecfg *r, unsigned int len)

 const struct psched_ratecfg *r

> +{
> +	return ((u64)len * r->mult) >> r->shift;
> +}
> +
> +extern void psched_ratecfg_precompute(struct psched_ratecfg *r, u32 rate);
> +
> +static inline u32 psched_ratecfg_getrate(struct psched_ratecfg *r)

const struct psched_ratecfg *r

> +{
> +	return r->rate_bps >> 3;
> +}
> +

other than that, patch is fine.

Acked-by: Eric Dumazet <edumazet@google.com>

  reply	other threads:[~2013-02-08 16:39 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-08 12:58 [patch net-next 0/7] couple of net/sched fixes+improvements Jiri Pirko
2013-02-08 12:58 ` [patch net-next 1/7] htb: use PSCHED_TICKS2NS() Jiri Pirko
2013-02-08 15:51   ` Eric Dumazet
2013-02-08 12:58 ` [patch net-next 2/7] htb: fix values in opt dump Jiri Pirko
2013-02-08 15:54   ` Eric Dumazet
2013-02-08 16:02     ` Jiri Pirko
2013-02-08 12:58 ` [patch net-next 3/7] htb: remove pointless first initialization of buffer and cbuffer Jiri Pirko
2013-02-08 16:35   ` Eric Dumazet
2013-02-08 12:58 ` [patch net-next 4/7] htb: initialize cl->tokens and cl->ctokens correctly Jiri Pirko
2013-02-08 16:36   ` Eric Dumazet
2013-02-08 12:58 ` [patch net-next 5/7] sch: make htb_rate_cfg and functions around that generic Jiri Pirko
2013-02-08 16:39   ` Eric Dumazet [this message]
2013-02-08 12:58 ` [patch net-next 6/7] tbf: improved accuracy at high rates Jiri Pirko
2013-02-08 16:42   ` Eric Dumazet
2013-02-08 12:58 ` [patch net-next 7/7] tbf: ignore max_size check for gso skbs Jiri Pirko
2013-02-08 16:43   ` Eric Dumazet

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1360341589.28557.102.camel@edumazet-glaptop \
    --to=eric.dumazet@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=jhs@mojatatu.com \
    --cc=jiri@resnulli.us \
    --cc=kuznet@ms2.inr.ac.ru \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox