* Check whether CQE is valid using owner bit. * * @param cqe * Pointer to CQE. * @param cqes_n * Size of completion queue. * @param ci * Consumer index. * * @return * The CQE status. */
| 217 | * The CQE status. |
| 218 | */ |
| 219 | static __rte_always_inline enum mlx5_cqe_status |
| 220 | check_cqe(volatile struct mlx5_cqe *cqe, const uint16_t cqes_n, |
| 221 | const uint16_t ci) |
| 222 | { |
| 223 | const uint16_t idx = ci & cqes_n; |
| 224 | const uint8_t op_own = cqe->op_own; |
| 225 | const uint8_t op_owner = MLX5_CQE_OWNER(op_own); |
| 226 | const uint8_t op_code = MLX5_CQE_OPCODE(op_own); |
| 227 | |
| 228 | if (unlikely((op_owner != (!!(idx))) || |
| 229 | (op_code == MLX5_CQE_INVALID))) |
| 230 | return MLX5_CQE_STATUS_HW_OWN; |
| 231 | return check_cqe_error(op_code); |
| 232 | } |
| 233 | |
| 234 | /** |
| 235 | * Check whether CQE is valid using validity iteration count. |
no test coverage detected