From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id B0B7542C68; Fri, 9 Jun 2023 07:35:43 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8A0AA40EDB; Fri, 9 Jun 2023 07:35:43 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id 211A140A84 for ; Fri, 9 Jun 2023 07:35:40 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1686288941; x=1717824941; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=T1oASVNQA/RgvKTDwO6h8OEp4reQSvSir+S9keDJuLU=; b=mAR6ZM0p7wwvAudWKgDRY0AFZ6g6lqdbS7F1VLK8RDKtxw0MBMc6ESku 7IwFjAx38ktFDlES+fVD74TBT0tAvlzLGgfoT4E40SCluC58AThpwIMlF P0fB5wXb7GEeIQS3VZ+HZVG7UKt6DItYG13dXMgz9wokZEcb2XMUMiqNc C084gSRerIm93qJPWPfboOLn0wRD2Rqis3noX3QAxhjX5oL5/eYxBl3c2 Sjsbpv+/LlKz6ds2rpfzOBMpwv/PRpM0R7DWCe03S/BesJVOSV3FmBksd ZPLfSlM7HUvT2tOXzdv3L6jARYkKNdq2p0v3FVCAv3DV1LZH0Sht1qagE Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10735"; a="347168725" X-IronPort-AV: E=Sophos;i="6.00,228,1681196400"; d="scan'208";a="347168725" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jun 2023 22:35:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10735"; a="743355674" X-IronPort-AV: E=Sophos;i="6.00,228,1681196400"; d="scan'208";a="743355674" Received: from unknown (HELO zhichao-dpdk..) ([10.239.252.103]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jun 2023 22:35:35 -0700 From: Zhichao Zeng To: dev@dpdk.org Cc: qi.z.zhang@intel.com, daxuex.gao@intel.com, Zhichao Zeng , Bruce Richardson , Konstantin Ananyev , Jingjing Wu , Beilei Xing , Wenjun Wu Subject: [PATCH] net/iavf: fix old GCC compilation warnings Date: Fri, 9 Jun 2023 13:41:56 +0800 Message-Id: <20230609054156.605581-1-zhichaox.zeng@intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org The code uses the Wimplicit-fallthrough compile option to ignore falls through warnings in switch case, but this option was introduced by GCC 7 and old GCC do not recognize the option. Add judgment to avoid warnings about unrecognized options in old GCC. Fixes: 95a1b0b23140 ("net/iavf: support Rx timestamp offload on SSE") Fixes: 4f58266da4d3 ("net/iavf: support Rx timestamp offload on AVX2") Fixes: d65eadb9e178 ("net/iavf: support Rx timestamp offload on AVX512") Signed-off-by: Zhichao Zeng --- drivers/net/iavf/iavf_rxtx_vec_avx2.c | 10 +++++++--- drivers/net/iavf/iavf_rxtx_vec_avx512.c | 10 +++++++--- drivers/net/iavf/iavf_rxtx_vec_sse.c | 10 +++++++--- 3 files changed, 21 insertions(+), 9 deletions(-) diff --git a/drivers/net/iavf/iavf_rxtx_vec_avx2.c b/drivers/net/iavf/iavf_rxtx_vec_avx2.c index 86290c4bbb..25094d5958 100644 --- a/drivers/net/iavf/iavf_rxtx_vec_avx2.c +++ b/drivers/net/iavf/iavf_rxtx_vec_avx2.c @@ -1397,8 +1397,10 @@ _iavf_recv_raw_pkts_vec_avx2_flex_rxd(struct iavf_rx_queue *rxq, (_mm256_castsi256_si128(status0_7))); received += burst; #ifndef RTE_LIBRTE_IAVF_16BYTE_RX_DESC -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wimplicit-fallthrough" +#if __GNUC__ >= 7 + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wimplicit-fallthrough" +#endif if (rxq->offloads & RTE_ETH_RX_OFFLOAD_TIMESTAMP) { inflection_point = (inflection_point <= burst) ? inflection_point : 0; switch (inflection_point) { @@ -1436,7 +1438,9 @@ _iavf_recv_raw_pkts_vec_avx2_flex_rxd(struct iavf_rx_queue *rxq, rxq->hw_time_update = rte_get_timer_cycles() / (rte_get_timer_hz() / 1000); } -#pragma GCC diagnostic pop +#if __GNUC__ >= 7 + #pragma GCC diagnostic pop +#endif #endif if (burst != IAVF_DESCS_PER_LOOP_AVX) break; diff --git a/drivers/net/iavf/iavf_rxtx_vec_avx512.c b/drivers/net/iavf/iavf_rxtx_vec_avx512.c index f9961e53b8..b74a6443b3 100644 --- a/drivers/net/iavf/iavf_rxtx_vec_avx512.c +++ b/drivers/net/iavf/iavf_rxtx_vec_avx512.c @@ -1551,8 +1551,10 @@ _iavf_recv_raw_pkts_vec_avx512_flex_rxd(struct iavf_rx_queue *rxq, received += burst; #ifndef RTE_LIBRTE_IAVF_16BYTE_RX_DESC #ifdef IAVF_RX_TS_OFFLOAD -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wimplicit-fallthrough" +#if __GNUC__ >= 7 + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wimplicit-fallthrough" +#endif if (rxq->offloads & RTE_ETH_RX_OFFLOAD_TIMESTAMP) { inflection_point = (inflection_point <= burst) ? inflection_point : 0; switch (inflection_point) { @@ -1590,7 +1592,9 @@ _iavf_recv_raw_pkts_vec_avx512_flex_rxd(struct iavf_rx_queue *rxq, rxq->hw_time_update = rte_get_timer_cycles() / (rte_get_timer_hz() / 1000); } -#pragma GCC diagnostic pop +#if __GNUC__ >= 7 + #pragma GCC diagnostic pop +#endif #endif #endif if (burst != IAVF_DESCS_PER_LOOP_AVX) diff --git a/drivers/net/iavf/iavf_rxtx_vec_sse.c b/drivers/net/iavf/iavf_rxtx_vec_sse.c index b754122c51..ff364d4fe5 100644 --- a/drivers/net/iavf/iavf_rxtx_vec_sse.c +++ b/drivers/net/iavf/iavf_rxtx_vec_sse.c @@ -1126,8 +1126,10 @@ _recv_raw_pkts_vec_flex_rxd(struct iavf_rx_queue *rxq, nb_pkts_recd += var; #ifndef RTE_LIBRTE_IAVF_16BYTE_RX_DESC -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wimplicit-fallthrough" +#if __GNUC__ >= 7 + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wimplicit-fallthrough" +#endif if (rxq->offloads & RTE_ETH_RX_OFFLOAD_TIMESTAMP) { inflection_point = (inflection_point <= var) ? inflection_point : 0; switch (inflection_point) { @@ -1153,7 +1155,9 @@ _recv_raw_pkts_vec_flex_rxd(struct iavf_rx_queue *rxq, rxq->hw_time_update = rte_get_timer_cycles() / (rte_get_timer_hz() / 1000); } -#pragma GCC diagnostic pop +#if __GNUC__ >= 7 + #pragma GCC diagnostic pop +#endif #endif if (likely(var != IAVF_VPMD_DESCS_PER_LOOP)) -- 2.34.1