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>
This commit is contained in:

zatwierdzone przez
David S. Miller

rodzic
5e111210a4
commit
28169abadb
@@ -283,12 +283,15 @@ out:
|
||||
}
|
||||
|
||||
static void tcf_stats_update(struct tc_action *a, u64 bytes, u32 packets,
|
||||
u64 lastuse)
|
||||
u64 lastuse, bool hw)
|
||||
{
|
||||
struct tcf_mirred *m = to_mirred(a);
|
||||
struct tcf_t *tm = &m->tcf_tm;
|
||||
|
||||
_bstats_cpu_update(this_cpu_ptr(a->cpu_bstats), bytes, packets);
|
||||
if (hw)
|
||||
_bstats_cpu_update(this_cpu_ptr(a->cpu_bstats_hw),
|
||||
bytes, packets);
|
||||
tm->lastuse = max_t(u64, tm->lastuse, lastuse);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user