net: minor optimization in qdisc_qstats_cpu_drop()
authorEric Dumazet <edumazet@google.com>
Wed, 24 Aug 2016 17:23:34 +0000 (10:23 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 25 Aug 2016 23:45:29 +0000 (16:45 -0700)
per_cpu_inc() is faster (at least on x86) than per_cpu_ptr(xxx)++;

Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: John Fastabend <john.r.fastabend@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/sch_generic.h

index 0d501779cc68f9426e58da6d039dd64adc937c20..52a2015667b49c8315edbb26513a98d4c677fee5 100644 (file)
@@ -592,7 +592,7 @@ static inline void qdisc_qstats_drop(struct Qdisc *sch)
 
 static inline void qdisc_qstats_cpu_drop(struct Qdisc *sch)
 {
-       qstats_drop_inc(this_cpu_ptr(sch->cpu_qstats));
+       this_cpu_inc(sch->cpu_qstats->drops);
 }
 
 static inline void qdisc_qstats_overlimit(struct Qdisc *sch)