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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5425AEBB.4030509@intel.com>
Date:	Fri, 26 Sep 2014 11:21:47 -0700
From:	John Fastabend <john.r.fastabend@...el.com>
To:	John Fastabend <john.fastabend@...il.com>,
	xiyou.wangcong@...il.com, jhs@...atatu.com, eric.dumazet@...il.com,
	davem@...emloft.net
CC:	netdev@...r.kernel.org
Subject: Re: [net-next PATCH 1/4] net: sched: make bstats per cpu and estimator
 RCU safe

On 09/26/2014 11:13 AM, John Fastabend wrote:
> From: John Fastabend <john.fastabend@...il.com>
> 
> In order to run qdisc's without locking statistics and estimators
> need to be handled correctly.
> 
> To resolve bstats make the statistics per cpu. And because this is
> only needed for qdiscs that are running without locks which is not
> the case for most qdiscs in the near future only create percpu
> stats when qdiscs set the TCQ_F_CPUSTATS flag.
> 
> Next because estimators use the bstats to calculate packets per
> second and bytes per second the estimator code paths are updated
> to use the per cpu statistics.
> 
> Signed-off-by: John Fastabend <john.r.fastabend@...el.com>
> ---


[...]

>  	return 0;
> diff --git a/net/sched/sch_mqprio.c b/net/sched/sch_mqprio.c
> index 37e7d25..2f0ecd7 100644
> --- a/net/sched/sch_mqprio.c
> +++ b/net/sched/sch_mqprio.c
> @@ -234,8 +234,8 @@ static int mqprio_dump(struct Qdisc *sch, struct sk_buff *skb)
>  		qdisc = rtnl_dereference(netdev_get_tx_queue(dev, i)->qdisc);
>  		spin_lock_bh(qdisc_lock(qdisc));
>  		sch->q.qlen		+= qdisc->q.qlen;
> -		sch->bstats.bytes	+= qdisc->bstats.bytes;
> -		sch->bstats.packets	+= qdisc->bstats.packets;
> +		sch->bstats->bytes	+= qdisc->bstats.bytes;
> +		sch->bstats->packets	+= qdisc->bstats.packets;
>  		sch->qstats.qlen	+= qdisc->qstats.qlen;
>  		sch->qstats.backlog	+= qdisc->qstats.backlog;

OK v2 coming this patch got messed up and then fixed in the third
patch.

If you look at the bstats definition you'll see this obviously
wont compile. The end result is good but it wont bisect.

.John


--
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