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 36DA643BA3; Sat, 24 Feb 2024 09:26:13 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0F27F42E1C; Sat, 24 Feb 2024 09:24:20 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 02504402ED for ; Sat, 24 Feb 2024 09:22:14 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id 5962620B74D3; Sat, 24 Feb 2024 00:22:11 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 5962620B74D3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1708762932; bh=zNWJvX6I4yGoJDSJ1k+o8LChAhF9YjRc60nIkCTrlqc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jVTgLvydlHJTLgppUYkCA5VNhMQeT9rP+SkOfzl82N/Kqx8pK4q+lfbq/gOfLs6x4 h7zQJVY7AZ86Lx4GbZVvDvr3j5VZsnsVRwSQ3CRv7HC2O+QQyygO/w+qQCAxJ36k0l 57OwmXekB9a/9XNTMhoS6gaXtLT4TTW9ZCd1MHnk= 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 19/22] net/octeon_ep: use mbuf descriptor accessors Date: Sat, 24 Feb 2024 00:22:04 -0800 Message-Id: <1708762927-14126-20-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/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