On 19/10/2026 21:50, Konstantin Ananyev wrote:
The even/odd usage counter semantics in struct bpf_eth_cbi was
originally used to detect when in-flight packet callbacks complete.
However, with at most one thread running the callback per port/queue
pair and no risk of the ABA problem, a boolean flag (true for in use,
false for idle) suffices.
Change member use to bool and replace the counter increment in the
datapath with stores of true and false. Simplify bpf_eth_cbi_wait()
to a direct pause loop waiting until the flag is false, removing the
now unnecessary RTE_WAIT_UNTIL_MASKED macro and casts. Update the
documentation and synchronization sequence diagram accordingly.
As I explained in previous mail, it is not about even/odd.
It is about waiting while current 'quiscent' period will end.
By 'simplifying' that to use just boll values (0/1) you introduce
a live-lock in CP: it can be blocked for very long time waiting
while DP thread will keep processing packets.
I do not think this explanation is correct. It was always waiting only
for the next value after the odd one, there are no cases where anything
else happens.