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 535F243C03; Tue, 27 Feb 2024 06:43:49 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CD9C542EE2; Tue, 27 Feb 2024 06:42:32 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 5295542E56 for ; Tue, 27 Feb 2024 06:41:43 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id 8AB1320B74CF; Mon, 26 Feb 2024 21:41:41 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 8AB1320B74CF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1709012501; bh=zNWJvX6I4yGoJDSJ1k+o8LChAhF9YjRc60nIkCTrlqc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ij5s0kA6ltS79pIy24jCDl9jf4FZyoHBUJdAjUFWQAVzJUHC2NI/G0TCgi1GtzNd5 xPToYaiyk29sCyk3eWmxU00J5V/2aYZ6t0w0V+cTO1LklK/s6LcV241qHJ2UqP1j+f 0qSkfyXdob8YJLrvEBWHzum3YbEsULSLCwUsMNPk= 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 v6 15/23] net/octeon_ep: use mbuf descriptor accessors Date: Mon, 26 Feb 2024 21:41:31 -0800 Message-Id: <1709012499-12813-16-git-send-email-roretzla@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1709012499-12813-1-git-send-email-roretzla@linux.microsoft.com> References: <1706657173-26166-1-git-send-email-roretzla@linux.microsoft.com> <1709012499-12813-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/octeon_ep/cnxk_ep_rx.h | 2 +- drivers/net/octeon_ep/cnxk_ep_rx_avx.c | 2 +- drivers/net/octeon_ep/cnxk_ep_rx_neon.c | 8 ++++---- drivers/net/octeon_ep/cnxk_ep_rx_sse.c | 8 ++++---- drivers/net/octeon_ep/otx_ep_rxtx.c | 5 +---- 5 files changed, 11 insertions(+), 14 deletions(-) diff --git a/drivers/net/octeon_ep/cnxk_ep_rx.h b/drivers/net/octeon_ep/cnxk_ep_rx.h index 61263e6..1d706e2 100644 --- a/drivers/net/octeon_ep/cnxk_ep_rx.h +++ b/drivers/net/octeon_ep/cnxk_ep_rx.h @@ -158,7 +158,7 @@ mbuf->pkt_len = pkt_len; mbuf->data_len = pkt_len; - *(uint64_t *)&mbuf->rearm_data = droq->rearm_data; + *rte_mbuf_rearm_data(mbuf) = droq->rearm_data; rx_pkts[pkts] = mbuf; bytes_rsvd += pkt_len; } diff --git a/drivers/net/octeon_ep/cnxk_ep_rx_avx.c b/drivers/net/octeon_ep/cnxk_ep_rx_avx.c index 47eb1d2..3b8241c 100644 --- a/drivers/net/octeon_ep/cnxk_ep_rx_avx.c +++ b/drivers/net/octeon_ep/cnxk_ep_rx_avx.c @@ -60,7 +60,7 @@ /* Store the 256bit data to the mbuf. */ for (i = 0; i < CNXK_EP_OQ_DESC_PER_LOOP_AVX; i++) - _mm256_storeu_si256((__m256i *)&m[i]->rearm_data, data[i]); + _mm256_storeu_si256((__m256i *)rte_mbuf_rearm_data(m[i]), data[i]); for (i = 0; i < CNXK_EP_OQ_DESC_PER_LOOP_AVX; i++) rx_pkts[pkts++] = m[i]; diff --git a/drivers/net/octeon_ep/cnxk_ep_rx_neon.c b/drivers/net/octeon_ep/cnxk_ep_rx_neon.c index 4c46a7e..8797252 100644 --- a/drivers/net/octeon_ep/cnxk_ep_rx_neon.c +++ b/drivers/net/octeon_ep/cnxk_ep_rx_neon.c @@ -72,10 +72,10 @@ *(uint64_t *)&m3->pkt_len = vgetq_lane_u64(s23, 1); /* Reset rearm data. */ - *(uint64_t *)&m0->rearm_data = droq->rearm_data; - *(uint64_t *)&m1->rearm_data = droq->rearm_data; - *(uint64_t *)&m2->rearm_data = droq->rearm_data; - *(uint64_t *)&m3->rearm_data = droq->rearm_data; + *rte_mbuf_rearm_data(m0) = droq->rearm_data; + *rte_mbuf_rearm_data(m1) = droq->rearm_data; + *rte_mbuf_rearm_data(m2) = droq->rearm_data; + *rte_mbuf_rearm_data(m3) = droq->rearm_data; rx_pkts[pkts++] = m0; rx_pkts[pkts++] = m1; diff --git a/drivers/net/octeon_ep/cnxk_ep_rx_sse.c b/drivers/net/octeon_ep/cnxk_ep_rx_sse.c index 308c8b2..1466217 100644 --- a/drivers/net/octeon_ep/cnxk_ep_rx_sse.c +++ b/drivers/net/octeon_ep/cnxk_ep_rx_sse.c @@ -64,10 +64,10 @@ *(uint64_t *)&m3->pkt_len = ((rte_xmm_t)s23).u64[1]; /* Reset rearm data. */ - *(uint64_t *)&m0->rearm_data = droq->rearm_data; - *(uint64_t *)&m1->rearm_data = droq->rearm_data; - *(uint64_t *)&m2->rearm_data = droq->rearm_data; - *(uint64_t *)&m3->rearm_data = droq->rearm_data; + *rte_mbuf_rearm_data(m0) = droq->rearm_data; + *rte_mbuf_rearm_data(m1) = droq->rearm_data; + *rte_mbuf_rearm_data(m2) = droq->rearm_data; + *rte_mbuf_rearm_data(m3) = droq->rearm_data; rx_pkts[pkts++] = m0; rx_pkts[pkts++] = m1; diff --git a/drivers/net/octeon_ep/otx_ep_rxtx.c b/drivers/net/octeon_ep/otx_ep_rxtx.c index aea148e..4470599 100644 --- a/drivers/net/octeon_ep/otx_ep_rxtx.c +++ b/drivers/net/octeon_ep/otx_ep_rxtx.c @@ -289,7 +289,6 @@ { uint16_t port_id = otx_ep->port_id; struct rte_mbuf mb_def; - uint64_t *tmp; RTE_BUILD_BUG_ON(offsetof(struct rte_mbuf, data_off) % 8 != 0); RTE_BUILD_BUG_ON(offsetof(struct rte_mbuf, refcnt) - offsetof(struct rte_mbuf, data_off) != @@ -305,9 +304,7 @@ /* Prevent compiler reordering: rearm_data covers previous fields */ rte_compiler_barrier(); - tmp = (uint64_t *)&mb_def.rearm_data; - - return *tmp; + return *rte_mbuf_rearm_data(&mb_def); } /* OQ initialization */ -- 1.8.3.1