[v4,12/18] net/hns3: stop using zero sized marker fields

Message ID 1707978080-28859-13-git-send-email-roretzla@linux.microsoft.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series stop using zero sized marker fields |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Tyler Retzlaff Feb. 15, 2024, 6:21 a.m. UTC
  Update to reference newly named anonymous union markers supported by
standard C and stop referencing zero sized compiler extension markers.

Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
 drivers/net/hns3/hns3_rxtx_vec.c      | 22 +++++++++++-----------
 drivers/net/hns3/hns3_rxtx_vec_neon.h | 28 ++++++++++++++--------------
 drivers/net/hns3/hns3_rxtx_vec_sve.c  |  6 +++---
 3 files changed, 28 insertions(+), 28 deletions(-)
  

Comments

Chengwen Feng Feb. 18, 2024, 3 a.m. UTC | #1
Acked-by: Chengwen Feng <fengchengwen@huawei.com>

On 2024/2/15 14:21, Tyler Retzlaff wrote:
> Update to reference newly named anonymous union markers supported by
> standard C and stop referencing zero sized compiler extension markers.
> 
> Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
> ---

...
  

Patch

diff --git a/drivers/net/hns3/hns3_rxtx_vec.c b/drivers/net/hns3/hns3_rxtx_vec.c
index 9708ec6..4888b3d 100644
--- a/drivers/net/hns3/hns3_rxtx_vec.c
+++ b/drivers/net/hns3/hns3_rxtx_vec.c
@@ -121,27 +121,27 @@ 
 	mb_def.port = rxq->port_id;
 	rte_mbuf_refcnt_set(&mb_def, 1);
 
-	/* compile-time verifies the rearm_data first 8bytes */
+	/* compile-time verifies the mbuf_rearm_data first 8bytes */
 	RTE_BUILD_BUG_ON(offsetof(struct rte_mbuf, data_off) <
-			 offsetof(struct rte_mbuf, rearm_data));
+			 offsetof(struct rte_mbuf, mbuf_rearm_data));
 	RTE_BUILD_BUG_ON(offsetof(struct rte_mbuf, refcnt) <
-			 offsetof(struct rte_mbuf, rearm_data));
+			 offsetof(struct rte_mbuf, mbuf_rearm_data));
 	RTE_BUILD_BUG_ON(offsetof(struct rte_mbuf, nb_segs) <
-			 offsetof(struct rte_mbuf, rearm_data));
+			 offsetof(struct rte_mbuf, mbuf_rearm_data));
 	RTE_BUILD_BUG_ON(offsetof(struct rte_mbuf, port) <
-			 offsetof(struct rte_mbuf, rearm_data));
+			 offsetof(struct rte_mbuf, mbuf_rearm_data));
 	RTE_BUILD_BUG_ON(offsetof(struct rte_mbuf, data_off) -
-			 offsetof(struct rte_mbuf, rearm_data) > 6);
+			 offsetof(struct rte_mbuf, mbuf_rearm_data) > 6);
 	RTE_BUILD_BUG_ON(offsetof(struct rte_mbuf, refcnt) -
-			 offsetof(struct rte_mbuf, rearm_data) > 6);
+			 offsetof(struct rte_mbuf, mbuf_rearm_data) > 6);
 	RTE_BUILD_BUG_ON(offsetof(struct rte_mbuf, nb_segs) -
-			 offsetof(struct rte_mbuf, rearm_data) > 6);
+			 offsetof(struct rte_mbuf, mbuf_rearm_data) > 6);
 	RTE_BUILD_BUG_ON(offsetof(struct rte_mbuf, port) -
-			 offsetof(struct rte_mbuf, rearm_data) > 6);
+			 offsetof(struct rte_mbuf, mbuf_rearm_data) > 6);
 
-	/* prevent compiler reordering: rearm_data covers previous fields */
+	/* prevent compiler reordering: mbuf_rearm_data covers previous fields */
 	rte_compiler_barrier();
-	p = (uintptr_t)&mb_def.rearm_data;
+	p = (uintptr_t)&mb_def.mbuf_rearm_data;
 	rxq->mbuf_initializer = *(uint64_t *)p;
 }
 
