lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4D286823.8050707@gmail.com>
Date:	Sat, 08 Jan 2011 14:35:31 +0100
From:	Jarek Poplawski <jarkao2@...il.com>
To:	Eric Dumazet <eric.dumazet@...il.com>
CC:	Stephen Hemminger <shemminger@...tta.com>,
	Changli Gao <xiaosuo@...il.com>,
	David Miller <davem@...emloft.net>,
	Fabio Checconi <fabio@...dalf.sssup.it>,
	netdev@...r.kernel.org, Luigi Rizzo <rizzo@....unipi.it>
Subject: Re: [PATCH] net_sched: factorize qdisc stats handling

Eric Dumazet wrote:
...
> -static inline void __qdisc_update_bstats(struct Qdisc *sch, unsigned int len)
> +
> +static inline void bstats_update(struct gnet_stats_basic_packed *bstats,
> +				 struct sk_buff *skb)
> +{
> +	bstats->bytes += qdisc_pkt_len(skb);
> +	bstats->packets += skb_is_gso(skb) ? skb_shinfo(skb)->gso_segs : 1;
> +}
> +
> +static inline void qdisc_bstats_update(struct Qdisc *sch, struct sk_buff *skb)
>  {
> -	sch->bstats.bytes += len;
> -	sch->bstats.packets++;
> +	bstats_update(&sch->bstats, skb);
>  }
>  
>  static inline int __qdisc_enqueue_tail(struct sk_buff *skb, struct Qdisc *sch,
> @@ -437,7 +444,7 @@ static inline int __qdisc_enqueue_tail(struct sk_buff *skb, struct Qdisc *sch,
>  {
>  	__skb_queue_tail(list, skb);
>  	sch->qstats.backlog += qdisc_pkt_len(skb);
> -	__qdisc_update_bstats(sch, qdisc_pkt_len(skb));
> +	qdisc_bstats_update(sch, skb);
>  
>  	return NET_XMIT_SUCCESS;
>  }
> diff --git a/net/core/dev.c b/net/core/dev.c
> index a215269..ab60f58 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -2301,7 +2301,7 @@ static inline int __dev_xmit_skb(struct sk_buff *skb, struct Qdisc *q,
>  		 */
>  		if (!(dev->priv_flags & IFF_XMIT_DST_RELEASE))
>  			skb_dst_force(skb);
> -		__qdisc_update_bstats(q, skb->len);
> +		qdisc_bstats_update(q, skb);
>  		if (sch_direct_xmit(skb, q, dev, txq, root_lock)) {
>  			if (unlikely(contended)) {
>  				spin_unlock(&q->busylock);

I guess you can't use qdisc_pkt_len() without qdisc_enqueue_root().

Jarek P.
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