p4-dpdk-target icon indicating copy to clipboard operation
p4-dpdk-target copied to clipboard

Counters wildcard read doesn't show data

Open jokuniew opened this issue 2 years ago • 0 comments

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.

  1. I create CounterEntry ce = counter_entry["someCounter"]
  2. I edit manually some counter entries, intentionally. Example: ce.index=10 ce.packet_count=101 ce.modify
  3. If I want to see only single counter entry, data is visible ce?
  4. 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
}
...

jokuniew avatar Dec 14 '22 11:12 jokuniew