diff options
author | Eelco Chaudron <echaudro@redhat.com> | 2018-09-21 07:14:02 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-09-24 12:18:42 -0700 |
commit | 28169abadb08333eb607621faa3a1dd7109e0d45 (patch) | |
tree | 2cdc35f1b72aee9952d534730056314c8486eb90 /net/sched/act_gact.c | |
parent | 5e111210a44301304f9054e995bf33f69b6de76f (diff) | |
download | linux-28169abadb08333eb607621faa3a1dd7109e0d45.tar.bz2 |
net/sched: Add hardware specific counters to TC actions
Add additional counters that will store the bytes/packets processed by
hardware. These will be exported through the netlink interface for
displaying by the iproute2 tc tool
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/act_gact.c')
-rw-r--r-- | net/sched/act_gact.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/net/sched/act_gact.c b/net/sched/act_gact.c index aa44d14b43c7..c89a7fa43d1b 100644 --- a/net/sched/act_gact.c +++ b/net/sched/act_gact.c @@ -157,7 +157,7 @@ static int tcf_gact_act(struct sk_buff *skb, const struct tc_action *a, } static void tcf_gact_stats_update(struct tc_action *a, u64 bytes, u32 packets, - u64 lastuse) + u64 lastuse, bool hw) { struct tcf_gact *gact = to_gact(a); int action = READ_ONCE(gact->tcf_action); @@ -168,6 +168,10 @@ static void tcf_gact_stats_update(struct tc_action *a, u64 bytes, u32 packets, if (action == TC_ACT_SHOT) this_cpu_ptr(gact->common.cpu_qstats)->drops += packets; + if (hw) + _bstats_cpu_update(this_cpu_ptr(gact->common.cpu_bstats_hw), + bytes, packets); + tm->lastuse = max_t(u64, tm->lastuse, lastuse); } |