X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=lib%2Fbpf%2Fbpf_pkt.c;h=af422afc072abeb612766d2c7a322c38c0c27601;hb=6e858b4d9244cf53505589673755ab18ac2a4a83;hp=6e8248f0d6e4dea9e2f4b6c43d2ad6c8de5bc0ba;hpb=99a2dd955fba6e4cc23b77d590a033650ced9c45;p=dpdk.git diff --git a/lib/bpf/bpf_pkt.c b/lib/bpf/bpf_pkt.c index 6e8248f0d6..af422afc07 100644 --- a/lib/bpf/bpf_pkt.c +++ b/lib/bpf/bpf_pkt.c @@ -113,7 +113,7 @@ bpf_eth_cbi_unuse(struct bpf_eth_cbi *cbi) static void bpf_eth_cbi_wait(const struct bpf_eth_cbi *cbi) { - uint32_t nuse, puse; + uint32_t puse; /* make sure all previous loads and stores are completed */ rte_smp_mb(); @@ -122,11 +122,8 @@ bpf_eth_cbi_wait(const struct bpf_eth_cbi *cbi) /* in use, busy wait till current RX/TX iteration is finished */ if ((puse & BPF_ETH_CBI_INUSE) != 0) { - do { - rte_pause(); - rte_compiler_barrier(); - nuse = cbi->use; - } while (nuse == puse); + RTE_WAIT_UNTIL_MASKED((uint32_t *)(uintptr_t)&cbi->use, + UINT32_MAX, !=, puse, __ATOMIC_RELAXED); } } @@ -169,7 +166,7 @@ bpf_eth_cbh_add(struct bpf_eth_cbh *cbh, uint16_t port, uint16_t queue) } /* - * BPF packet processing routinies. + * BPF packet processing routines. */ static inline uint32_t