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 F29FC43C03; Tue, 27 Feb 2024 06:44:04 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A9F9642EF0; Tue, 27 Feb 2024 06:42:36 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 5248A42E54 for ; Tue, 27 Feb 2024 06:41:43 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id 98B6120B74D0; Mon, 26 Feb 2024 21:41:41 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 98B6120B74D0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1709012501; bh=8tw0oToDLDUsQ5KZ4tGaFL1Uq9a+Bb1PhVNBK/M4mI0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GHFlfPog7YpekmOhnhc/1fHTtRoslOb+p07D3wU/SdFNYL4mxqa+4B+bp/xOFTPD8 /t+j5AfT6OKzBNz3CQNLLCAtTJ1/e6rCdkcmm7PnM23mKUPhQOiklGbxXECmDrvisA OO8tz2K/Sc7n8HvyMCbQU795KhMbAOR1y3fBn3hc= 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 16/23] net/sfc: use mbuf descriptor accessors Date: Mon, 26 Feb 2024 21:41:32 -0800 Message-Id: <1709012499-12813-17-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/sfc/sfc_ef100_rx.c | 7 ++----- drivers/net/sfc/sfc_ef10_rx.c | 10 +++------- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/drivers/net/sfc/sfc_ef100_rx.c b/drivers/net/sfc/sfc_ef100_rx.c index e283879..51c7da0 100644 --- a/drivers/net/sfc/sfc_ef100_rx.c +++ b/drivers/net/sfc/sfc_ef100_rx.c @@ -553,9 +553,7 @@ struct sfc_ef100_rxq { pkt = sfc_ef100_rx_next_mbuf(rxq); __rte_mbuf_raw_sanity_check(pkt); - RTE_BUILD_BUG_ON(sizeof(pkt->rearm_data[0]) != - sizeof(rxq->rearm_data)); - pkt->rearm_data[0] = rxq->rearm_data; + *rte_mbuf_rearm_data(pkt) = rxq->rearm_data; /* data_off already moved past Rx prefix */ rx_prefix = (const efx_xword_t *)sfc_ef100_rx_pkt_prefix(pkt); @@ -760,8 +758,7 @@ struct sfc_ef100_rxq { /* rearm_data covers structure members filled in above */ rte_compiler_barrier(); - RTE_BUILD_BUG_ON(sizeof(m.rearm_data[0]) != sizeof(uint64_t)); - return m.rearm_data[0]; + return *rte_mbuf_rearm_data(&m); } static sfc_dp_rx_qcreate_t sfc_ef100_rx_qcreate; diff --git a/drivers/net/sfc/sfc_ef10_rx.c b/drivers/net/sfc/sfc_ef10_rx.c index 6044293..2ac0203 100644 --- a/drivers/net/sfc/sfc_ef10_rx.c +++ b/drivers/net/sfc/sfc_ef10_rx.c @@ -322,8 +322,7 @@ struct sfc_ef10_rxq { m = rxd->mbuf; - RTE_BUILD_BUG_ON(sizeof(m->rearm_data[0]) != sizeof(rxq->rearm_data)); - m->rearm_data[0] = rxq->rearm_data; + *rte_mbuf_rearm_data(m) = rxq->rearm_data; /* Classify packet based on Rx event */ /* Mask RSS hash offload flag if RSS is not enabled */ @@ -377,9 +376,7 @@ struct sfc_ef10_rxq { rxq->completed = pending; } - RTE_BUILD_BUG_ON(sizeof(m->rearm_data[0]) != - sizeof(rxq->rearm_data)); - m->rearm_data[0] = rxq->rearm_data; + *rte_mbuf_rearm_data(m) = rxq->rearm_data; /* Event-dependent information is the same */ m->ol_flags = m0->ol_flags; @@ -633,8 +630,7 @@ struct sfc_ef10_rxq { /* rearm_data covers structure members filled in above */ rte_compiler_barrier(); - RTE_BUILD_BUG_ON(sizeof(m.rearm_data[0]) != sizeof(uint64_t)); - return m.rearm_data[0]; + return *rte_mbuf_rearm_data(&m); } static sfc_dp_rx_qcreate_t sfc_ef10_rx_qcreate; -- 1.8.3.1