From patchwork Fri Jun 9 09:02:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhichao Zeng X-Patchwork-Id: 128457 X-Patchwork-Delegate: qi.z.zhang@intel.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 76C3042C6C; Fri, 9 Jun 2023 10:56:18 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 569F240EDB; Fri, 9 Jun 2023 10:56:18 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id 539F240A84 for ; Fri, 9 Jun 2023 10:56:16 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1686300976; x=1717836976; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=GaAqeXZOomIlB40EFfLxV8TbkUXAgUQnTyNyBAypxB8=; b=M1126NESyYPlsfbEevkDFWWt5b4TiNCQ+vudXzbQ2hvSHjOmS3rzcr62 5G9PuPKa5Loc14h/AQRLlnD8Yi/ZYFL4da8+Acj6PcIYwozX3zixH9gjc A/OPZgCu7wGRs1U7yH6Tpu0h/FEAvALfXQXPe6iG7qvyKUDoIXjANCJOa Pq6+hGRrsj/IGb/wXJA/qDPx7nGmxUriaRKhWKYRvWnbPv9shmmZCi7kP FjOKGmPtkCVfeszpODrY1u+QLN+rvAcebD5byh87YDngrlNVirnOu9myY 6nFxpKQcnyQCUd/1ww0E3xiodErl+LbuqOCm6oLV9ZRP/L763xs654NXw Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10735"; a="337912684" X-IronPort-AV: E=Sophos;i="6.00,228,1681196400"; d="scan'208";a="337912684" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Jun 2023 01:56:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10735"; a="780232332" X-IronPort-AV: E=Sophos;i="6.00,228,1681196400"; d="scan'208";a="780232332" Received: from unknown (HELO zhichao-dpdk..) ([10.239.252.103]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Jun 2023 01:56:12 -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 v2] net/iavf: fix compilation warnings Date: Fri, 9 Jun 2023 17:02:35 +0800 Message-Id: <20230609090236.70859-1-zhichaox.zeng@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230609054156.605581-1-zhichaox.zeng@intel.com> References: <20230609054156.605581-1-zhichaox.zeng@intel.com> MIME-Version: 1.0 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 Use fallthrough comments to ignore compilation warnings instead of diagnostic pragmas, which are not recognized by old GCC(below GCC7). 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 Tested-by: Daxue Gao --- drivers/net/iavf/iavf_rxtx_vec_avx2.c | 11 ++++++++--- drivers/net/iavf/iavf_rxtx_vec_avx512.c | 11 ++++++++--- drivers/net/iavf/iavf_rxtx_vec_sse.c | 7 ++++--- 3 files changed, 20 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..184fa30e0e 100644 --- a/drivers/net/iavf/iavf_rxtx_vec_avx2.c +++ b/drivers/net/iavf/iavf_rxtx_vec_avx2.c @@ -1397,36 +1397,42 @@ _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 (rxq->offloads & RTE_ETH_RX_OFFLOAD_TIMESTAMP) { inflection_point = (inflection_point <= burst) ? inflection_point : 0; switch (inflection_point) { case 1: *RTE_MBUF_DYNFIELD(rx_pkts[i + 0], iavf_timestamp_dynfield_offset + 4, uint32_t *) += 1; + /* fallthrough */ case 2: *RTE_MBUF_DYNFIELD(rx_pkts[i + 1], iavf_timestamp_dynfield_offset + 4, uint32_t *) += 1; + /* fallthrough */ case 3: *RTE_MBUF_DYNFIELD(rx_pkts[i + 2], iavf_timestamp_dynfield_offset + 4, uint32_t *) += 1; + /* fallthrough */ case 4: *RTE_MBUF_DYNFIELD(rx_pkts[i + 3], iavf_timestamp_dynfield_offset + 4, uint32_t *) += 1; + /* fallthrough */ case 5: *RTE_MBUF_DYNFIELD(rx_pkts[i + 4], iavf_timestamp_dynfield_offset + 4, uint32_t *) += 1; + /* fallthrough */ case 6: *RTE_MBUF_DYNFIELD(rx_pkts[i + 5], iavf_timestamp_dynfield_offset + 4, uint32_t *) += 1; + /* fallthrough */ case 7: *RTE_MBUF_DYNFIELD(rx_pkts[i + 6], iavf_timestamp_dynfield_offset + 4, uint32_t *) += 1; + /* fallthrough */ case 8: *RTE_MBUF_DYNFIELD(rx_pkts[i + 7], iavf_timestamp_dynfield_offset + 4, uint32_t *) += 1; rxq->phc_time += (uint64_t)1 << 32; + /* fallthrough */ case 0: break; default: @@ -1436,7 +1442,6 @@ _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 #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..38649b6f0b 100644 --- a/drivers/net/iavf/iavf_rxtx_vec_avx512.c +++ b/drivers/net/iavf/iavf_rxtx_vec_avx512.c @@ -1551,36 +1551,42 @@ _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 (rxq->offloads & RTE_ETH_RX_OFFLOAD_TIMESTAMP) { inflection_point = (inflection_point <= burst) ? inflection_point : 0; switch (inflection_point) { case 1: *RTE_MBUF_DYNFIELD(rx_pkts[i + 0], iavf_timestamp_dynfield_offset + 4, uint32_t *) += 1; + /* fallthrough */ case 2: *RTE_MBUF_DYNFIELD(rx_pkts[i + 1], iavf_timestamp_dynfield_offset + 4, uint32_t *) += 1; + /* fallthrough */ case 3: *RTE_MBUF_DYNFIELD(rx_pkts[i + 2], iavf_timestamp_dynfield_offset + 4, uint32_t *) += 1; + /* fallthrough */ case 4: *RTE_MBUF_DYNFIELD(rx_pkts[i + 3], iavf_timestamp_dynfield_offset + 4, uint32_t *) += 1; + /* fallthrough */ case 5: *RTE_MBUF_DYNFIELD(rx_pkts[i + 4], iavf_timestamp_dynfield_offset + 4, uint32_t *) += 1; + /* fallthrough */ case 6: *RTE_MBUF_DYNFIELD(rx_pkts[i + 5], iavf_timestamp_dynfield_offset + 4, uint32_t *) += 1; + /* fallthrough */ case 7: *RTE_MBUF_DYNFIELD(rx_pkts[i + 6], iavf_timestamp_dynfield_offset + 4, uint32_t *) += 1; + /* fallthrough */ case 8: *RTE_MBUF_DYNFIELD(rx_pkts[i + 7], iavf_timestamp_dynfield_offset + 4, uint32_t *) += 1; rxq->phc_time += (uint64_t)1 << 32; + /* fallthrough */ case 0: break; default: @@ -1590,7 +1596,6 @@ _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 #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..81ea154519 100644 --- a/drivers/net/iavf/iavf_rxtx_vec_sse.c +++ b/drivers/net/iavf/iavf_rxtx_vec_sse.c @@ -1126,24 +1126,26 @@ _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 (rxq->offloads & RTE_ETH_RX_OFFLOAD_TIMESTAMP) { inflection_point = (inflection_point <= var) ? inflection_point : 0; switch (inflection_point) { case 1: *RTE_MBUF_DYNFIELD(rx_pkts[pos + 0], iavf_timestamp_dynfield_offset + 4, uint32_t *) += 1; + /* fallthrough */ case 2: *RTE_MBUF_DYNFIELD(rx_pkts[pos + 1], iavf_timestamp_dynfield_offset + 4, uint32_t *) += 1; + /* fallthrough */ case 3: *RTE_MBUF_DYNFIELD(rx_pkts[pos + 2], iavf_timestamp_dynfield_offset + 4, uint32_t *) += 1; + /* fallthrough */ case 4: *RTE_MBUF_DYNFIELD(rx_pkts[pos + 3], iavf_timestamp_dynfield_offset + 4, uint32_t *) += 1; rxq->phc_time += (uint64_t)1 << 32; + /* fallthrough */ case 0: break; default: @@ -1153,7 +1155,6 @@ _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 #endif if (likely(var != IAVF_VPMD_DESCS_PER_LOOP))