diff --git a/drivers/net/hns3/hns3_rxtx_vec_neon.h b/drivers/net/hns3/hns3_rxtx_vec_neon.h
index 0dc6b9f..b1717ae 100644
--- a/drivers/net/hns3/hns3_rxtx_vec_neon.h
+++ b/drivers/net/hns3/hns3_rxtx_vec_neon.h
@@ -104,7 +104,7 @@ 
 	for (i = 0; i < bd_vld_num; i++) {
 		pkt = sw_ring[i].mbuf;
 
-		/* init rte_mbuf.rearm_data last 64-bit */
+		/* init rte_mbuf.mbuf_rearm_data last 64-bit */
 		pkt->ol_flags = RTE_MBUF_F_RX_RSS_HASH;
 
 		l234_info = rxdp[i].rx.l234_info;
@@ -139,7 +139,7 @@ 
 	uint32_t pos;
 	int offset;
 
-	/* mask to shuffle from desc to mbuf's rx_descriptor_fields1 */
+	/* mask to shuffle from desc to mbuf's mbuf_rx_descriptor_fields1 */
 	uint8x16_t shuf_desc_fields_msk = {
 		0xff, 0xff, 0xff, 0xff,  /* packet type init zero */
 		20, 21, 0xff, 0xff,      /* rx.pkt_len to rte_mbuf.pkt_len */
@@ -158,11 +158,11 @@ 
 
 	/* compile-time verifies the shuffle mask */
 	RTE_BUILD_BUG_ON(offsetof(struct rte_mbuf, pkt_len) !=
-			 offsetof(struct rte_mbuf, rx_descriptor_fields1) + 4);
+			 offsetof(struct rte_mbuf, mbuf_rx_descriptor_fields1) + 4);
 	RTE_BUILD_BUG_ON(offsetof(struct rte_mbuf, data_len) !=
-			 offsetof(struct rte_mbuf, rx_descriptor_fields1) + 8);
+			 offsetof(struct rte_mbuf, mbuf_rx_descriptor_fields1) + 8);
 	RTE_BUILD_BUG_ON(offsetof(struct rte_mbuf, hash.rss) !=
-			 offsetof(struct rte_mbuf, rx_descriptor_fields1) + 12);
+			 offsetof(struct rte_mbuf, mbuf_rx_descriptor_fields1) + 12);
 
 	for (pos = 0; pos < nb_pkts; pos += HNS3_DEFAULT_DESCS_PER_LOOP,
 				     rxdp += HNS3_DEFAULT_DESCS_PER_LOOP) {
@@ -236,23 +236,23 @@ 
 		pkt_mb4 = vreinterpretq_u8_u16(tmp);
 
 		/* save packet info to rx_pkts mbuf */
-		vst1q_u8((void *)&sw_ring[pos + 0].mbuf->rx_descriptor_fields1,
+		vst1q_u8((void *)&sw_ring[pos + 0].mbuf->mbuf_rx_descriptor_fields1,
 			 pkt_mb1);
-		vst1q_u8((void *)&sw_ring[pos + 1].mbuf->rx_descriptor_fields1,
+		vst1q_u8((void *)&sw_ring[pos + 1].mbuf->mbuf_rx_descriptor_fields1,
 			 pkt_mb2);
-		vst1q_u8((void *)&sw_ring[pos + 2].mbuf->rx_descriptor_fields1,
+		vst1q_u8((void *)&sw_ring[pos + 2].mbuf->mbuf_rx_descriptor_fields1,
 			 pkt_mb3);
-		vst1q_u8((void *)&sw_ring[pos + 3].mbuf->rx_descriptor_fields1,
+		vst1q_u8((void *)&sw_ring[pos + 3].mbuf->mbuf_rx_descriptor_fields1,
 			 pkt_mb4);
 
-		/* store the first 8 bytes of packets mbuf's rearm_data */
-		*(uint64_t *)&sw_ring[pos + 0].mbuf->rearm_data =
+		/* store the first 8 bytes of packets mbuf's mbuf_rearm_data */
+		*(uint64_t *)&sw_ring[pos + 0].mbuf->mbuf_rearm_data =
 			rxq->mbuf_initializer;
-		*(uint64_t *)&sw_ring[pos + 1].mbuf->rearm_data =
+		*(uint64_t *)&sw_ring[pos + 1].mbuf->mbuf_rearm_data =
 			rxq->mbuf_initializer;
-		*(uint64_t *)&sw_ring[pos + 2].mbuf->rearm_data =
+		*(uint64_t *)&sw_ring[pos + 2].mbuf->mbuf_rearm_data =
 			rxq->mbuf_initializer;
-		*(uint64_t *)&sw_ring[pos + 3].mbuf->rearm_data =
+		*(uint64_t *)&sw_ring[pos + 3].mbuf->mbuf_rearm_data =
 			rxq->mbuf_initializer;
 
 		rte_prefetch_non_temporal(rxdp + HNS3_DEFAULT_DESCS_PER_LOOP);
diff --git a/drivers/net/hns3/hns3_rxtx_vec_sve.c b/drivers/net/hns3/hns3_rxtx_vec_sve.c
index 8aa4448..57aeca9 100644
--- a/drivers/net/hns3/hns3_rxtx_vec_sve.c
+++ b/drivers/net/hns3/hns3_rxtx_vec_sve.c
@@ -33,7 +33,7 @@ 
 	int ret, i;
 
 	for (i = 0; i < (int)bd_vld_num; i++) {
-		/* init rte_mbuf.rearm_data last 64-bit */
+		/* init rte_mbuf.mbuf_rearm_data last 64-bit */
 		rx_pkts[i]->ol_flags = RTE_MBUF_F_RX_RSS_HASH;
 		rx_pkts[i]->hash.rss = rxdp[i].rx.rss_hash;
 		rx_pkts[i]->pkt_len = rte_le_to_cpu_16(rxdp[i].rx.pkt_len) -
@@ -123,9 +123,9 @@ 
 		mbuf_init = svdup_n_u64(rxq->mbuf_initializer);
 		/* save mbuf_initializer */
 		svst1_scatter_u64base_offset_u64(PG64_256BIT, mbp1st,
-			offsetof(struct rte_mbuf, rearm_data), mbuf_init);
+			offsetof(struct rte_mbuf, mbuf_rearm_data), mbuf_init);
 		svst1_scatter_u64base_offset_u64(PG64_256BIT, mbp2st,
-			offsetof(struct rte_mbuf, rearm_data), mbuf_init);
+			offsetof(struct rte_mbuf, mbuf_rearm_data), mbuf_init);
 
 		next_rxdp = rxdp + HNS3_SVE_DEFAULT_DESCS_PER_LOOP;
 		rte_prefetch_non_temporal(next_rxdp);