提交 02c0fc1b 编写于 作者: W WANG Cong 提交者: David S. Miller

net_sched: fix unused variables in __gnet_stats_copy_basic_cpu()

Probably not a big deal, but we'd better just use the
one we get in retry loop.

Fixes: commit 22e0f8b9 ("net: sched: make bstats per cpu and estimator RCU safe")
Reported-by: NJoe Perches <joe@perches.com>
Cc: John Fastabend <john.fastabend@gmail.com>
Signed-off-by: NCong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 7c5df8fa
......@@ -106,8 +106,8 @@ __gnet_stats_copy_basic_cpu(struct gnet_stats_basic_packed *bstats,
for_each_possible_cpu(i) {
struct gnet_stats_basic_cpu *bcpu = per_cpu_ptr(cpu, i);
unsigned int start;
__u64 bytes;
__u32 packets;
u64 bytes;
u32 packets;
do {
start = u64_stats_fetch_begin_irq(&bcpu->syncp);
......@@ -115,8 +115,8 @@ __gnet_stats_copy_basic_cpu(struct gnet_stats_basic_packed *bstats,
packets = bcpu->bstats.packets;
} while (u64_stats_fetch_retry_irq(&bcpu->syncp, start));
bstats->bytes += bcpu->bstats.bytes;
bstats->packets += bcpu->bstats.packets;
bstats->bytes += bytes;
bstats->packets += packets;
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册