DPDK patches and discussions
 help / color / mirror / Atom feed
From: Zhichao Zeng <zhichaox.zeng@intel.com>
To: dev@dpdk.org
Cc: qi.z.zhang@intel.com, daxuex.gao@intel.com,
	Zhichao Zeng <zhichaox.zeng@intel.com>,
	Bruce Richardson <bruce.richardson@intel.com>,
	Konstantin Ananyev <konstantin.v.ananyev@yandex.ru>,
	Jingjing Wu <jingjing.wu@intel.com>,
	Beilei Xing <beilei.xing@intel.com>,
	Wenjun Wu <wenjun1.wu@intel.com>
Subject: [PATCH v2] net/iavf: fix compilation warnings
Date: Fri,  9 Jun 2023 17:02:35 +0800	[thread overview]
Message-ID: <20230609090236.70859-1-zhichaox.zeng@intel.com> (raw)
In-Reply-To: <20230609054156.605581-1-zhichaox.zeng@intel.com>

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 <zhichaox.zeng@intel.com>
---
 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))
-- 
2.34.1


  parent reply	other threads:[~2023-06-09  8:56 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-09  5:41 [PATCH] net/iavf: fix old GCC " Zhichao Zeng
2023-06-09  6:58 ` David Marchand
2023-06-09  7:19   ` Zeng, ZhichaoX
2023-06-09  9:02 ` Zhichao Zeng [this message]
2023-06-12  8:32   ` [PATCH v2] net/iavf: fix " Gao, DaxueX
2023-06-12  9:01     ` Thomas Monjalon
2023-06-12 12:29       ` Zhang, Qi Z
2023-06-12 14:15         ` Thomas Monjalon
2023-06-12 15:08           ` Zhang, Qi Z
2023-06-09 14:38 ` [PATCH] net/iavf: fix old GCC " Stephen Hemminger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230609090236.70859-1-zhichaox.zeng@intel.com \
    --to=zhichaox.zeng@intel.com \
    --cc=beilei.xing@intel.com \
    --cc=bruce.richardson@intel.com \
    --cc=daxuex.gao@intel.com \
    --cc=dev@dpdk.org \
    --cc=jingjing.wu@intel.com \
    --cc=konstantin.v.ananyev@yandex.ru \
    --cc=qi.z.zhang@intel.com \
    --cc=wenjun1.wu@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).