[dpdk-dev] [PATCH 1/3] net/mlx5: fix compilation issue with missing DevX event

Viacheslav Ovsiienko viacheslavo at mellanox.com
Fri Jul 17 16:28:22 CEST 2020


If there is no support for DevX event the mlx5_txpp_gather_timestamp()
is reported as "not used" causing the compilation warning/error.
This patch moves the routine to the conditional block.

Fixes: 244788055199 ("net/mlx5: introduce clock queue service routine")

Signed-off-by: Viacheslav Ovsiienko <viacheslavo at mellanox.com>
---
 drivers/net/mlx5/mlx5_txpp.c | 30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_txpp.c b/drivers/net/mlx5/mlx5_txpp.c
index 15c9a8e..42776b8 100644
--- a/drivers/net/mlx5/mlx5_txpp.c
+++ b/drivers/net/mlx5/mlx5_txpp.c
@@ -719,21 +719,6 @@
 	mlx5_txpp_cache_timestamp(sh, ts, wq->cq_ci);
 }
 
-/* Gather statistics for timestamp from Clock Queue CQE. */
-static inline void
-mlx5_txpp_gather_timestamp(struct mlx5_dev_ctx_shared *sh)
-{
-	/* Check whether we have a valid timestamp. */
-	if (!sh->txpp.clock_queue.sq_ci && !sh->txpp.ts_n)
-		return;
-	MLX5_ASSERT(sh->txpp.ts_p < MLX5_TXPP_REARM_SQ_SIZE);
-	sh->txpp.tsa[sh->txpp.ts_p] = sh->txpp.ts;
-	if (++sh->txpp.ts_p >= MLX5_TXPP_REARM_SQ_SIZE)
-		sh->txpp.ts_p = 0;
-	if (sh->txpp.ts_n < MLX5_TXPP_REARM_SQ_SIZE)
-		++sh->txpp.ts_n;
-}
-
 /* Waits for the first completion on Clock Queue to init timestamp. */
 static inline void
 mlx5_txpp_init_timestamp(struct mlx5_dev_ctx_shared *sh)
@@ -759,6 +744,21 @@
 }
 
 #ifdef HAVE_IBV_DEVX_EVENT
+/* Gather statistics for timestamp from Clock Queue CQE. */
+static inline void
+mlx5_txpp_gather_timestamp(struct mlx5_dev_ctx_shared *sh)
+{
+	/* Check whether we have a valid timestamp. */
+	if (!sh->txpp.clock_queue.sq_ci && !sh->txpp.ts_n)
+		return;
+	MLX5_ASSERT(sh->txpp.ts_p < MLX5_TXPP_REARM_SQ_SIZE);
+	sh->txpp.tsa[sh->txpp.ts_p] = sh->txpp.ts;
+	if (++sh->txpp.ts_p >= MLX5_TXPP_REARM_SQ_SIZE)
+		sh->txpp.ts_p = 0;
+	if (sh->txpp.ts_n < MLX5_TXPP_REARM_SQ_SIZE)
+		++sh->txpp.ts_n;
+}
+
 /* Handles Rearm Queue completions in periodic service. */
 static __rte_always_inline void
 mlx5_txpp_handle_rearm_queue(struct mlx5_dev_ctx_shared *sh)
-- 
1.8.3.1



More information about the dev mailing list