diff options
author | Edward Cree <ecree.xilinx@gmail.com> | 2022-11-14 13:16:01 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2022-11-16 09:07:03 +0000 |
commit | 50f8f2f7fbf2f237a7938890f46c3edce0f51501 (patch) | |
tree | 722ca9acdc66249f40a99c2bccd152a2a7714b99 /drivers/net/ethernet/sfc/tc_counters.h | |
parent | 83a187a4eb3a8d7b747e7cfd48228dbc4dbb5c92 (diff) | |
download | lwn-50f8f2f7fbf2f237a7938890f46c3edce0f51501.tar.gz lwn-50f8f2f7fbf2f237a7938890f46c3edce0f51501.zip |
sfc: implement counters readout to TC stats
On FLOW_CLS_STATS, look up the MAE counter by TC cookie, and report the
change in packet and byte count since the last time FLOW_CLS_STATS read
them.
Signed-off-by: Edward Cree <ecree.xilinx@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/sfc/tc_counters.h')
-rw-r--r-- | drivers/net/ethernet/sfc/tc_counters.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/ethernet/sfc/tc_counters.h b/drivers/net/ethernet/sfc/tc_counters.h index a5a6d8cb1365..8fc7c4bbb29c 100644 --- a/drivers/net/ethernet/sfc/tc_counters.h +++ b/drivers/net/ethernet/sfc/tc_counters.h @@ -29,6 +29,7 @@ struct efx_tc_counter { spinlock_t lock; /* Serialises updates to counter values */ u32 gen; /* Generation count at which this counter is current */ u64 packets, bytes; + u64 old_packets, old_bytes; /* Values last time passed to userspace */ /* jiffies of the last time we saw packets increase */ unsigned long touched; }; @@ -50,6 +51,8 @@ struct efx_tc_counter_index *efx_tc_flower_get_counter_index( enum efx_tc_counter_type type); void efx_tc_flower_put_counter_index(struct efx_nic *efx, struct efx_tc_counter_index *ctr); +struct efx_tc_counter_index *efx_tc_flower_find_counter_index( + struct efx_nic *efx, unsigned long cookie); extern const struct efx_channel_type efx_tc_channel_type; |