#include "mlx5_rxtx.h"
#include "mlx5_common_os.h"
+static_assert(sizeof(struct mlx5_cqe_ts) == sizeof(rte_int128_t),
+ "Wrong timestamp CQE part size");
+
static const char * const mlx5_txpp_stat_names[] = {
"tx_pp_missed_interrupt_errors", /* Missed service interrupt. */
"tx_pp_rearm_queue_errors", /* Rearm Queue errors. */
static void
mlx5_txpp_free_pp_index(struct mlx5_dev_ctx_shared *sh)
{
+#ifdef HAVE_MLX5DV_PP_ALLOC
if (sh->txpp.pp) {
mlx5_glue->dv_free_pp(sh->txpp.pp);
sh->txpp.pp = NULL;
sh->txpp.pp_id = 0;
}
+#else
+ RTE_SET_USED(sh);
+ DRV_LOG(ERR, "Freeing pacing index is not supported.");
+#endif
}
/* Allocate Packet Pacing index from kernel via mlx5dv call. */
uint64_t ts;
uint16_t ci;
- static_assert(sizeof(struct mlx5_cqe_ts) == sizeof(rte_int128_t),
- "Wrong timestamp CQE part size");
mlx5_atomic_read_cqe((rte_int128_t *)&cqe->timestamp, &to.u128);
if (to.cts.op_own >> 4) {
DRV_LOG(DEBUG, "Clock Queue error sync lost.");
sh->txpp.ts_p = 0;
sh->txpp.ts_n = 0;
for (wait = 0; wait < MLX5_TXPP_WAIT_INIT_TS; wait++) {
- struct timespec onems;
-
mlx5_txpp_update_timestamp(sh);
if (wq->sq_ci)
return;
/* Wait one millisecond and try again. */
- onems.tv_sec = 0;
- onems.tv_nsec = NS_PER_S / MS_PER_S;
- nanosleep(&onems, 0);
+ rte_delay_us_sleep(US_PER_S / MS_PER_S);
}
DRV_LOG(ERR, "Unable to initialize timestamp.");
sh->txpp.sync_lost = 1;