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 9A6D543BBD; Sat, 24 Feb 2024 09:25:07 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0F0A942DC1; Sat, 24 Feb 2024 09:24:06 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 433B9402DC for ; Sat, 24 Feb 2024 09:22:13 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id E29BB20B74CC; Sat, 24 Feb 2024 00:22:11 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com E29BB20B74CC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1708762931; bh=UR8/tFwZvKmNTbmYPlXw5P9bSROZKI7wmTQyU2lBH2M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZhHTqr9W+IA582/BXvf4QOwmVm5BitNdIohnzFqW31HG44xQhAgLFP6iD9b5XSzoa kd3j+foWrTJ0DVFY4xSl80mlzTaCP8wkbI997BxTb3RvNXAGPGfZBC0BJEOJp9KaaU k1ttEzlCP8ANeEw1bfoNhCRp60t1mr/A14h6EoJw= 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 12/22] net/hns3: use mbuf descriptor accessors Date: Sat, 24 Feb 2024 00:21:57 -0800 Message-Id: <1708762927-14126-13-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/hns3/hns3_rxtx_vec.c | 4 +--- drivers/net/hns3/hns3_rxtx_vec_neon.h | 16 ++++++++-------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/drivers/net/hns3/hns3_rxtx_vec.c b/drivers/net/hns3/hns3_rxtx_vec.c index 9708ec6..174be45 100644 --- a/drivers/net/hns3/hns3_rxtx_vec.c +++ b/drivers/net/hns3/hns3_rxtx_vec.c @@ -113,7 +113,6 @@ static void hns3_rxq_vec_setup_rearm_data(struct hns3_rx_queue *rxq) { - uintptr_t p; struct rte_mbuf mb_def = { .buf_addr = 0 }; /* zeroed mbuf */ mb_def.nb_segs = 1; @@ -141,8 +140,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); } void diff --git a/drivers/net/hns3/hns3_rxtx_vec_neon.h b/drivers/net/hns3/hns3_rxtx_vec_neon.h index 0dc6b9f..7b2c3e3 100644 --- a/drivers/net/hns3/hns3_rxtx_vec_neon.h +++ b/drivers/net/hns3/hns3_rxtx_vec_neon.h @@ -236,23 +236,23 @@ pkt_mb4 = vreinterpretq_u8_u16(tmp); /* save packet info to rx_pkts mbuf */ - vst1q_u8((void *)&sw_ring[pos + 0].mbuf->rx_descriptor_fields1, + vst1q_u8(rte_mbuf_rx_descriptor_fields1(sw_ring[pos + 0].mbuf), pkt_mb1); - vst1q_u8((void *)&sw_ring[pos + 1].mbuf->rx_descriptor_fields1, + vst1q_u8(rte_mbuf_rx_descriptor_fields1(sw_ring[pos + 1].mbuf), pkt_mb2); - vst1q_u8((void *)&sw_ring[pos + 2].mbuf->rx_descriptor_fields1, + vst1q_u8(rte_mbuf_rx_descriptor_fields1(sw_ring[pos + 2].mbuf), pkt_mb3); - vst1q_u8((void *)&sw_ring[pos + 3].mbuf->rx_descriptor_fields1, + vst1q_u8(rte_mbuf_rx_descriptor_fields1(sw_ring[pos + 3].mbuf), pkt_mb4); /* store the first 8 bytes of packets mbuf's rearm_data */ - *(uint64_t *)&sw_ring[pos + 0].mbuf->rearm_data = + *rte_mbuf_rearm_data(&sw_ring[pos + 0].mbuf) = rxq->mbuf_initializer; - *(uint64_t *)&sw_ring[pos + 1].mbuf->rearm_data = + *rte_mbuf_rearm_data(&sw_ring[pos + 1].mbuf) = rxq->mbuf_initializer; - *(uint64_t *)&sw_ring[pos + 2].mbuf->rearm_data = + *rte_mbuf_rearm_data(&sw_ring[pos + 2].mbuf) = rxq->mbuf_initializer; - *(uint64_t *)&sw_ring[pos + 3].mbuf->rearm_data = + *rte_mbuf_rearm_data(&sw_ring[pos + 3].mbuf) = rxq->mbuf_initializer; rte_prefetch_non_temporal(rxdp + HNS3_DEFAULT_DESCS_PER_LOOP); -- 1.8.3.1