Skip to content

Commit eb60a8d

Browse files
edumazetdavem330
authored andcommitted
net: minor optimization in qdisc_qstats_cpu_drop()
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>
1 parent 72145a6 commit eb60a8d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎include/net/sch_generic.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,7 @@ static inline void qdisc_qstats_drop(struct Qdisc *sch)
592592

593593
static inline void qdisc_qstats_cpu_drop(struct Qdisc *sch)
594594
{
595-
qstats_drop_inc(this_cpu_ptr(sch->cpu_qstats));
595+
this_cpu_inc(sch->cpu_qstats->drops);
596596
}
597597

598598
static inline void qdisc_qstats_overlimit(struct Qdisc *sch)

0 commit comments

Comments
 (0)