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 6919145501;
	Wed, 26 Jun 2024 14:15:39 +0200 (CEST)
Received: from mails.dpdk.org (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id F3BBF402C8;
	Wed, 26 Jun 2024 14:15:38 +0200 (CEST)
Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com
 [67.231.156.173])
 by mails.dpdk.org (Postfix) with ESMTP id 2B98D42E6E;
 Wed, 26 Jun 2024 14:08:12 +0200 (CEST)
Received: from pps.filterd (m0045851.ppops.net [127.0.0.1])
 by mx0b-0016f401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45Q5RZem005244;
 Wed, 26 Jun 2024 05:08:11 -0700
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=
 cc:content-transfer-encoding:content-type:date:from:message-id
 :mime-version:subject:to; s=pfpt0220; bh=NduVA2iGFWxsoLp/3XaijZP
 PgYPrUIXiDCLL1agi7go=; b=d/2U0gwfmE6ycJZkqW8i2iCvIAETgMyd8otoP0m
 xK1z6wq2LVUDx5riZCGt62CD7PTBs3VkLWx6uU/fjLeHYioCklAsu+QKaQ6gAB2k
 zUlza1PKjdloEKDfnRl6DbLqHJR+mBD9mlCTMoTilgKvRdz8+5ZkVLHSc4ggAPNA
 3P4s0fkC8DS7OTsBEu8FYG40ztUNXN6vEUeSw7PCXroKijRJvnqFAZ7S8nytSJZN
 N8L8J6C04XVDcYCG0g2//qJvNLb0WrZAvCjxMbYcN6rUcslPhpmTQZ4pxipVkXEI
 a1AaOll5Tl8Ayen4lBLRRvlZkwxLUYkes3bD4TfnpNQCUyQ==
Received: from dc5-exch05.marvell.com ([199.233.59.128])
 by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 400cur991f-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
 Wed, 26 Jun 2024 05:08:10 -0700 (PDT)
Received: from DC5-EXCH05.marvell.com (10.69.176.209) by
 DC5-EXCH05.marvell.com (10.69.176.209) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.2.1544.4; Wed, 26 Jun 2024 05:08:09 -0700
Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH05.marvell.com
 (10.69.176.209) with Microsoft SMTP Server id 15.2.1544.4 via Frontend
 Transport; Wed, 26 Jun 2024 05:08:09 -0700
Received: from localhost.localdomain (unknown [10.28.34.29])
 by maili.marvell.com (Postfix) with ESMTP id 3B5B83F7054;
 Wed, 26 Jun 2024 05:08:06 -0700 (PDT)
From: Shijith Thotton <sthotton@marvell.com>
To: <dev@dpdk.org>
CC: <olivier.matz@6wind.com>, Shijith Thotton <sthotton@marvell.com>,
 <jerinj@marvell.com>, <mb@smartsharesystems.com>, <stable@dpdk.org>
Subject: [PATCH] mbuf: fix API to copy mbuf dynamic fields
Date: Wed, 26 Jun 2024 17:38:02 +0530
Message-ID: <20240626120802.19333-1-sthotton@marvell.com>
X-Mailer: git-send-email 2.25.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-Proofpoint-ORIG-GUID: NCtorIor0O6I8MWyRvgvNLkyYeOnErwS
X-Proofpoint-GUID: NCtorIor0O6I8MWyRvgvNLkyYeOnErwS
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16
 definitions=2024-06-26_06,2024-06-25_01,2024-05-17_01
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

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.

see https://bugs.dpdk.org/show_bug.cgi?id=1472

Bugzilla ID: 1472
Fixes: 03b57eb7ab9a ("mbuf: add second dynamic field member")
Cc: stable@dpdk.org

Signed-off-by: Shijith Thotton <sthotton@marvell.com>
---
 lib/mbuf/rte_mbuf.h | 3 +++
 1 file changed, 3 insertions(+)

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 = msrc->dynfield2;
+#endif
 }
 
 /* internal */
-- 
2.25.1