Reads timestamp from Clock Queue CQE and stores in the cache. */
| 568 | |
| 569 | /* Reads timestamp from Clock Queue CQE and stores in the cache. */ |
| 570 | static inline void |
| 571 | mlx5_txpp_update_timestamp(struct mlx5_dev_ctx_shared *sh) |
| 572 | { |
| 573 | struct mlx5_txpp_wq *wq = &sh->txpp.clock_queue; |
| 574 | struct mlx5_cqe *cqe = (struct mlx5_cqe *)(uintptr_t)wq->cq_obj.cqes; |
| 575 | union { |
| 576 | rte_int128_t u128; |
| 577 | struct mlx5_cqe_ts cts; |
| 578 | } to; |
| 579 | uint64_t ts; |
| 580 | uint16_t ci; |
| 581 | uint8_t opcode; |
| 582 | |
| 583 | mlx5_atomic_read_cqe((rte_int128_t *)&cqe->timestamp, &to.u128); |
| 584 | opcode = MLX5_CQE_OPCODE(to.cts.op_own); |
| 585 | if (opcode) { |
| 586 | if (opcode != MLX5_CQE_INVALID) { |
| 587 | /* |
| 588 | * Commit the error state if and only if |
| 589 | * we have got at least one actual completion. |
| 590 | */ |
| 591 | DRV_LOG(DEBUG, |
| 592 | "Clock Queue error sync lost (%X).", opcode); |
| 593 | __atomic_fetch_add(&sh->txpp.err_clock_queue, |
| 594 | 1, __ATOMIC_RELAXED); |
| 595 | sh->txpp.sync_lost = 1; |
| 596 | } |
| 597 | return; |
| 598 | } |
| 599 | ci = rte_be_to_cpu_16(to.cts.wqe_counter); |
| 600 | ts = rte_be_to_cpu_64(to.cts.timestamp); |
| 601 | ts = mlx5_txpp_convert_rx_ts(sh, ts); |
| 602 | wq->cq_ci += (ci - wq->sq_ci) & UINT16_MAX; |
| 603 | wq->sq_ci = ci; |
| 604 | mlx5_txpp_cache_timestamp(sh, ts, wq->cq_ci); |
| 605 | } |
| 606 | |
| 607 | /* Waits for the first completion on Clock Queue to init timestamp. */ |
| 608 | static inline void |
no test coverage detected