On Wed, Jul 29, 2026 at 10:54:08AM -0700, Stephen Hemminger wrote:
> The counter is written by both the application thread (increment on
> unlink) and the scheduler (clear on ack) as a plain uint8_t. An
> increment is lost if it lands between the scheduler's test and clear,
> making rte_event_port_unlinks_in_progress() report completion before
> the scheduler has seen the unlink. Nothing orders the scheduler's
> later cq map reads against the counter test on a weakly ordered CPU
> either.
>
> Make the counter atomic: release fetch-add on unlink, acquire
> exchange to clear. The exchange cannot lose a concurrent increment,
> and the acquire guarantees the scheduler only acks unlinks whose cq
> map update it can observe, replacing the full barrier in unlink.
>
> Fixes: bd5ac24fea88 ("event/sw: implement unlinks in progress function")
> Cc: [email protected]
>
> Signed-off-by: Stephen Hemminger <[email protected]>
Acked-by: Bruce Richardson <[email protected]>
- Re: [RFC 12/32] stack: always use C11 memory m... Stephen Hemminger
- RE: [RFC 12/32] stack: always use C11 memo... Morten Brørup
- [RFC 13/32] ring: replace SMP read barrier with C11 acq... Stephen Hemminger
- RE: [RFC 13/32] ring: replace SMP read barrier wit... Konstantin Ananyev
- RE: [RFC 13/32] ring: replace SMP read barrier wit... Morten Brørup
- [RFC 14/32] crypto/virtio: update comment reference to ... Stephen Hemminger
- [RFC 17/32] eal/x86: move optimized fence out of SMP ba... Stephen Hemminger
- RE: [RFC 17/32] eal/x86: move optimized fence out ... Konstantin Ananyev
- [RFC 18/32] common/octeontx: remove redundant barrier i... Stephen Hemminger
- [RFC 15/32] event/sw: fix unlinks in progress counter r... Stephen Hemminger
- Re: [RFC 15/32] event/sw: fix unlinks in progress ... Bruce Richardson
- [RFC 16/32] event/sw: replace SMP barriers with C11 ato... Stephen Hemminger
- [RFC 19/32] crypto/caam_jr: use IO barrier before job r... Stephen Hemminger
- Re: [RFC 19/32] crypto/caam_jr: use IO barrier bef... Hemant Agrawal
- [RFC 20/32] crypto/octeontx: use IO barrier before door... Stephen Hemminger
- [RFC 21/32] mempool/octeontx: use IO barrier in pool de... Stephen Hemminger
- [RFC 22/32] event/octeontx: replace deprecated SMP barr... Stephen Hemminger
- [RFC 23/32] event/dpaa2: replace deprecated barrier in ... Stephen Hemminger
- Re: [RFC 23/32] event/dpaa2: replace deprecated ba... Hemant Agrawal
- [RFC 24/32] event/dsw: replace SMP barriers with releas... Stephen Hemminger
- Re: [RFC 24/32] event/dsw: replace SMP barriers wi... Mattias Rönnblom

