From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 0C115A053B;
	Fri, 17 Jul 2020 16:28:32 +0200 (CEST)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id AC7301BF71;
	Fri, 17 Jul 2020 16:28:30 +0200 (CEST)
Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129])
 by dpdk.org (Postfix) with ESMTP id 4C4CE1BF60
 for <dev@dpdk.org>; Fri, 17 Jul 2020 16:28:29 +0200 (CEST)
Received: from Internal Mail-Server by MTLPINE1 (envelope-from
 viacheslavo@mellanox.com) with SMTP; 17 Jul 2020 17:28:28 +0300
Received: from pegasus12.mtr.labs.mlnx (pegasus12.mtr.labs.mlnx [10.210.17.40])
 by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 06HESS1Z000784;
 Fri, 17 Jul 2020 17:28:28 +0300
Received: from pegasus12.mtr.labs.mlnx (localhost [127.0.0.1])
 by pegasus12.mtr.labs.mlnx (8.14.7/8.14.7) with ESMTP id 06HESS5V000410;
 Fri, 17 Jul 2020 14:28:28 GMT
Received: (from viacheslavo@localhost)
 by pegasus12.mtr.labs.mlnx (8.14.7/8.14.7/Submit) id 06HESRUo000409;
 Fri, 17 Jul 2020 14:28:27 GMT
X-Authentication-Warning: pegasus12.mtr.labs.mlnx: viacheslavo set sender to
 viacheslavo@mellanox.com using -f
From: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
To: dev@dpdk.org
Cc: matan@mellanox.com, rasland@mellanox.com, thomas@monjalon.net
Date: Fri, 17 Jul 2020 14:28:22 +0000
Message-Id: <1594996104-372-1-git-send-email-viacheslavo@mellanox.com>
X-Mailer: git-send-email 1.8.3.1
In-Reply-To: <1591771085-24959-1-git-send-email-viacheslavo@mellanox.com>
References: <1591771085-24959-1-git-send-email-viacheslavo@mellanox.com>
Subject: [dpdk-dev] [PATCH 1/3] net/mlx5: fix compilation issue with missing
	DevX event
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

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@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