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 079B745509 for ; Thu, 27 Jun 2024 09:58:52 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F403640DCE; Thu, 27 Jun 2024 09:58:51 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 8E7FB402AD; Thu, 27 Jun 2024 09:58:50 +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 45R7ZYdg021241; Thu, 27 Jun 2024 00:58:49 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pfpt0220; bh=r m+SyQ+LCCJWoFai215rGOj34kHB/8ZX8ED1uYliY6c=; b=Bu0eg5rEszsYvQ+hT 0TvrCHIxrV6vnA3LRc8FXaKV9B2pCg5+stHtr6b1rz0fmxOinwqrlqixSW3FNfEN 0uX7fakjGhUCVD0XdKbYRrxXK0bOl3PKRSIWYZtOPBdVc3RWV0+YcMOH3bpJU0dC l8F9NxK29yXmPnQfkmbxDlSSeFzVmqS1s3e9CdYN9X841/DN/jNy5NMGqgU05YVN NSgDZc20axVnsMLvG2J17Wb7zzMZwMO0wY6rdmIdFOgkFi1/eIawvf+pJB8cNXxm oLw+Gn6uV+QVafvSxZ93yZZbakPbCvZ7S3Te61fQjfMYiXuKOqP7u6pNCqY+arhZ RjgYQ== Received: from dc6wp-exch02.marvell.com ([4.21.29.225]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 400rkg1yk6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 27 Jun 2024 00:58:48 -0700 (PDT) Received: from DC6WP-EXCH02.marvell.com (10.76.176.209) by DC6WP-EXCH02.marvell.com (10.76.176.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Thu, 27 Jun 2024 00:58:48 -0700 Received: from maili.marvell.com (10.69.176.80) by DC6WP-EXCH02.marvell.com (10.76.176.209) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Thu, 27 Jun 2024 00:58:48 -0700 Received: from localhost.localdomain (unknown [10.28.34.29]) by maili.marvell.com (Postfix) with ESMTP id A8F385B6929; Thu, 27 Jun 2024 00:58:45 -0700 (PDT) From: Shijith Thotton To: CC: , Shijith Thotton , , , =?UTF-8?q?Morten=20Br=C3=B8rup?= , Stephen Hemminger Subject: [PATCH v2] mbuf: fix API to copy mbuf dynamic fields Date: Thu, 27 Jun 2024 13:27:56 +0530 Message-ID: <20240627075755.66386-1-sthotton@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240626120802.19333-1-sthotton@marvell.com> References: <20240626120802.19333-1-sthotton@marvell.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Proofpoint-GUID: otkW_QzmyoemKYeCVPQMoayBC9U30AqS X-Proofpoint-ORIG-GUID: otkW_QzmyoemKYeCVPQMoayBC9U30AqS 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-27_04,2024-06-25_01,2024-05-17_01 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-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 Reviewed-by: Morten Brørup Acked-by: Stephen Hemminger --- v2: - Moved copy of dynfield2 before dynfield1. - Added Reviewed-by and Acked-by tags. 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..babe16c72c 100644 --- a/lib/mbuf/rte_mbuf.h +++ b/lib/mbuf/rte_mbuf.h @@ -1119,6 +1119,9 @@ rte_pktmbuf_attach_extbuf(struct rte_mbuf *m, void *buf_addr, static inline void rte_mbuf_dynfield_copy(struct rte_mbuf *mdst, const struct rte_mbuf *msrc) { +#if !RTE_IOVA_IN_MBUF + mdst->dynfield2 = msrc->dynfield2; +#endif memcpy(&mdst->dynfield1, msrc->dynfield1, sizeof(mdst->dynfield1)); } -- 2.25.1