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 3ACA743B06; Thu, 15 Feb 2024 07:23:33 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0B8F8433EB; Thu, 15 Feb 2024 07:22:00 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id A27644338A for ; Thu, 15 Feb 2024 07:21:38 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id EDFC420B2009; Wed, 14 Feb 2024 22:21:36 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com EDFC420B2009 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1707978096; bh=hbijWMTdRK2UDagLz9wzNZevhED+HKw3aHWHIWWvrIU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hzPoEvFwN6s76Aj1/JKyxk4fjT89saTxH5MTUF+AE7tDfTWyKdc6FWwCgVRNijyj3 4kTQL2s4iQ6xS9soswWcafrqD/eZKzK7Ivr0Dds5TGxuIrtMmnjW91V9B+Sbr1YP+/ 8aswTpoIysIIzTKLdzx9xD+mRsbk6VwSGH7x0fRs= 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 16/18] net/cnxk: stop using zero sized marker fields Date: Wed, 14 Feb 2024 22:21:18 -0800 Message-Id: <1707978080-28859-17-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/cnxk/cn10k_rx.h | 50 +++++++++++++++++++++--------------------- drivers/net/cnxk/cn9k_rx.h | 34 ++++++++++++++-------------- drivers/net/cnxk/cnxk_ethdev.c | 4 ++-- 3 files changed, 44 insertions(+), 44 deletions(-) diff --git a/drivers/net/cnxk/cn10k_rx.h b/drivers/net/cnxk/cn10k_rx.h index 7bb4c86..51333b0 100644 --- a/drivers/net/cnxk/cn10k_rx.h +++ b/drivers/net/cnxk/cn10k_rx.h @@ -309,7 +309,7 @@ frag_rx = (union nix_rx_parse_u *)(wqe + 1); frag_size = rlen + frag_rx->lcptr - frag_rx->laptr; - *(uint64_t *)(&mbuf->rearm_data) = mbuf_init; + *(uint64_t *)(&mbuf->mbuf_rearm_data) = mbuf_init; mbuf->data_len = frag_size; mbuf->pkt_len = frag_size; mbuf->ol_flags = ol_flags; @@ -368,7 +368,7 @@ fsz_w1 >>= 16; data_off = b_off + frag_rx->lcptr + l3_hdr_size; - *(uint64_t *)(&mbuf->rearm_data) = mbuf_init | data_off; + *(uint64_t *)(&mbuf->mbuf_rearm_data) = mbuf_init | data_off; mbuf->data_len = frag_size; /* Mark frag as get */ @@ -384,7 +384,7 @@ fsz_w1 >>= 16; data_off = b_off + frag_rx->lcptr + l3_hdr_size; - *(uint64_t *)(&mbuf->rearm_data) = mbuf_init | data_off; + *(uint64_t *)(&mbuf->mbuf_rearm_data) = mbuf_init | data_off; mbuf->data_len = frag_size; /* Mark frag as get */ @@ -401,7 +401,7 @@ fsz_w1 >>= 16; data_off = b_off + frag_rx->lcptr + l3_hdr_size; - *(uint64_t *)(&mbuf->rearm_data) = mbuf_init | data_off; + *(uint64_t *)(&mbuf->mbuf_rearm_data) = mbuf_init | data_off; mbuf->data_len = frag_size; /* Mark frag as get */ @@ -502,7 +502,7 @@ inner->pkt_len = len; inner->data_len = len; - *(uint64_t *)(&inner->rearm_data) = mbuf_init; + *(uint64_t *)(&inner->mbuf_rearm_data) = mbuf_init; inner->ol_flags = ((CPT_COMP_HWGOOD_MASK & (1U << ucc)) ? RTE_MBUF_F_RX_SEC_OFFLOAD : @@ -584,7 +584,7 @@ /* First frag len */ inner->pkt_len = vgetq_lane_u16(*rx_desc_field1, 2); inner->data_len = vgetq_lane_u16(*rx_desc_field1, 4); - p = (uintptr_t)&inner->rearm_data; + p = (uintptr_t)&inner->mbuf_rearm_data; *(uint64_t *)p = mbuf_init; /* Reassembly success */ @@ -774,7 +774,7 @@ mbuf->data_len = sg_len; sg = sg >> 16; - p = (uintptr_t)&mbuf->rearm_data; + p = (uintptr_t)&mbuf->mbuf_rearm_data; *(uint64_t *)p = rearm & ~0xFFFF; nb_segs--; iova_list++; @@ -825,7 +825,7 @@ head->nb_segs = nb_segs; } mbuf = next_frag; - p = (uintptr_t)&mbuf->rearm_data; + p = (uintptr_t)&mbuf->mbuf_rearm_data; *(uint64_t *)p = rearm + ldptr; mbuf->data_len = (sg & 0xFFFF) - ldptr - (flags & NIX_RX_OFFLOAD_TSTAMP_F ? @@ -849,7 +849,7 @@ len = mbuf->pkt_len; - p = (uintptr_t)&mbuf->rearm_data; + p = (uintptr_t)&mbuf->mbuf_rearm_data; *(uint64_t *)p = rearm; mbuf->data_len = (sg & 0xFFFF) - (flags & NIX_RX_OFFLOAD_TSTAMP_F ? @@ -917,7 +917,7 @@ mbuf->ol_flags = ol_flags; mbuf->pkt_len = len; mbuf->data_len = len; - p = (uintptr_t)&mbuf->rearm_data; + p = (uintptr_t)&mbuf->mbuf_rearm_data; *(uint64_t *)p = val; } @@ -1464,7 +1464,7 @@ 0, 1, /* octet 1~0, 16 bits data_len */ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}; - /* Form the rx_descriptor_fields1 with pkt_len and data_len */ + /* Form the mbuf_rx_descriptor_fields1 with pkt_len and data_len */ f0 = vqtbl1q_u8(cq0_w8, shuf_msk); f1 = vqtbl1q_u8(cq1_w8, shuf_msk); f2 = vqtbl1q_u8(cq2_w8, shuf_msk); @@ -1512,7 +1512,7 @@ } if (flags & NIX_RX_OFFLOAD_RSS_F) { - /* Fill rss in the rx_descriptor_fields1 */ + /* Fill rss in the mbuf_rx_descriptor_fields1 */ f0 = vsetq_lane_u32(cq0_w0, f0, 3); f1 = vsetq_lane_u32(cq1_w0, f1, 3); f2 = vsetq_lane_u32(cq2_w0, f2, 3); @@ -1529,7 +1529,7 @@ } if (flags & NIX_RX_OFFLOAD_PTYPE_F) { - /* Fill packet_type in the rx_descriptor_fields1 */ + /* Fill packet_type in the mbuf_rx_descriptor_fields1 */ f0 = vsetq_lane_u32(nix_ptype_get(lookup_mem, cq0_w1), f0, 0); f1 = vsetq_lane_u32(nix_ptype_get(lookup_mem, cq1_w1), @@ -1959,23 +1959,23 @@ } } - /* Form rearm_data with ol_flags */ + /* Form mbuf_rearm_data with ol_flags */ rearm0 = vsetq_lane_u64(ol_flags0, rearm0, 1); rearm1 = vsetq_lane_u64(ol_flags1, rearm1, 1); rearm2 = vsetq_lane_u64(ol_flags2, rearm2, 1); rearm3 = vsetq_lane_u64(ol_flags3, rearm3, 1); - /* Update rx_descriptor_fields1 */ - vst1q_u64((uint64_t *)mbuf0->rx_descriptor_fields1, f0); - vst1q_u64((uint64_t *)mbuf1->rx_descriptor_fields1, f1); - vst1q_u64((uint64_t *)mbuf2->rx_descriptor_fields1, f2); - vst1q_u64((uint64_t *)mbuf3->rx_descriptor_fields1, f3); - - /* Update rearm_data */ - vst1q_u64((uint64_t *)mbuf0->rearm_data, rearm0); - vst1q_u64((uint64_t *)mbuf1->rearm_data, rearm1); - vst1q_u64((uint64_t *)mbuf2->rearm_data, rearm2); - vst1q_u64((uint64_t *)mbuf3->rearm_data, rearm3); + /* Update mbuf_rx_descriptor_fields1 */ + vst1q_u64((uint64_t *)mbuf0->mbuf_rx_descriptor_fields1, f0); + vst1q_u64((uint64_t *)mbuf1->mbuf_rx_descriptor_fields1, f1); + vst1q_u64((uint64_t *)mbuf2->mbuf_rx_descriptor_fields1, f2); + vst1q_u64((uint64_t *)mbuf3->mbuf_rx_descriptor_fields1, f3); + + /* Update mbuf_rearm_data */ + vst1q_u64((uint64_t *)mbuf0->mbuf_rearm_data, rearm0); + vst1q_u64((uint64_t *)mbuf1->mbuf_rearm_data, rearm1); + vst1q_u64((uint64_t *)mbuf2->mbuf_rearm_data, rearm2); + vst1q_u64((uint64_t *)mbuf3->mbuf_rearm_data, rearm3); if (flags & NIX_RX_MULTI_SEG_F) { /* Multi segment is enable build mseg list for diff --git a/drivers/net/cnxk/cn9k_rx.h b/drivers/net/cnxk/cn9k_rx.h index d8bb65c..1256640 100644 --- a/drivers/net/cnxk/cn9k_rx.h +++ b/drivers/net/cnxk/cn9k_rx.h @@ -155,7 +155,7 @@ mbuf->data_len = sg & 0xFFFF; sg = sg >> 16; - *(uint64_t *)(&mbuf->rearm_data) = rearm; + *(uint64_t *)(&mbuf->mbuf_rearm_data) = rearm; nb_segs--; iova_list++; @@ -398,7 +398,7 @@ nix_update_match_id(rx->cn9k.match_id, ol_flags, mbuf); mbuf->ol_flags = ol_flags; - *(uint64_t *)(&mbuf->rearm_data) = val; + *(uint64_t *)(&mbuf->mbuf_rearm_data) = val; mbuf->pkt_len = len; mbuf->data_len = len; @@ -615,7 +615,7 @@ 0, 1, /* octet 1~0, 16 bits data_len */ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}; - /* Form the rx_descriptor_fields1 with pkt_len and data_len */ + /* Form the mbuf_rx_descriptor_fields1 with pkt_len and data_len */ f0 = vqtbl1q_u8(cq0_w8, shuf_msk); f1 = vqtbl1q_u8(cq1_w8, shuf_msk); f2 = vqtbl1q_u8(cq2_w8, shuf_msk); @@ -632,7 +632,7 @@ uint64_t cq3_w1 = ((uint64_t *)(cq0 + CQE_SZ(3)))[1]; if (flags & NIX_RX_OFFLOAD_RSS_F) { - /* Fill rss in the rx_descriptor_fields1 */ + /* Fill rss in the mbuf_rx_descriptor_fields1 */ f0 = vsetq_lane_u32(cq0_w0, f0, 3); f1 = vsetq_lane_u32(cq1_w0, f1, 3); f2 = vsetq_lane_u32(cq2_w0, f2, 3); @@ -649,7 +649,7 @@ } if (flags & NIX_RX_OFFLOAD_PTYPE_F) { - /* Fill packet_type in the rx_descriptor_fields1 */ + /* Fill packet_type in the mbuf_rx_descriptor_fields1 */ f0 = vsetq_lane_u32(nix_ptype_get(lookup_mem, cq0_w1), f0, 0); f1 = vsetq_lane_u32(nix_ptype_get(lookup_mem, cq1_w1), @@ -792,23 +792,23 @@ } } - /* Form rearm_data with ol_flags */ + /* Form mbuf_rearm_data with ol_flags */ rearm0 = vsetq_lane_u64(ol_flags0, rearm0, 1); rearm1 = vsetq_lane_u64(ol_flags1, rearm1, 1); rearm2 = vsetq_lane_u64(ol_flags2, rearm2, 1); rearm3 = vsetq_lane_u64(ol_flags3, rearm3, 1); - /* Update rx_descriptor_fields1 */ - vst1q_u64((uint64_t *)mbuf0->rx_descriptor_fields1, f0); - vst1q_u64((uint64_t *)mbuf1->rx_descriptor_fields1, f1); - vst1q_u64((uint64_t *)mbuf2->rx_descriptor_fields1, f2); - vst1q_u64((uint64_t *)mbuf3->rx_descriptor_fields1, f3); - - /* Update rearm_data */ - vst1q_u64((uint64_t *)mbuf0->rearm_data, rearm0); - vst1q_u64((uint64_t *)mbuf1->rearm_data, rearm1); - vst1q_u64((uint64_t *)mbuf2->rearm_data, rearm2); - vst1q_u64((uint64_t *)mbuf3->rearm_data, rearm3); + /* Update mbuf_rx_descriptor_fields1 */ + vst1q_u64((uint64_t *)mbuf0->mbuf_rx_descriptor_fields1, f0); + vst1q_u64((uint64_t *)mbuf1->mbuf_rx_descriptor_fields1, f1); + vst1q_u64((uint64_t *)mbuf2->mbuf_rx_descriptor_fields1, f2); + vst1q_u64((uint64_t *)mbuf3->mbuf_rx_descriptor_fields1, f3); + + /* Update mbuf_rearm_data */ + vst1q_u64((uint64_t *)mbuf0->mbuf_rearm_data, rearm0); + vst1q_u64((uint64_t *)mbuf1->mbuf_rearm_data, rearm1); + vst1q_u64((uint64_t *)mbuf2->mbuf_rearm_data, rearm2); + vst1q_u64((uint64_t *)mbuf3->mbuf_rearm_data, rearm3); if (flags & NIX_RX_MULTI_SEG_F) { /* Multi segment is enable build mseg list for diff --git a/drivers/net/cnxk/cnxk_ethdev.c b/drivers/net/cnxk/cnxk_ethdev.c index 5e11bbb..4a02e35 100644 --- a/drivers/net/cnxk/cnxk_ethdev.c +++ b/drivers/net/cnxk/cnxk_ethdev.c @@ -435,9 +435,9 @@ mb_def.port = port_id; rte_mbuf_refcnt_set(&mb_def, 1); - /* Prevent compiler reordering: rearm_data covers previous fields */ + /* Prevent compiler reordering: mbuf_rearm_data covers previous fields */ rte_compiler_barrier(); - tmp = (uint64_t *)&mb_def.rearm_data; + tmp = (uint64_t *)&mb_def.mbuf_rearm_data; return *tmp; } -- 1.8.3.1