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 8C52543BBD; Sat, 24 Feb 2024 09:24:43 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 88C5142D7A; Sat, 24 Feb 2024 09:24:01 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 2800B402CC for ; Sat, 24 Feb 2024 09:22:13 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id A76CA20B74C8; Sat, 24 Feb 2024 00:22:11 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com A76CA20B74C8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1708762931; bh=/p13L+GCTe/3iDQwTFqo74AvrlDV/3U7d7cjfEIPE0M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bEKz4asBd+ZHSHfdgH7dPcS4oKlh28DXVqJSpeQdymACNX4D5UC2Kvm41ew+QqU+v 5tY8jc40qrNsdI3pmx0zOOOKsiIq7xIg0XjGgla8O5ccukMGyOUVZmwNzMUvA7bBx6 IilzRn74CUKqcdIMSU0tAtNEhLI/gGxUBpBiygN8= 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 08/22] net/bnxt: use mbuf descriptor accessors Date: Sat, 24 Feb 2024 00:21:53 -0800 Message-Id: <1708762927-14126-9-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/bnxt/bnxt_rxtx_vec_avx2.c | 32 ++++++++++++++++---------------- drivers/net/bnxt/bnxt_rxtx_vec_common.h | 4 +--- drivers/net/bnxt/bnxt_rxtx_vec_neon.c | 16 ++++++++-------- drivers/net/bnxt/bnxt_rxtx_vec_sse.c | 16 ++++++++-------- 4 files changed, 33 insertions(+), 35 deletions(-) diff --git a/drivers/net/bnxt/bnxt_rxtx_vec_avx2.c b/drivers/net/bnxt/bnxt_rxtx_vec_avx2.c index ce6b597..5982d12 100644 --- a/drivers/net/bnxt/bnxt_rxtx_vec_avx2.c +++ b/drivers/net/bnxt/bnxt_rxtx_vec_avx2.c @@ -310,13 +310,13 @@ 0x04); /* Store all mbuf fields for first four packets. */ - _mm256_storeu_si256((void *)&rx_pkts[i + 0]->rearm_data, + _mm256_storeu_si256((void *)rte_mbuf_rearm_data(rx_pkts[i + 0]), rearm0); - _mm256_storeu_si256((void *)&rx_pkts[i + 1]->rearm_data, + _mm256_storeu_si256((void *)rte_mbuf_rearm_data(rx_pkts[i + 1]), rearm1); - _mm256_storeu_si256((void *)&rx_pkts[i + 2]->rearm_data, + _mm256_storeu_si256((void *)rte_mbuf_rearm_data(rx_pkts[i + 2]), rearm2); - _mm256_storeu_si256((void *)&rx_pkts[i + 3]->rearm_data, + _mm256_storeu_si256((void *)rte_mbuf_rearm_data(rx_pkts[i + 3]), rearm3); /* Unpack rearm data, set fixed fields for final four mbufs. */ @@ -336,13 +336,13 @@ 0x04); /* Store all mbuf fields for final four packets. */ - _mm256_storeu_si256((void *)&rx_pkts[i + 4]->rearm_data, + _mm256_storeu_si256((void *)rte_mbuf_rearm_data(rx_pkts[i + 4]), rearm4); - _mm256_storeu_si256((void *)&rx_pkts[i + 5]->rearm_data, + _mm256_storeu_si256((void *)rte_mbuf_rearm_data(rx_pkts[i + 5]), rearm5); - _mm256_storeu_si256((void *)&rx_pkts[i + 6]->rearm_data, + _mm256_storeu_si256((void *)rte_mbuf_rearm_data(rx_pkts[i + 6]), rearm6); - _mm256_storeu_si256((void *)&rx_pkts[i + 7]->rearm_data, + _mm256_storeu_si256((void *)rte_mbuf_rearm_data(rx_pkts[i + 7]), rearm7); nb_rx_pkts += num_valid; @@ -598,13 +598,13 @@ 0x04); /* Store all mbuf fields for first four packets. */ - _mm256_storeu_si256((void *)&rx_pkts[i + 0]->rearm_data, + _mm256_storeu_si256((void *)rte_mbuf_rearm_data(rx_pkts[i + 0]), rearm0); - _mm256_storeu_si256((void *)&rx_pkts[i + 1]->rearm_data, + _mm256_storeu_si256((void *)rte_mbuf_rearm_data(rx_pkts[i + 1]), rearm1); - _mm256_storeu_si256((void *)&rx_pkts[i + 2]->rearm_data, + _mm256_storeu_si256((void *)rte_mbuf_rearm_data(rx_pkts[i + 2]), rearm2); - _mm256_storeu_si256((void *)&rx_pkts[i + 3]->rearm_data, + _mm256_storeu_si256((void *)rte_mbuf_rearm_data(rx_pkts[i + 3]), rearm3); /* Unpack rearm data, set fixed fields for final four mbufs. */ @@ -624,13 +624,13 @@ 0x04); /* Store all mbuf fields for final four packets. */ - _mm256_storeu_si256((void *)&rx_pkts[i + 4]->rearm_data, + _mm256_storeu_si256((void *)rte_mbuf_rearm_data(rx_pkts[i + 4]), rearm4); - _mm256_storeu_si256((void *)&rx_pkts[i + 5]->rearm_data, + _mm256_storeu_si256((void *)rte_mbuf_rearm_data(rx_pkts[i + 5]), rearm5); - _mm256_storeu_si256((void *)&rx_pkts[i + 6]->rearm_data, + _mm256_storeu_si256((void *)rte_mbuf_rearm_data(rx_pkts[i + 6]), rearm6); - _mm256_storeu_si256((void *)&rx_pkts[i + 7]->rearm_data, + _mm256_storeu_si256((void *)rte_mbuf_rearm_data(rx_pkts[i + 7]), rearm7); nb_rx_pkts += num_valid; diff --git a/drivers/net/bnxt/bnxt_rxtx_vec_common.h b/drivers/net/bnxt/bnxt_rxtx_vec_common.h index 2294f0a..fb0b1c1 100644 --- a/drivers/net/bnxt/bnxt_rxtx_vec_common.h +++ b/drivers/net/bnxt/bnxt_rxtx_vec_common.h @@ -36,7 +36,6 @@ static inline int bnxt_rxq_vec_setup_common(struct bnxt_rx_queue *rxq) { - uintptr_t p; struct rte_mbuf mb_def = { .buf_addr = 0 }; /* zeroed mbuf */ mb_def.nb_segs = 1; @@ -46,8 +45,7 @@ /* prevent compiler reordering: rearm_data covers previous fields */ rte_compiler_barrier(); - p = (uintptr_t)&mb_def.rearm_data; - rxq->mbuf_initializer = *(uint64_t *)p; + rxq->mbuf_initializer = *rte_mbuf_rearm_data(&mb_def); rxq->rxrearm_nb = 0; rxq->rxrearm_start = 0; return 0; diff --git a/drivers/net/bnxt/bnxt_rxtx_vec_neon.c b/drivers/net/bnxt/bnxt_rxtx_vec_neon.c index 775400f..9ca9903 100644 --- a/drivers/net/bnxt/bnxt_rxtx_vec_neon.c +++ b/drivers/net/bnxt/bnxt_rxtx_vec_neon.c @@ -135,27 +135,27 @@ /* Update mbuf rearm_data for four packets. */ GET_OL_FLAGS(rss_flags, index, errors, 0, ol_flags); - vst1q_u32((uint32_t *)&mbuf[0]->rearm_data, + vst1q_u32((uint32_t *)rte_mbuf_rearm_data(mbuf[0]), vsetq_lane_u32(ol_flags, vreinterpretq_u32_u64(mb_init), 2)); GET_OL_FLAGS(rss_flags, index, errors, 1, ol_flags); - vst1q_u32((uint32_t *)&mbuf[1]->rearm_data, + vst1q_u32((uint32_t *)rte_mbuf_rearm_data(mbuf[1]), vsetq_lane_u32(ol_flags, vreinterpretq_u32_u64(mb_init), 2)); GET_OL_FLAGS(rss_flags, index, errors, 2, ol_flags); - vst1q_u32((uint32_t *)&mbuf[2]->rearm_data, + vst1q_u32((uint32_t *)rte_mbuf_rearm_data(mbuf[2]), vsetq_lane_u32(ol_flags, vreinterpretq_u32_u64(mb_init), 2)); GET_OL_FLAGS(rss_flags, index, errors, 3, ol_flags); - vst1q_u32((uint32_t *)&mbuf[3]->rearm_data, + vst1q_u32((uint32_t *)rte_mbuf_rearm_data(mbuf[3]), vsetq_lane_u32(ol_flags, vreinterpretq_u32_u64(mb_init), 2)); /* Update mbuf rx_descriptor_fields1 for four packets. */ GET_DESC_FIELDS(mm_rxcmp[0], mm_rxcmp1[0], shuf_msk, ptype_idx, 0, tmp); - vst1q_u32((uint32_t *)&mbuf[0]->rx_descriptor_fields1, tmp); + vst1q_u32((uint32_t *)rte_mbuf_rx_descriptor_fields1(mbuf[0]), tmp); GET_DESC_FIELDS(mm_rxcmp[1], mm_rxcmp1[1], shuf_msk, ptype_idx, 1, tmp); - vst1q_u32((uint32_t *)&mbuf[1]->rx_descriptor_fields1, tmp); + vst1q_u32((uint32_t *)rte_mbuf_rx_descriptor_fields1(mbuf[1]), tmp); GET_DESC_FIELDS(mm_rxcmp[2], mm_rxcmp1[2], shuf_msk, ptype_idx, 2, tmp); - vst1q_u32((uint32_t *)&mbuf[2]->rx_descriptor_fields1, tmp); + vst1q_u32((uint32_t *)rte_mbuf_rx_descriptor_fields1(mbuf[2]), tmp); GET_DESC_FIELDS(mm_rxcmp[3], mm_rxcmp1[3], shuf_msk, ptype_idx, 3, tmp); - vst1q_u32((uint32_t *)&mbuf[3]->rx_descriptor_fields1, tmp); + vst1q_u32((uint32_t *)rte_mbuf_rx_descriptor_fields1(mbuf[3]), tmp); } static uint16_t diff --git a/drivers/net/bnxt/bnxt_rxtx_vec_sse.c b/drivers/net/bnxt/bnxt_rxtx_vec_sse.c index 6c0e332..080e990 100644 --- a/drivers/net/bnxt/bnxt_rxtx_vec_sse.c +++ b/drivers/net/bnxt/bnxt_rxtx_vec_sse.c @@ -114,33 +114,33 @@ /* Update mbuf rearm_data for four packets. */ GET_OL_FLAGS(rss_flags, index, errors, 0, ol_flags); - _mm_store_si128((void *)&mbuf[0]->rearm_data, + _mm_store_si128((void *)rte_mbuf_rearm_data(mbuf[0]), _mm_or_si128(mbuf_init, _mm_set_epi64x(ol_flags, 0))); GET_OL_FLAGS(rss_flags, index, errors, 1, ol_flags); - _mm_store_si128((void *)&mbuf[1]->rearm_data, + _mm_store_si128((void *)rte_mbuf_rearm_data(mbuf[1]), _mm_or_si128(mbuf_init, _mm_set_epi64x(ol_flags, 0))); GET_OL_FLAGS(rss_flags, index, errors, 2, ol_flags); - _mm_store_si128((void *)&mbuf[2]->rearm_data, + _mm_store_si128((void *)rte_mbuf_rearm_data(mbuf[2]), _mm_or_si128(mbuf_init, _mm_set_epi64x(ol_flags, 0))); GET_OL_FLAGS(rss_flags, index, errors, 3, ol_flags); - _mm_store_si128((void *)&mbuf[3]->rearm_data, + _mm_store_si128((void *)rte_mbuf_rearm_data(mbuf[3]), _mm_or_si128(mbuf_init, _mm_set_epi64x(ol_flags, 0))); /* Update mbuf rx_descriptor_fields1 for four packes. */ GET_DESC_FIELDS(mm_rxcmp[0], mm_rxcmp1[0], shuf_msk, ptype_idx, 0, t0); - _mm_store_si128((void *)&mbuf[0]->rx_descriptor_fields1, t0); + _mm_store_si128(rte_mbuf_rx_descriptor_fields1(mbuf[0]), t0); GET_DESC_FIELDS(mm_rxcmp[1], mm_rxcmp1[1], shuf_msk, ptype_idx, 1, t0); - _mm_store_si128((void *)&mbuf[1]->rx_descriptor_fields1, t0); + _mm_store_si128(rte_mbuf_rx_descriptor_fields1(mbuf[1]), t0); GET_DESC_FIELDS(mm_rxcmp[2], mm_rxcmp1[2], shuf_msk, ptype_idx, 2, t0); - _mm_store_si128((void *)&mbuf[2]->rx_descriptor_fields1, t0); + _mm_store_si128(rte_mbuf_rx_descriptor_fields1(mbuf[2]), t0); GET_DESC_FIELDS(mm_rxcmp[3], mm_rxcmp1[3], shuf_msk, ptype_idx, 3, t0); - _mm_store_si128((void *)&mbuf[3]->rx_descriptor_fields1, t0); + _mm_store_si128(rte_mbuf_rx_descriptor_fields1(mbuf[3]), t0); } static uint16_t -- 1.8.3.1