summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/broadcom/bnxt/bnxt.h
diff options
context:
space:
mode:
authorSathya Perla <sathya.perla@broadcom.com>2017-10-26 11:51:31 -0400
committerDavid S. Miller <davem@davemloft.net>2017-10-28 00:02:45 +0900
commit5a84acbebb22f93dfc9ce1e5f0427c45c94acb33 (patch)
treecefba34b1f898f8c5e224ad87044b16160c5bad5 /drivers/net/ethernet/broadcom/bnxt/bnxt.h
parentf484f6782e013138946122ae09c100c9e4b547e3 (diff)
downloadlwn-5a84acbebb22f93dfc9ce1e5f0427c45c94acb33.tar.gz
lwn-5a84acbebb22f93dfc9ce1e5f0427c45c94acb33.zip
bnxt_en: query cfa flow stats periodically to compute 'lastused' attribute
This patch implements periodic querying of cfa flow stats in batches to compute the 'lastused' attribute of TC flow stats. Signed-off-by: Sathya Perla <sathya.perla@broadcom.com> Signed-off-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/broadcom/bnxt/bnxt.h')
-rw-r--r--drivers/net/ethernet/broadcom/bnxt/bnxt.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.h b/drivers/net/ethernet/broadcom/bnxt/bnxt.h
index d88d864db7d4..b8343ee4182c 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.h
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.h
@@ -955,6 +955,11 @@ struct bnxt_coal {
u8 budget;
};
+struct bnxt_tc_flow_stats {
+ u64 packets;
+ u64 bytes;
+};
+
struct bnxt_tc_info {
bool enabled;
@@ -980,6 +985,14 @@ struct bnxt_tc_info {
*/
struct mutex lock;
+ /* Fields used for batching stats query */
+ struct rhashtable_iter iter;
+#define BNXT_FLOW_STATS_BATCH_MAX 10
+ struct bnxt_tc_stats_batch {
+ void *flow_node;
+ struct bnxt_tc_flow_stats hw_stats;
+ } stats_batch[BNXT_FLOW_STATS_BATCH_MAX];
+
/* Stat counter mask (width) */
u64 bytes_mask;
u64 packets_mask;
@@ -1282,6 +1295,7 @@ struct bnxt {
#define BNXT_GENEVE_ADD_PORT_SP_EVENT 12
#define BNXT_GENEVE_DEL_PORT_SP_EVENT 13
#define BNXT_LINK_SPEED_CHNG_SP_EVENT 14
+#define BNXT_FLOW_STATS_SP_EVENT 15
struct bnxt_pf_info pf;
#ifdef CONFIG_BNXT_SRIOV