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 E6FB143B06; Thu, 15 Feb 2024 07:23:21 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 087A0433E2; Thu, 15 Feb 2024 07:21:58 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 8228F43388 for ; Thu, 15 Feb 2024 07:21:38 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id B317420B2005; Wed, 14 Feb 2024 22:21:36 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com B317420B2005 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1707978096; bh=BEcsdSNENhlbzYMyQuG0QedzSAJOJYSkQuY2DlRxCjI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dKdXHD2qrEFLzxmOsZGpUw5svnsTqyC9azdoRfw4wI9sVhK71DjuERl08KN2dwkHI Iwlou+wmmybLzls+xCIOZSX380mbW3CE5l/LHSHVW8KNVKmYDSsa4yzgMxN5Psvlby MZtEw1K9t+OSowrfljutX1IevOfANrpnU75Sf3/I= From: Tyler Retzlaff To: dev@dpdk.org Cc: Ajit Khaparde , Andrew Boyer , Andrew Rybchenko , Bruce Richardson , Chenbo Xia , Chengwen Feng , Dariusz Sosnowski , David Christensen , Hyong Youb Kim , Jerin Jacob , Jie Hai , Jingjing Wu , John Daley , Kevin Laatz , Kiran Kumar K , Konstantin Ananyev , Maciej Czekaj , Matan Azrad , Maxime Coquelin , Nithin Dabilpuram , Ori Kam , Ruifeng Wang , Satha Rao , Somnath Kotur , Suanming Mou , Sunil Kumar Kori , Viacheslav Ovsiienko , Yisen Zhuang , Yuying Zhang , mb@smartsharesystems.com, Tyler Retzlaff Subject: [PATCH v4 12/18] net/hns3: stop using zero sized marker fields Date: Wed, 14 Feb 2024 22:21:14 -0800 Message-Id: <1707978080-28859-13-git-send-email-roretzla@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1707978080-28859-1-git-send-email-roretzla@linux.microsoft.com> References: <1706657173-26166-1-git-send-email-roretzla@linux.microsoft.com> <1707978080-28859-1-git-send-email-roretzla@linux.microsoft.com> 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 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 --- 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(-) 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); -- 1.8.3.1