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 D4B4943C03; Tue, 27 Feb 2024 06:43:17 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 73C9742E84; Tue, 27 Feb 2024 06:42:26 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id C62DC42E42 for ; Tue, 27 Feb 2024 06:41:42 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id 0514820B74C6; Mon, 26 Feb 2024 21:41:40 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 0514820B74C6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1709012501; bh=VUNPZFVgLOLwP7BjpG3i+V4rN2X3ZMOQHEmfdOt2UEI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QYHNzYPsjJbgjwCrF82I20iXzt4Xq+7x1KgOiLk5xmEwGzAWLznSPOGz/sNYEyWWY Dj+RDKEXghLi6Yxv/oKfFs2A2A5RLJCKUabOgpD34gtLx0REUbfv2UdJmh2gGJXMwL arlM3wlYcTERk9BqWT3O363Jm7jZE8WY2SWaEFoo= 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 06/23] net/enic: use mbuf descriptor accessors Date: Mon, 26 Feb 2024 21:41:22 -0800 Message-Id: <1709012499-12813-7-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/enic/enic_main.c | 4 +--- drivers/net/enic/enic_rxtx_vec_avx2.c | 18 +++++++++--------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c index a6aaa76..59e0be4 100644 --- a/drivers/net/enic/enic_main.c +++ b/drivers/net/enic/enic_main.c @@ -577,7 +577,6 @@ int enic_enable(struct enic *enic) int err; struct rte_eth_dev *eth_dev = enic->rte_dev; uint64_t simple_tx_offloads; - uintptr_t p; if (enic->enable_avx2_rx) { struct rte_mbuf mb_def = { .buf_addr = 0 }; @@ -592,8 +591,7 @@ int enic_enable(struct enic *enic) mb_def.port = enic->port_id; rte_mbuf_refcnt_set(&mb_def, 1); rte_compiler_barrier(); - p = (uintptr_t)&mb_def.rearm_data; - enic->mbuf_initializer = *(uint64_t *)p; + enic->mbuf_initializer = *rte_mbuf_rearm_data(&mb_def); } eth_dev->data->dev_link.link_speed = vnic_dev_port_speed(enic->vdev); diff --git a/drivers/net/enic/enic_rxtx_vec_avx2.c b/drivers/net/enic/enic_rxtx_vec_avx2.c index 600efff..f6ab6e1 100644 --- a/drivers/net/enic/enic_rxtx_vec_avx2.c +++ b/drivers/net/enic/enic_rxtx_vec_avx2.c @@ -19,7 +19,7 @@ { bool tnl; - *(uint64_t *)&mb->rearm_data = enic->mbuf_initializer; + *rte_mbuf_rearm_data(mb) = enic->mbuf_initializer; mb->data_len = cqd->bytes_written_flags & CQ_ENET_RQ_DESC_BYTES_WRITTEN_MASK; mb->pkt_len = mb->data_len; @@ -737,14 +737,14 @@ * vlan_tci - 26 (from cqd) * rss - 28 (from cqd) */ - _mm256_storeu_si256((__m256i *)&rxmb[0]->rearm_data, rearm0); - _mm256_storeu_si256((__m256i *)&rxmb[1]->rearm_data, rearm1); - _mm256_storeu_si256((__m256i *)&rxmb[2]->rearm_data, rearm2); - _mm256_storeu_si256((__m256i *)&rxmb[3]->rearm_data, rearm3); - _mm256_storeu_si256((__m256i *)&rxmb[4]->rearm_data, rearm4); - _mm256_storeu_si256((__m256i *)&rxmb[5]->rearm_data, rearm5); - _mm256_storeu_si256((__m256i *)&rxmb[6]->rearm_data, rearm6); - _mm256_storeu_si256((__m256i *)&rxmb[7]->rearm_data, rearm7); + _mm256_storeu_si256((__m256i *)rte_mbuf_rearm_data(rxmb[0]), rearm0); + _mm256_storeu_si256((__m256i *)rte_mbuf_rearm_data(rxmb[1]), rearm1); + _mm256_storeu_si256((__m256i *)rte_mbuf_rearm_data(rxmb[2]), rearm2); + _mm256_storeu_si256((__m256i *)rte_mbuf_rearm_data(rxmb[3]), rearm3); + _mm256_storeu_si256((__m256i *)rte_mbuf_rearm_data(rxmb[4]), rearm4); + _mm256_storeu_si256((__m256i *)rte_mbuf_rearm_data(rxmb[5]), rearm5); + _mm256_storeu_si256((__m256i *)rte_mbuf_rearm_data(rxmb[6]), rearm6); + _mm256_storeu_si256((__m256i *)rte_mbuf_rearm_data(rxmb[7]), rearm7); max_rx -= 8; cqd += 8; -- 1.8.3.1