[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAM_iQpUMJcP3guRvCPBGqfzTbVn+t4uZ8eETGVnwk5Y88ZJi_A@mail.gmail.com>
Date: Wed, 30 Apr 2014 10:08:01 -0700
From: Cong Wang <xiyou.wangcong@...il.com>
To: John Fastabend <john.fastabend@...il.com>
Cc: Jamal Hadi Salim <jhs@...atatu.com>,
Linux Kernel Network Developers <netdev@...r.kernel.org>,
David Miller <davem@...emloft.net>,
Eric Dumazet <eric.dumazet@...il.com>
Subject: Re: [RFC PATCH 14/15] net: sched: make qstats per cpu
On Wed, Apr 30, 2014 at 9:40 AM, John Fastabend
<john.fastabend@...il.com> wrote:
> diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
> index 1a55e19..6d67a27 100644
> --- a/include/net/sch_generic.h
> +++ b/include/net/sch_generic.h
> @@ -92,7 +92,10 @@ struct Qdisc {
> struct gnet_stats_basic_cpu __percpu *cpu_bstats;
> } bstats_qdisc;
> unsigned int __state;
> - struct gnet_stats_queue qstats;
> + union {
> + struct gnet_stats_queue qstats;
> + struct gnet_stats_queue __percpu *cpu_qstats;
> + } qstats_qdisc;
> struct rcu_head rcu_head;
> int padded;
> atomic_t refcnt;
So only ingress qdisc uses ->cpu_qstats, the rest still uses
->qstats. Hmm, doesn't this mean ingress qdisc should init
->cpu_qstats in its ->init()?
[...]
> diff --git a/net/sched/sch_ingress.c b/net/sched/sch_ingress.c
> index 5700c27..2423d7b 100644
> --- a/net/sched/sch_ingress.c
> +++ b/net/sched/sch_ingress.c
> @@ -58,6 +58,7 @@ static struct tcf_proto **ingress_find_tcf(struct Qdisc *sch, unsigned long cl)
> static int ingress_enqueue(struct sk_buff *skb, struct Qdisc *sch)
> {
> struct ingress_qdisc_data *p = qdisc_priv(sch);
> + struct gnet_stats_queue *qstats;
> struct tcf_result res;
> struct tcf_proto *fl = rcu_dereference_bh(p->filter_list);
> int result;
> @@ -68,7 +69,8 @@ static int ingress_enqueue(struct sk_buff *skb, struct Qdisc *sch)
> switch (result) {
> case TC_ACT_SHOT:
> result = TC_ACT_SHOT;
> - sch->qstats.drops++;
> + qstats = this_cpu_ptr(sch->qstats_qdisc.cpu_qstats);
> + qstats->drops++;
> break;
> case TC_ACT_STOLEN:
> case TC_ACT_QUEUED:
I don't see you call alloc_percpu() and free_percpu() in sch_ingress.c.
--
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