[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <E1KONdU-00015S-00@gondolin.me.apana.org.au>
Date: Thu, 31 Jul 2008 10:11:24 +0800
From: Herbert Xu <herbert@...dor.apana.org.au>
To: jussi.kivilinna@...et.fi (Jussi Kivilinna)
Cc: davem@...emloft.net, netdev@...r.kernel.org
Subject: Re: [PATCH] net-sched: add packet length pointer parameter for qdisc_enqueue
Jussi Kivilinna <jussi.kivilinna@...et.fi> wrote:
>
> diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
> index b5f40d7..a428b93 100644
> --- a/include/net/sch_generic.h
> +++ b/include/net/sch_generic.h
> @@ -331,19 +331,22 @@ static inline unsigned int qdisc_pkt_len(struct sk_buff *skb)
> return qdisc_skb_cb(skb)->pkt_len;
> }
>
> -static inline int qdisc_enqueue(struct sk_buff *skb, struct Qdisc *sch)
> +static inline int qdisc_enqueue(struct sk_buff *skb, struct Qdisc *sch,
> + unsigned int *pkt_len)
> {
> #ifdef CONFIG_NET_SCHED
> if (sch->stab)
> qdisc_calculate_pkt_len(skb, sch->stab);
> #endif
> + if (likely(pkt_len != NULL))
> + *pkt_len = qdisc_pkt_len(skb);
Icky! Why can't you do this in the caller instead? Calculating
the packet length isn't related to the act of enqueueing.
Cheers,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@...dor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists