p4-dpdk-target
p4-dpdk-target copied to clipboard
Counters wildcard read doesn't show data
Problem Statement
While using P4Runtime on p4-DPDK-target ovs I want to gather all counter values in single query. This functionality is available in behavioral model and described in P4Runtime spec/proto, which should be target agnostic.
- I create CounterEntry
ce = counter_entry["someCounter"]
- I edit manually some counter entries, intentionally. Example:
ce.index=10
ce.packet_count=101
ce.modify
- If I want to see only single counter entry, data is visible
ce?
- But, If i want to see all entries in single query, data is not visible. Commands used:
ce.index=None
list(ce.read())
Steps to reproduce & Current output
P4 program with some counter (let's say 1024 in size, PACKETS type)
ce = counter_entry["someCounter"]
ce.index=10
ce.packet_count=101
ce.modify
ce.index=11
ce.packet_count=2000
ce.modify
ce.index=None
list(ce.read())
output:
...
counter_id: 317030940 ("someCounter")
index {
index: 10
}
data {
}
,
counter_id: 317030940 ("someCounter")
index {
index: 11
}
data {
}
...
Expected output
...
counter_id: 317030940 ("someCounter")
index {
index: 10
}
data {
packet_count: 101
}
,
counter_id: 317030940 ("someCounter")
index {
index: 11
}
data {
packet_count: 2000
}
...