From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by smtp.lore.kernel.org (Postfix) with ESMTP id 71BBAC54798 for ; Tue, 27 Feb 2024 09:10:08 +0000 (UTC) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 62B894027D; Tue, 27 Feb 2024 10:10:07 +0100 (CET) Received: from dkmailrelay1.smartsharesystems.com (smartserver.smartsharesystems.com [77.243.40.215]) by mails.dpdk.org (Postfix) with ESMTP id A7D7A40150 for ; Tue, 27 Feb 2024 10:10:05 +0100 (CET) Received: from smartserver.smartsharesystems.com (smartserver.smartsharesys.local [192.168.4.10]) by dkmailrelay1.smartsharesystems.com (Postfix) with ESMTP id 803E9208E6; Tue, 27 Feb 2024 10:10:05 +0100 (CET) Content-class: urn:content-classes:message Subject: RE: [PATCH v6 01/23] mbuf: add accessors for rearm and Rx descriptor fields MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Date: Tue, 27 Feb 2024 10:10:03 +0100 Message-ID: <98CBD80474FA8B44BF855DF32C47DC35E9F26C@smartserver.smartshare.dk> In-Reply-To: <1709012499-12813-2-git-send-email-roretzla@linux.microsoft.com> X-MimeOLE: Produced By Microsoft Exchange V6.5 X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PATCH v6 01/23] mbuf: add accessors for rearm and Rx descriptor fields Thread-Index: AdppP6TF7MY6TBs8S/WATJG9VV7ZsAAHB3OQ References: <1706657173-26166-1-git-send-email-roretzla@linux.microsoft.com> <1709012499-12813-1-git-send-email-roretzla@linux.microsoft.com> <1709012499-12813-2-git-send-email-roretzla@linux.microsoft.com> From: =?iso-8859-1?Q?Morten_Br=F8rup?= To: "Tyler Retzlaff" , 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" 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 > From: Tyler Retzlaff [mailto:roretzla@linux.microsoft.com] > Sent: Tuesday, 27 February 2024 06.41 >=20 > RTE_MARKER typedefs are a GCC extension unsupported by MSVC. Provide > inline functions to access compatible type pointer to rearm_data > and rx_descriptor_fields1 which will allow direct references on the > rte marker fields to be removed. >=20 > Signed-off-by: Tyler Retzlaff > --- > lib/mbuf/rte_mbuf.h | 13 +++++++++++++ > lib/mbuf/rte_mbuf_core.h | 11 ++++++++++- > 2 files changed, 23 insertions(+), 1 deletion(-) >=20 > diff --git a/lib/mbuf/rte_mbuf.h b/lib/mbuf/rte_mbuf.h > index 286b32b..aa7495b 100644 > --- a/lib/mbuf/rte_mbuf.h > +++ b/lib/mbuf/rte_mbuf.h > @@ -132,6 +132,19 @@ > #endif > } >=20 > +static inline > +uint64_t * > +rte_mbuf_rearm_data(struct rte_mbuf *m) > +{ > + return (uint64_t *)&m->data_off; > +} Consider returning (void *) instead of (uint64_t *). Just a suggestion; I don't know which is better. > + > +static inline > +void * > +rte_mbuf_rx_descriptor_fields1(struct rte_mbuf *m) > +{ > + return &m->packet_type; > +} The mbuf_rx_descriptor_fields1 field is disappearing in a later patch; consider taking the opportunity to use a better name here. >=20 > static inline uint16_t rte_pktmbuf_priv_size(struct rte_mempool *mp); >=20 > diff --git a/lib/mbuf/rte_mbuf_core.h b/lib/mbuf/rte_mbuf_core.h > index 5688683..7000c04 100644 > --- a/lib/mbuf/rte_mbuf_core.h > +++ b/lib/mbuf/rte_mbuf_core.h > @@ -486,7 +486,12 @@ struct rte_mbuf { > struct rte_mbuf *next; > #endif >=20 > - /* next 8 bytes are initialised on RX descriptor rearm */ > + /** > + * next 8 bytes are initialised on RX descriptor rearm > + * > + * To obtain a pointer to rearm_data use the rte_mbuf_rearm_data() The "rearm_data" field is disappearing in a later patch; don't refer to it by that name in the comments here. > + * accessor instead of directly referencing through the data_off = field. > + */ > RTE_MARKER64 rearm_data; > uint16_t data_off; >=20 > @@ -522,6 +527,10 @@ struct rte_mbuf { > * mbuf. Example: if vlan stripping is enabled, a received vlan = packet > * would have RTE_PTYPE_L2_ETHER and not RTE_PTYPE_L2_VLAN because = the > * vlan is stripped from the data. > + * > + * To obtain a pointer to rx_descriptor_fields1 use the > + * rte_mbuf_rx_descriptor_fields1() accessor instead of directly The "rx_descriptor_fields1" field is disappearing in a later patch; don't refer to it by that name in the comments here. And if you update the access function's name, remember to update it in = the comment here too. > + * referencing through the the anonymous union fields. > */ > union { > uint32_t packet_type; /**< L2/L3/L4 and tunnel information. */ > -- > 1.8.3.1