Skip to content

Commit

Permalink
net_sched: extend packet counter to 64bit
Browse files Browse the repository at this point in the history
After this change, qdisc packet counter is no longer
a 32bit quantity. We still export 32bit values to user.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Nov 6, 2019
1 parent 4d390c2 commit d0083d9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions include/net/gen_stats.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
/* Note: this used to be in include/uapi/linux/gen_stats.h */
struct gnet_stats_basic_packed {
__u64 bytes;
__u32 packets;
} __attribute__ ((packed));
__u64 packets;
};

struct gnet_stats_basic_cpu {
struct gnet_stats_basic_packed bstats;
Expand Down
3 changes: 1 addition & 2 deletions net/core/gen_stats.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,7 @@ __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, packets;

do {
start = u64_stats_fetch_begin_irq(&bcpu->syncp);
Expand Down
2 changes: 1 addition & 1 deletion net/sched/act_simple.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ static int tcf_simp_act(struct sk_buff *skb, const struct tc_action *a,
* Example if this was the 3rd packet and the string was "hello"
* then it would look like "hello_3" (without quotes)
*/
pr_info("simple: %s_%d\n",
pr_info("simple: %s_%llu\n",
(char *)d->tcfd_defdata, d->tcf_bstats.packets);
spin_unlock(&d->tcf_lock);
return d->tcf_action;
Expand Down

0 comments on commit d0083d9

Please sign in to comment.