summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/sfc/tc_counters.c
diff options
context:
space:
mode:
authorEdward Cree <ecree.xilinx@gmail.com>2022-11-14 14:16:01 +0100
committerDavid S. Miller <davem@davemloft.net>2022-11-16 10:07:03 +0100
commit50f8f2f7fbf2f237a7938890f46c3edce0f51501 (patch)
tree722ca9acdc66249f40a99c2bccd152a2a7714b99 /drivers/net/ethernet/sfc/tc_counters.c
parentsfc: validate MAE action order (diff)
downloadlinux-50f8f2f7fbf2f237a7938890f46c3edce0f51501.tar.xz
linux-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.c')
-rw-r--r--drivers/net/ethernet/sfc/tc_counters.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/net/ethernet/sfc/tc_counters.c b/drivers/net/ethernet/sfc/tc_counters.c
index 76a2e8ac517a..2bba5d3a2fdb 100644
--- a/drivers/net/ethernet/sfc/tc_counters.c
+++ b/drivers/net/ethernet/sfc/tc_counters.c
@@ -198,6 +198,16 @@ struct efx_tc_counter_index *efx_tc_flower_get_counter_index(
return ctr;
}
+struct efx_tc_counter_index *efx_tc_flower_find_counter_index(
+ struct efx_nic *efx, unsigned long cookie)
+{
+ struct efx_tc_counter_index key = {};
+
+ key.cookie = cookie;
+ return rhashtable_lookup_fast(&efx->tc->counter_id_ht, &key,
+ efx_tc_counter_id_ht_params);
+}
+
/* TC Channel. Counter updates are delivered on this channel's RXQ. */
static void efx_tc_handle_no_channel(struct efx_nic *efx)