summaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2019-02-02 12:50:47 +0100
committerDavid S. Miller <davem@davemloft.net>2019-02-06 19:38:25 +0100
commit3b1903ef97c080a80ead3a6a2305f55108e08269 (patch)
tree952cb75c60cf68c81413f4114292960c8390220a /include/net
parentcls_api: add translator to flow_action representation (diff)
downloadlinux-3b1903ef97c080a80ead3a6a2305f55108e08269.tar.xz
linux-3b1903ef97c080a80ead3a6a2305f55108e08269.zip
flow_offload: add statistics retrieval infrastructure and use it
This patch provides the flow_stats structure that acts as container for tc_cls_flower_offload, then we can use to restore the statistics on the existing TC actions. Hence, tcf_exts_stats_update() is not used from drivers anymore. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> Acked-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net')
-rw-r--r--include/net/flow_offload.h14
-rw-r--r--include/net/pkt_cls.h1
2 files changed, 15 insertions, 0 deletions
diff --git a/include/net/flow_offload.h b/include/net/flow_offload.h
index dabc819b6cc9..f9ce39992dbd 100644
--- a/include/net/flow_offload.h
+++ b/include/net/flow_offload.h
@@ -179,4 +179,18 @@ static inline bool flow_rule_match_key(const struct flow_rule *rule,
return dissector_uses_key(rule->match.dissector, key);
}
+struct flow_stats {
+ u64 pkts;
+ u64 bytes;
+ u64 lastused;
+};
+
+static inline void flow_stats_update(struct flow_stats *flow_stats,
+ u64 bytes, u64 pkts, u64 lastused)
+{
+ flow_stats->pkts = pkts;
+ flow_stats->bytes = bytes;
+ flow_stats->lastused = lastused;
+}
+
#endif /* _NET_FLOW_OFFLOAD_H */
diff --git a/include/net/pkt_cls.h b/include/net/pkt_cls.h
index c470c100b926..bea1b1c3ea9b 100644
--- a/include/net/pkt_cls.h
+++ b/include/net/pkt_cls.h
@@ -765,6 +765,7 @@ struct tc_cls_flower_offload {
enum tc_fl_command command;
unsigned long cookie;
struct flow_rule *rule;
+ struct flow_stats stats;
struct tcf_exts *exts;
u32 classid;
};