From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 97B9143BC0;
	Sat, 24 Feb 2024 12:01:57 +0100 (CET)
Received: from mails.dpdk.org (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id 3E451402C8;
	Sat, 24 Feb 2024 12:01:57 +0100 (CET)
Received: from fout5-smtp.messagingengine.com (fout5-smtp.messagingengine.com
 [103.168.172.148])
 by mails.dpdk.org (Postfix) with ESMTP id B47CC402A8
 for <dev@dpdk.org>; Sat, 24 Feb 2024 12:01:55 +0100 (CET)
Received: from compute7.internal (compute7.nyi.internal [10.202.2.48])
 by mailfout.nyi.internal (Postfix) with ESMTP id 0934713800D3;
 Sat, 24 Feb 2024 06:01:55 -0500 (EST)
Received: from mailfrontend1 ([10.202.2.162])
 by compute7.internal (MEProxy); Sat, 24 Feb 2024 06:01:55 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h=
 cc:cc:content-transfer-encoding:content-type:content-type:date
 :date:from:from:in-reply-to:in-reply-to:message-id:mime-version
 :references:reply-to:subject:subject:to:to; s=fm1; t=1708772515;
 x=1708858915; bh=HKhS3qAzzT/6ICE5oMDBbzHW8saEk6em6Q8gKU2o/Uk=; b=
 VGSmhvX4ZDdR8v1pCuXa23y33dEYj9CibrxnMI4tZtgPJ18nklE5rIo51hhhjIov
 HmWQRSaiMerTDN84oPH+m3m7OpumkWCmCJCgshP2TjFKWZnEfJnVU5f0LKB8PLQT
 cX3J0cLd57XV+3ZpFQI5Elk+0RoA4DEvSyH1JDEgkbbx8zDBLA0/60J9E4eDcUyC
 W7pAog3kVD6ZworRbjB5bf+zXRL3Jrt9zGl98PO7IbdZ/PE8FEGivTng8yCNwoSB
 bWPkS0fx+2LAyZsM2s6zSUE8CNGUGiVBI+vRYRjN1bdUqoZUQDThaLRXYvFpobpr
 As46V+P+RHJw05GTjUY9uw==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:cc:content-transfer-encoding
 :content-type:content-type:date:date:feedback-id:feedback-id
 :from:from:in-reply-to:in-reply-to:message-id:mime-version
 :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy
 :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1708772515; x=
 1708858915; bh=HKhS3qAzzT/6ICE5oMDBbzHW8saEk6em6Q8gKU2o/Uk=; b=L
 yj8PNZsO8VoAne/fq4vLlxkvfy6TiZcoVa0tKWah+QDz7v/mW8YoWEzPNA8z3Jzk
 IPueaxd4Xx+00+n7dLh0uAU8okSzM3F3OiS4n2Y7kVJUNLH3S/p4bJljpaSCUDFo
 eBTl6lfLwTlXQSSGCnNEd/NFPKCtsQf9x6wGhHhhrAy/dsmHzReNvoypjTOS88yA
 xFBulBxh+hVf9Ywk2kcFZPHWgQc7fBaMPHRHhx5kXau9g4jMYTHqg/JhGdV+T58E
 GF9sg0T2GHXvIn/V+t2qrONSDkWWX9Sm9ioGef6dZD/YgiFsg0h1yTJLubCwWj5c
 sSHWZdx9zaegpbweNwSyQ==
X-ME-Sender: <xms:oszZZepKx_gxlrrN73dPpwP09q4N0swWbkuxkfRCz3oIl15W0LMstQ>
 <xme:oszZZco91z2G1yUsDWpJMUvFvJIt--GYz8Zo0qdHhgt5BG2QhoL6_kjZz2LmQUlU9
 nrLCl9Zw6U4_VpytQ>
X-ME-Received: <xmr:oszZZTMjwc8nQ5W_EOjKIwhwz60RZg2gCZXd0CV_a8tayZTKchZ8x-rsnfTanIr5eHoPukhAjfbAu1xv2U-H>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrfeekgddvfecutefuodetggdotefrodftvf
 curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu
 uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc
 fjughrpefhvfevufffkfgjfhgggfgtsehtufertddttddvnecuhfhrohhmpefvhhhomhgr
 shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg
 ftrfgrthhtvghrnheptdejieeifeehtdffgfdvleetueeffeehueejgfeuteeftddtieek
 gfekudehtdfgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrh
 homhepthhhohhmrghssehmohhnjhgrlhhonhdrnhgvth
X-ME-Proxy: <xmx:oszZZd46w-xlCQ40T4iqjkzEMaDgO4YWKwqmuJr6nYwOXM68HeGd-g>
 <xmx:oszZZd5I7zrcq0iSS6AmaRVMMacfqsFEOL3Kvb3DuAm0iciotC3ElQ>
 <xmx:oszZZdgW6ETHffpui5-et_eTxwjINiDxYyr2Zwf7g8Luf8hrhUukjQ>
 <xmx:o8zZZXQt52FUpZNrZ5modBsWKNxoRoKVtJ7GPpAVKG7dG4iIIgFmAg>
Feedback-ID: i47234305:Fastmail
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat,
 24 Feb 2024 06:01:48 -0500 (EST)
From: Thomas Monjalon <thomas@monjalon.net>
To: Tyler Retzlaff <roretzla@linux.microsoft.com>
Cc: dev@dpdk.org, Ajit Khaparde <ajit.khaparde@broadcom.com>,
 Andrew Boyer <andrew.boyer@amd.com>,
 Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>,
 Bruce Richardson <bruce.richardson@intel.com>,
 Chenbo Xia <chenbox@nvidia.com>, Chengwen Feng <fengchengwen@huawei.com>,
 Dariusz Sosnowski <dsosnowski@nvidia.com>,
 David Christensen <drc@linux.vnet.ibm.com>,
 Hyong Youb Kim <hyonkim@cisco.com>, Jerin Jacob <jerinj@marvell.com>,
 Jie Hai <haijie1@huawei.com>, Jingjing Wu <jingjing.wu@intel.com>,
 John Daley <johndale@cisco.com>, Kevin Laatz <kevin.laatz@intel.com>,
 Kiran Kumar K <kirankumark@marvell.com>,
 Konstantin Ananyev <konstantin.v.ananyev@yandex.ru>,
 Maciej Czekaj <mczekaj@marvell.com>, Matan Azrad <matan@nvidia.com>,
 Maxime Coquelin <maxime.coquelin@redhat.com>,
 Nithin Dabilpuram <ndabilpuram@marvell.com>, Ori Kam <orika@nvidia.com>,
 Ruifeng Wang <ruifeng.wang@arm.com>, Satha Rao <skoteshwar@marvell.com>,
 Somnath Kotur <somnath.kotur@broadcom.com>,
 Suanming Mou <suanmingm@nvidia.com>, Sunil Kumar Kori <skori@marvell.com>,
 Viacheslav Ovsiienko <viacheslavo@nvidia.com>,
 Yisen Zhuang <yisen.zhuang@huawei.com>,
 Yuying Zhang <Yuying.Zhang@intel.com>, mb@smartsharesystems.com
Subject: Re: [PATCH v5 06/22] mbuf: add mbuf descriptor accessors
Date: Sat, 24 Feb 2024 12:01:46 +0100
Message-ID: <13458227.dW097sEU6C@thomas>
In-Reply-To: <1708762927-14126-7-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>
 <1708762927-14126-7-git-send-email-roretzla@linux.microsoft.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 7Bit
Content-Type: text/plain; charset="us-ascii"
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org

24/02/2024 09:21, Tyler Retzlaff:
> Provide inline functions to access rearm data and rx descriptor fields
> in rte_mbuf struct.
[...]
> +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;
> +}

We need to enforce usage of these accessors.
Please add these 2 things:
1/ comments in the mbuf structure to encourage using these functions
2/ checkpatch warning if using the markers directly in new code