* Check validity of a completion ring entry. If the entry is valid, include a * C11 __ATOMIC_ACQUIRE fence to ensure that subsequent loads of fields in the * completion are not hoisted by the compiler or by the CPU to come before the * loading of the "valid" field. * * Note: the caller must not access any fields in the specified completion * entry prior to calling this function. * * @param
| 122 | * Size of completion ring. |
| 123 | */ |
| 124 | static __rte_always_inline bool |
| 125 | bnxt_cpr_cmp_valid(const void *cmpl, uint32_t raw_cons, uint32_t ring_size) |
| 126 | { |
| 127 | const struct cmpl_base *c = cmpl; |
| 128 | bool expected, valid; |
| 129 | |
| 130 | expected = !(raw_cons & ring_size); |
| 131 | valid = !!(rte_le_to_cpu_32(c->info3_v) & CMPL_BASE_V); |
| 132 | if (valid == expected) { |
| 133 | rte_atomic_thread_fence(__ATOMIC_ACQUIRE); |
| 134 | return true; |
| 135 | } |
| 136 | return false; |
| 137 | } |
| 138 | #endif |
no test coverage detected