aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched/act_gact.c
diff options
context:
space:
mode:
authorEelco Chaudron <echaudro@redhat.com>2018-09-21 07:14:02 -0400
committerDavid S. Miller <davem@davemloft.net>2018-09-24 12:18:42 -0700
commit28169abadb08333eb607621faa3a1dd7109e0d45 (patch)
tree2cdc35f1b72aee9952d534730056314c8486eb90 /net/sched/act_gact.c
parentnet/core: Add new basic hardware counter (diff)
downloadlinux-dev-28169abadb08333eb607621faa3a1dd7109e0d45.tar.xz
linux-dev-28169abadb08333eb607621faa3a1dd7109e0d45.zip
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 '')
-rw-r--r--net/sched/act_gact.c6
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);
}