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 A3F4943BBD; Sat, 24 Feb 2024 09:24:55 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9F96442D97; Sat, 24 Feb 2024 09:24:03 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 367E5402D9 for ; Sat, 24 Feb 2024 09:22:13 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id B62CA20B74C9; Sat, 24 Feb 2024 00:22:11 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com B62CA20B74C9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1708762931; bh=lTb/MuC4tCyMyqvfN1bTbytcn6b1tLOZPYxamh2q+Io=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qeUfhP67oumcHUs6+wGQoqRMRmugiD8LXIDmExXDMxtVJDIvOZshP12joPzwWcJbT zpVhCSSVs+ob7KMaoIwIzELA1BUgWSWBWNfyZNBV7IBaAWlAz+nA7L4HOqmF/WVufn DzJJaXYgYO4EZa7zel8bEF2rqa64hU9hWbZAwop8= 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 v5 09/22] net/cnxk: use mbuf descriptor accessors Date: Sat, 24 Feb 2024 00:21:54 -0800 Message-Id: <1708762927-14126-10-git-send-email-roretzla@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1708762927-14126-1-git-send-email-roretzla@linux.microsoft.com> References: <1706657173-26166-1-git-send-email-roretzla@linux.microsoft.com> <1708762927-14126-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 RTE_MARKER typedefs are a GCC extension unsupported by MSVC. Use new rte_mbuf_rearm_data and rte_mbuf_rx_descriptor_fields1 accessors that provide a compatible type pointer without using the marker fields. Signed-off-by: Tyler Retzlaff --- drivers/net/cnxk/cn10k_rx.h | 36 ++++++++++++++++++------------------ drivers/net/cnxk/cn9k_rx.h | 20 ++++++++++---------- drivers/net/cnxk/cnxk_ethdev.c | 2 +- 3 files changed, 29 insertions(+), 29 deletions(-) diff --git a/drivers/net/cnxk/cn10k_rx.h b/drivers/net/cnxk/cn10k_rx.h index 7bb4c86..4bfb323 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; + *rte_mbuf_rearm_data(mbuf) = 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; + *rte_mbuf_rearm_data(mbuf) = 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; + *rte_mbuf_rearm_data(mbuf) = 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; + *rte_mbuf_rearm_data(mbuf) = 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; + *rte_mbuf_rearm_data(inner) = 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)rte_mbuf_rearm_data(inner); *(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)rte_mbuf_rearm_data(mbuf); *(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)rte_mbuf_rearm_data(mbuf); *(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)rte_mbuf_rearm_data(mbuf); *(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)rte_mbuf_rearm_data(mbuf); *(uint64_t *)p = val; } @@ -1966,16 +1966,16 @@ 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); + vst1q_u64((uint64_t *)rte_mbuf_rx_descriptor_fields1(mbuf0), f0); + vst1q_u64((uint64_t *)rte_mbuf_rx_descriptor_fields1(mbuf1), f1); + vst1q_u64((uint64_t *)rte_mbuf_rx_descriptor_fields1(mbuf2), f2); + vst1q_u64((uint64_t *)rte_mbuf_rx_descriptor_fields1(mbuf3), 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); + vst1q_u64(rte_mbuf_rearm_data(mbuf0), rearm0); + vst1q_u64(rte_mbuf_rearm_data(mbuf1), rearm1); + vst1q_u64(rte_mbuf_rearm_data(mbuf2), rearm2); + vst1q_u64(rte_mbuf_rearm_data(mbuf3), 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..f1212f8 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; + *rte_mbuf_rearm_data(mbuf) = 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; + *rte_mbuf_rearm_data(mbuf) = val; mbuf->pkt_len = len; mbuf->data_len = len; @@ -799,16 +799,16 @@ 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); + vst1q_u64((uint64_t *)rte_mbuf_rx_descriptor_fields1(mbuf0), f0); + vst1q_u64((uint64_t *)rte_mbuf_rx_descriptor_fields1(mbuf1), f1); + vst1q_u64((uint64_t *)rte_mbuf_rx_descriptor_fields1(mbuf2), f2); + vst1q_u64((uint64_t *)rte_mbuf_rx_descriptor_fields1(mbuf3), 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); + vst1q_u64(rte_mbuf_rearm_data(mbuf0), rearm0); + vst1q_u64(rte_mbuf_rearm_data(mbuf1), rearm1); + vst1q_u64(rte_mbuf_rearm_data(mbuf2), rearm2); + vst1q_u64(rte_mbuf_rearm_data(mbuf3), 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 2372a4e..14f6b7c 100644 --- a/drivers/net/cnxk/cnxk_ethdev.c +++ b/drivers/net/cnxk/cnxk_ethdev.c @@ -437,7 +437,7 @@ /* Prevent compiler reordering: rearm_data covers previous fields */ rte_compiler_barrier(); - tmp = (uint64_t *)&mb_def.rearm_data; + tmp = rte_mbuf_rearm_data(&mb_def); return *tmp; } -- 1.8.3.1