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 E992C45501; Wed, 26 Jun 2024 14:23:30 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DCFDB4336F; Wed, 26 Jun 2024 14:23:30 +0200 (CEST) Received: from dkmailrelay1.smartsharesystems.com (smartserver.smartsharesystems.com [77.243.40.215]) by mails.dpdk.org (Postfix) with ESMTP id 1F1D743363; Wed, 26 Jun 2024 14:23:30 +0200 (CEST) Received: from smartserver.smartsharesystems.com (smartserver.smartsharesys.local [192.168.4.10]) by dkmailrelay1.smartsharesystems.com (Postfix) with ESMTP id 1DC2B208AF; Wed, 26 Jun 2024 14:23:29 +0200 (CEST) Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: RE: [PATCH] mbuf: fix API to copy mbuf dynamic fields Date: Wed, 26 Jun 2024 14:23:28 +0200 Message-ID: <98CBD80474FA8B44BF855DF32C47DC35E9F55A@smartserver.smartshare.dk> In-Reply-To: <20240626120802.19333-1-sthotton@marvell.com> X-MimeOLE: Produced By Microsoft Exchange V6.5 X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PATCH] mbuf: fix API to copy mbuf dynamic fields Thread-Index: AdrHwYW1Ctgpkg96ScikyAFcLbEtEgAAbnJA References: <20240626120802.19333-1-sthotton@marvell.com> From: =?iso-8859-1?Q?Morten_Br=F8rup?= To: "Shijith Thotton" , Cc: , , 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: Shijith Thotton [mailto:sthotton@marvell.com] > Sent: Wednesday, 26 June 2024 14.08 >=20 > Fixed rte_mbuf_dynfield_copy() API to copy dynamic fields from one = mbuf > to another. When RTE_IOVA_AS_PA is not defined during the build, an > additional dynamic field (dynfield2) becomes available. This field > should be conditionally copied to ensure the complete duplication of > dynamic fields between mbufs. This patch fixes the same. >=20 > see https://bugs.dpdk.org/show_bug.cgi?id=3D1472 >=20 > Bugzilla ID: 1472 > Fixes: 03b57eb7ab9a ("mbuf: add second dynamic field member") > Cc: stable@dpdk.org >=20 > Signed-off-by: Shijith Thotton Thank you for fixing this bug. > --- > lib/mbuf/rte_mbuf.h | 3 +++ > 1 file changed, 3 insertions(+) >=20 > diff --git a/lib/mbuf/rte_mbuf.h b/lib/mbuf/rte_mbuf.h > index 4c4722e002..dc6d1237ac 100644 > --- a/lib/mbuf/rte_mbuf.h > +++ b/lib/mbuf/rte_mbuf.h > @@ -1120,6 +1120,9 @@ static inline void > rte_mbuf_dynfield_copy(struct rte_mbuf *mdst, const struct rte_mbuf = *msrc) > { > memcpy(&mdst->dynfield1, msrc->dynfield1, sizeof(mdst->dynfield1)); > +#if !RTE_IOVA_IN_MBUF > + mdst->dynfield2 =3D msrc->dynfield2; > +#endif dynfield2 is located before dynfield1 in the mbuf struct; suggest copy = dynfield2 before dynfield1. > } >=20 > /* internal */ > -- > 2.25.1 With or without suggested change, Reviewed-by: Morten Br=F8rup