[v5,18/18] net/dpaa: fix reallocate_mbuf handling

Message ID 20241001110325.4173762-19-hemant.agrawal@nxp.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series NXP DPAA ETH driver enhancement and fixes |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/intel-Functional success Functional PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/github-robot: build success github build: passed
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-marvell-Functional success Functional Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-sample-apps-testing success Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-compile-arm64-testing success Testing PASS

Commit Message

Hemant Agrawal Oct. 1, 2024, 11:03 a.m. UTC
From: Vanshika Shukla <vanshika.shukla@nxp.com>

This patch fixes the bug in the reallocate_mbuf code
handling. The source location is corrected when copying
the data in the new mbuf.

Fixes: f8c7a17a48c9 ("net/dpaa: support Tx scatter gather for non-DPAA buffer")
Cc: stable@dpdk.org

Signed-off-by: Vanshika Shukla <vanshika.shukla@nxp.com>
---
 drivers/net/dpaa/dpaa_rxtx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Patch

diff --git a/drivers/net/dpaa/dpaa_rxtx.c b/drivers/net/dpaa/dpaa_rxtx.c
index 1d7efdef88..247e7b92ba 100644
--- a/drivers/net/dpaa/dpaa_rxtx.c
+++ b/drivers/net/dpaa/dpaa_rxtx.c
@@ -1223,7 +1223,7 @@  reallocate_mbuf(struct qman_fq *txq, struct rte_mbuf *mbuf)
 		/* Copy the data */
 		data = rte_pktmbuf_append(new_mbufs[0], bytes_to_copy);
 
-		rte_memcpy((uint8_t *)data, rte_pktmbuf_mtod_offset(mbuf,
+		rte_memcpy((uint8_t *)data, rte_pktmbuf_mtod_offset(temp_mbuf,
 			   void *, offset1), bytes_to_copy);
 
 		/* Set new offsets and the temp buffers */