summaryrefslogtreecommitdiff
path: root/ofproto/ofproto-provider.h
diff options
context:
space:
mode:
authorzhaozhanxu <zhaozhanxu@163.com>2019-12-05 14:26:25 +0800
committerSimon Horman <simon.horman@netronome.com>2019-12-06 10:57:16 +0100
commit164413156cf94d0f4dd1971cf0cc820f8b86055b (patch)
tree3c4147b854e9cbfa15710a349cb37a7924affe35 /ofproto/ofproto-provider.h
parent3843208ee019b8559dc02a01039b8d43cc4dac0b (diff)
downloadopenvswitch-164413156cf94d0f4dd1971cf0cc820f8b86055b.tar.gz
Add offload packets statistics
Add argument '--offload-stats' for command ovs-appctl bridge/dump-flows to display the offloaded packets statistics. The commands display as below: orignal command: ovs-appctl bridge/dump-flows br0 duration=574s, n_packets=1152, n_bytes=110768, priority=0,actions=NORMAL table_id=254, duration=574s, n_packets=0, n_bytes=0, priority=2,recirc_id=0,actions=drop table_id=254, duration=574s, n_packets=0, n_bytes=0, priority=0,reg0=0x1,actions=controller(reason=) table_id=254, duration=574s, n_packets=0, n_bytes=0, priority=0,reg0=0x2,actions=drop table_id=254, duration=574s, n_packets=0, n_bytes=0, priority=0,reg0=0x3,actions=drop new command with argument '--offload-stats' Notice: 'n_offload_packets' are a subset of n_packets and 'n_offload_bytes' are a subset of n_bytes. ovs-appctl bridge/dump-flows --offload-stats br0 duration=582s, n_packets=1152, n_bytes=110768, n_offload_packets=1107, n_offload_bytes=107992, priority=0,actions=NORMAL table_id=254, duration=582s, n_packets=0, n_bytes=0, n_offload_packets=0, n_offload_bytes=0, priority=2,recirc_id=0,actions=drop table_id=254, duration=582s, n_packets=0, n_bytes=0, n_offload_packets=0, n_offload_bytes=0, priority=0,reg0=0x1,actions=controller(reason=) table_id=254, duration=582s, n_packets=0, n_bytes=0, n_offload_packets=0, n_offload_bytes=0, priority=0,reg0=0x2,actions=drop table_id=254, duration=582s, n_packets=0, n_bytes=0, n_offload_packets=0, n_offload_bytes=0, priority=0,reg0=0x3,actions=drop Signed-off-by: zhaozhanxu <zhaozhanxu@163.com> Signed-off-by: Simon Horman <simon.horman@netronome.com>
Diffstat (limited to 'ofproto/ofproto-provider.h')
-rw-r--r--ofproto/ofproto-provider.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/ofproto/ofproto-provider.h b/ofproto/ofproto-provider.h
index a9622876c..afecb24cb 100644
--- a/ofproto/ofproto-provider.h
+++ b/ofproto/ofproto-provider.h
@@ -588,6 +588,13 @@ struct ofgroup {
struct rule_collection rules OVS_GUARDED; /* Referring rules. */
};
+struct pkt_stats {
+ uint64_t n_packets;
+ uint64_t n_bytes;
+ uint64_t n_offload_packets; /* n_offload_packets are a subset n_packets */
+ uint64_t n_offload_bytes; /* n_offload_bytes are a subset of n_bytes */
+};
+
struct ofgroup *ofproto_group_lookup(const struct ofproto *ofproto,
uint32_t group_id, ovs_version_t version,
bool take_ref);
@@ -1348,8 +1355,8 @@ struct ofproto_class {
* matched it in '*packet_count' and the number of bytes in those packets
* in '*byte_count'. UINT64_MAX indicates that the packet count or byte
* count is unknown. */
- void (*rule_get_stats)(struct rule *rule, uint64_t *packet_count,
- uint64_t *byte_count, long long int *used)
+ void (*rule_get_stats)(struct rule *rule, struct pkt_stats *stats,
+ long long int *used)
/* OVS_EXCLUDED(ofproto_mutex) */;
/* Translates actions in 'opo->ofpacts', for 'opo->packet' in flow tables