ptf icon indicating copy to clipboard operation
ptf copied to clipboard

[feature wanted] thread safe method to flush counters in dataplane

Open w1nda opened this issue 11 months ago • 1 comments

We need a thread safe method to flush counters in dataplane, as there may many thread sharing the same dataplane instance:(https://github.com/p4lang/ptf/blob/c554f83685186be4cfa9387eb5d6d700d2bbd7c0/src/ptf/init.py#L20

Counters: https://github.com/p4lang/ptf/blob/c554f83685186be4cfa9387eb5d6d700d2bbd7c0/src/ptf/dataplane.py#L571-L575

w1nda avatar Dec 17 '24 10:12 w1nda

Would something as straightforward as acquiring a lock around all accesses to rx_counters / tx_counters do what you are asking for? If so, are you interested in submitting a PR for review that does this?

jafingerhut avatar Dec 17 '24 14:12 jafingerhut