| 61 | } |
| 62 | |
| 63 | static inline uint16_t |
| 64 | virtqueue_fetch_flags_packed(struct vring_packed_desc *dp, |
| 65 | uint8_t weak_barriers) |
| 66 | { |
| 67 | uint16_t flags; |
| 68 | |
| 69 | if (weak_barriers) { |
| 70 | /* x86 prefers to using rte_io_rmb over __atomic_load_n as it reports |
| 71 | * a better perf(~1.5%), which comes from the saved branch by the compiler. |
| 72 | * The if and else branch are identical on the platforms except Arm. |
| 73 | */ |
| 74 | #ifdef RTE_ARCH_ARM |
| 75 | flags = __atomic_load_n(&dp->flags, __ATOMIC_ACQUIRE); |
| 76 | #else |
| 77 | flags = dp->flags; |
| 78 | rte_io_rmb(); |
| 79 | #endif |
| 80 | } else { |
| 81 | flags = dp->flags; |
| 82 | rte_io_rmb(); |
| 83 | } |
| 84 | |
| 85 | return flags; |
| 86 | } |
| 87 | |
| 88 | static inline void |
| 89 | virtqueue_store_flags_packed(struct vring_packed_desc *dp, |