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 9641443BBD; Sat, 24 Feb 2024 09:24:30 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 35D1042831; Sat, 24 Feb 2024 09:23:59 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id F0847402C8 for ; Sat, 24 Feb 2024 09:22:12 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id 898B720B74C6; Sat, 24 Feb 2024 00:22:11 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 898B720B74C6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1708762931; bh=ytH/3qzniZSmj6fQ2S5RP8QTNMs7a3q6z/2o0D3CW+s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bZ55/ErYiYemBLyMom6dh9lZJjdUELdRhTLeSCVUtAQLffgdW0v8zBOsyRiqBKAvB oGdn9JwMNXiUy4QDI+1NRZ7NNOVBSwcpT3vDcC5lo5bWeKc1hGg/FkiCoHc4j+k3mT Ri/jtPIirqUV6HRpDUK0kxMmaV9w3aMtMJhmVc0A= 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 06/22] mbuf: add mbuf descriptor accessors Date: Sat, 24 Feb 2024 00:21:51 -0800 Message-Id: <1708762927-14126-7-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 Provide inline functions to access rearm data and rx descriptor fields in rte_mbuf struct. Signed-off-by: Tyler Retzlaff --- lib/mbuf/rte_mbuf.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/lib/mbuf/rte_mbuf.h b/lib/mbuf/rte_mbuf.h index 04cde0f..7993730 100644 --- a/lib/mbuf/rte_mbuf.h +++ b/lib/mbuf/rte_mbuf.h @@ -136,6 +136,26 @@ #endif } +static inline +uint64_t * +rte_mbuf_rearm_data(struct rte_mbuf *m) +{ + RTE_BUILD_BUG_ON(offsetof(struct rte_mbuf, ol_flags) != + offsetof(struct rte_mbuf, data_off) + 8); + RTE_BUILD_BUG_ON(offsetof(struct rte_mbuf, rearm_data) != + RTE_ALIGN(offsetof(struct rte_mbuf, + data_off), + 16)); + + return (uint64_t *)&m->data_off; +} + +static inline +void * +rte_mbuf_rx_descriptor_fields1(struct rte_mbuf *m) +{ + return &m->packet_type; +} static inline uint16_t rte_pktmbuf_priv_size(struct rte_mempool *mp); -- 1.8.3.1