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 D4ECD45710; Thu, 1 Aug 2024 12:55:14 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1E822433E0; Thu, 1 Aug 2024 12:53:51 +0200 (CEST) Received: from AM0PR83CU005.outbound.protection.outlook.com (mail-westeuropeazon11010036.outbound.protection.outlook.com [52.101.69.36]) by mails.dpdk.org (Postfix) with ESMTP id AB28D433D9 for ; Thu, 1 Aug 2024 12:53:48 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=EKvIQGL1ziSLrl6fa8FXvufvzJbEounjVCskTUpDZ/U6ciltK6LcLFKDzPyZiT3dz1cwIwkCkAJunMu5IBFoOjc/XAwvL+iTH/BA9k5XEvtfiXqQmp8//WzP2Axeno36jITIhO06TcQgKGxt0gD4okEh4u2k7BeCUCD7C8k92I+kVyoYeJrlEvAqXDd4ZpgsKncXthv3sWrEstF+VdybPx7djag0NsL0GHmwpb6+VEU5wmftsDUYYiZHhOedO/VUG2FGssKHPZz+hpGUxG+zgpIQCHSXoFllVlBUeMqBCFIJI2xEy9Tdwwb56FjgcMTgoLTk2Q3FMq3peJKTPKMvrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=GYdkm2Q9aLtnj2ZcdzP5b/PVOpteD53m9K6G08NFa1M=; b=xej1Tl9F1Vz+i2hehO/ySW/SShKiw4aZfin9QxYaVfO50UMCH2tUJmx2eUCcj9kag5SE+8MNR78osPGa3fe2ZuV6dy+K8klaepYOpMH/fsQ4aYmvS0ZyvgibVi974Q/ZrQD8+4bIXtzAOmeCKB7Wxi0KZZN7ZgvBxGEGidTjH5EB5hFEJSSbv2nWK7T+orlPoxWny46yNK4TFcrC813hSgbeHzAof1IWpkJvPFkawgkCGhOY4Hjt71dq+mDypOqU1VYBZNGjGntzxTY+KntwL3x4jpRXMhjHPWzvJ/K5HoKgBVHH9oNAI9Xqq5cwq7InJIcluNk96BICRrQPEj0YEw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GYdkm2Q9aLtnj2ZcdzP5b/PVOpteD53m9K6G08NFa1M=; b=MpJmEpnx1p/7xKbJtuWrRXXDVeY3enNBGRXKNn1Q3dm9PNBDkkAKoWhQJdeyuib5oZMJ9rs63xIL+1678rSHdHtuIEAH4dgoN2oW5LjzfhljScFF57Sp5tmW7QCtWtI7wpyP0AOnzKIkxv5jVwaYDkPDJSH5jEz4xExLySyD/9+3qNOFgXoibo4N9fMX0MKSx/Woh1h5PLSiiYRshlRxppF4ZEHdp3Acgydruk0ClsDQfYGuNsQN9w3tmGSEpiyTUvG2c+UO5+dcqDLhb1Hyifj1peR4W6hhsni3RHp97Kt5No2SEyfd5kdm+xakJ/aVSmKNl7otvev4i1qsqaWg5g== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB9328.eurprd04.prod.outlook.com (2603:10a6:102:2b6::15) by AS8PR04MB8433.eurprd04.prod.outlook.com (2603:10a6:20b:407::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.23; Thu, 1 Aug 2024 10:53:46 +0000 Received: from PAXPR04MB9328.eurprd04.prod.outlook.com ([fe80::367:d59:375:fb87]) by PAXPR04MB9328.eurprd04.prod.outlook.com ([fe80::367:d59:375:fb87%3]) with mapi id 15.20.7828.021; Thu, 1 Aug 2024 10:53:46 +0000 From: Hemant Agrawal To: dev@dpdk.org Cc: ferruh.yigit@amd.com, Gagandeep Singh Subject: [PATCH 12/17] net/dpaa: support mempool debug Date: Thu, 1 Aug 2024 16:23:08 +0530 Message-Id: <20240801105313.630280-13-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240801105313.630280-1-hemant.agrawal@nxp.com> References: <20240801105313.630280-1-hemant.agrawal@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SG2P153CA0026.APCP153.PROD.OUTLOOK.COM (2603:1096:4:c7::13) To PAXPR04MB9328.eurprd04.prod.outlook.com (2603:10a6:102:2b6::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9328:EE_|AS8PR04MB8433:EE_ X-MS-Office365-Filtering-Correlation-Id: 44a9c9bd-a0ef-4f32-a7db-08dcb218369a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|366016|52116014|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?3NWNRPujJVq4bcE6Bo/ZnHANePK5LwtqsqQL2eaxR9mttWkqfiBfaI2NAR6y?= =?us-ascii?Q?TDJ1EZtn35O77s4dmM0qwElhYijwS7olOOe+94VJCYiW/E+ULGMwLziiNM4l?= =?us-ascii?Q?KbiEfenDFZ0aX/QXIg9N9777ZF1hI/2QLWEzR2QFGGYbmnBSmbvcFUR4DTZk?= =?us-ascii?Q?ksd6GKcCrFou0+RVc5J9djhHdt5i6dZiReskWSu3OWc9gXPNDvqJxkzP3n0z?= =?us-ascii?Q?VKBju7ZILjlmzaWGlYdYPnAM3bF1aeIX34ZG6Hfl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AMhx6owlyxygqACCJ4ofCx6LgdQwReWFQp4Rkh5W?= =?us-ascii?Q?5oKHco8cfWQd8LngEGANPA8ZG4EZ6XXQSClcvhIpvzfrbKUdlFJLUDAdYLjc?= =?us-ascii?Q?Eda3CcZRKYngPVDPGa1phaTj8fy06BhufnGMUFNXhR7kAL3KbJT5IyqIUGiX?= =?us-ascii?Q?bXJVKabEM+uO4Ron3jT5KxPnpq4tlF/9BKZ0Yl1DfN+5Rb29qRKLdrNEX7Hb?= =?us-ascii?Q?iOP8MlbrMfXKuLx1KakfcVJ3hu77lT4s25RIS/HoiPTsFvPU6Q=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PAXPR04MB9328.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(366016)(52116014)(1800799024)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?Oq78NO3SDz8TyxAB1BqG8psMK9auIfKyHE+aFkwbTjgE5cCYUGOqJL9Bnu/N?= =?us-ascii?Q?v+NcHa84YTD4aV2OXZP6u9IK0VXscCfPbwZrLkQiEFJoeF9uCCY0WVpyLgUN?= =?us-ascii?Q?Vvhj/BF40o0bK2we2Eus0cLHVGzYKGiMroa1s6zFuDU5dBQunaxGPgHpR9VW?= =?us-ascii?Q?ivN3eqFEYN2yEhN3v1763nuAhzkft+QL+pAbJaustuIiW0zBbXXznsOS09xL?= =?us-ascii?Q?ZbEcJeE1irzYKXIkhW321hNh7ikyVXk0W8hbhq8haHqn9+cXjCYiYbehQObT?= =?us-ascii?Q?aiDptjCYLfTV6lsnminu1RCLTvusw63M196LN4oW4vjwW4kvDIXpWXMoZfRq?= =?us-ascii?Q?UyquDOcV6+2tkJhyIPoy7Fw3RLTIGc3aCQYXIeUmDC++sATghONzq1mF1mWk?= =?us-asc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Vn4R0WB/SQsupU++0wEa2GS8OJj?= =?us-ascii?Q?gHLKQOhXiW9N3qXkQTNbhwcYbRZN4gb4fc1faVvMKyMKo2sFVDeyartDn/0z?= =?us-ascii?Q?e16QWPvlSACjafGrzdcu1B+FnqahG2oH3VsErVxC7SYEoR8NgKc40xwcK9nq?= =?us-ascii?Q?Z4rKYFYdlq16SnCJaWYt61NOaHeA1Bl8iJEdEh3snkiSdKuA9+zrrnNN9y/8?= =?us-ascii?Q?eROcvyrD5WQj4Xkx5p2BAB+WV8GBJP33Bx+mTQmAiAdPQOkwVj2bG6qfZ2NU?= =?us-ascii?Q?VGI1ltCSglDe/cxWh2QAeTyfpvrIyDCv0XNQ+EZsx/2+Vv55RDkup2XQZVb/?= =?us-ascii?Q?zw=3D=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 44a9c9bd-a0ef-4f32-a7db-08dcb218369a X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9328.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Aug 2024 10:53:44.5994 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: uq8WOwYW1WjVo6099XzEUX2sssdFro66IVtSHba5J7vJ3Ln3YGl3aiDD07o1ekpsmhqGnk6HU8ppqkBc77018w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB8433 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: Gagandeep Singh This patch adds support to compile time debug the mempool corruptions in dpaa driver. Signed-off-by: Gagandeep Singh --- drivers/net/dpaa/dpaa_rxtx.c | 40 ++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/drivers/net/dpaa/dpaa_rxtx.c b/drivers/net/dpaa/dpaa_rxtx.c index 56b4ce1056..84fd0c57a4 100644 --- a/drivers/net/dpaa/dpaa_rxtx.c +++ b/drivers/net/dpaa/dpaa_rxtx.c @@ -496,6 +496,10 @@ dpaa_eth_sg_to_mbuf(const struct qm_fd *fd, uint32_t ifid) first_seg->data_len = sg_temp->length; first_seg->pkt_len = sg_temp->length; rte_mbuf_refcnt_set(first_seg, 1); +#ifdef RTE_LIBRTE_MEMPOOL_DEBUG + rte_mempool_check_cookies(rte_mempool_from_obj((void *)first_seg), + (void **)&first_seg, 1, 1); +#endif first_seg->port = ifid; first_seg->nb_segs = 1; @@ -513,6 +517,10 @@ dpaa_eth_sg_to_mbuf(const struct qm_fd *fd, uint32_t ifid) first_seg->pkt_len += sg_temp->length; first_seg->nb_segs += 1; rte_mbuf_refcnt_set(cur_seg, 1); +#ifdef RTE_LIBRTE_MEMPOOL_DEBUG + rte_mempool_check_cookies(rte_mempool_from_obj((void *)cur_seg), + (void **)&cur_seg, 1, 1); +#endif prev_seg->next = cur_seg; if (sg_temp->final) { cur_seg->next = NULL; @@ -524,6 +532,10 @@ dpaa_eth_sg_to_mbuf(const struct qm_fd *fd, uint32_t ifid) first_seg->pkt_len, first_seg->nb_segs); dpaa_eth_packet_info(first_seg, vaddr); +#ifdef RTE_LIBRTE_MEMPOOL_DEBUG + rte_mempool_check_cookies(rte_mempool_from_obj((void *)temp), + (void **)&temp, 1, 1); +#endif rte_pktmbuf_free_seg(temp); return first_seg; @@ -564,6 +576,10 @@ dpaa_eth_fd_to_mbuf(const struct qm_fd *fd, uint32_t ifid) mbuf->ol_flags = 0; mbuf->next = NULL; rte_mbuf_refcnt_set(mbuf, 1); +#ifdef RTE_LIBRTE_MEMPOOL_DEBUG + rte_mempool_check_cookies(rte_mempool_from_obj((void *)mbuf), + (void **)&mbuf, 1, 1); +#endif dpaa_eth_packet_info(mbuf, mbuf->buf_addr); return mbuf; @@ -680,6 +696,10 @@ dpaa_rx_cb_no_prefetch(struct qman_fq **fq, struct qm_dqrr_entry **dqrr, mbuf->ol_flags = 0; mbuf->next = NULL; rte_mbuf_refcnt_set(mbuf, 1); +#ifdef RTE_LIBRTE_MEMPOOL_DEBUG + rte_mempool_check_cookies(rte_mempool_from_obj((void *)mbuf), + (void **)&mbuf, 1, 1); +#endif dpaa_eth_packet_info(mbuf, mbuf->buf_addr); dpaa_display_frame_info(fd, fq[0]->fqid, true); #if defined(RTE_LIBRTE_IEEE1588) @@ -727,6 +747,10 @@ dpaa_rx_cb(struct qman_fq **fq, struct qm_dqrr_entry **dqrr, mbuf->ol_flags = 0; mbuf->next = NULL; rte_mbuf_refcnt_set(mbuf, 1); +#ifdef RTE_LIBRTE_MEMPOOL_DEBUG + rte_mempool_check_cookies(rte_mempool_from_obj((void *)mbuf), + (void **)&mbuf, 1, 1); +#endif dpaa_eth_packet_info(mbuf, mbuf->buf_addr); dpaa_display_frame_info(fd, fq[0]->fqid, true); #if defined(RTE_LIBRTE_IEEE1588) @@ -978,6 +1002,10 @@ dpaa_eth_mbuf_to_sg_fd(struct rte_mbuf *mbuf, return -1; } +#ifdef RTE_LIBRTE_MEMPOOL_DEBUG + rte_mempool_check_cookies(rte_mempool_from_obj((void *)temp), + (void **)&temp, 1, 0); +#endif fd->cmd = 0; fd->opaque_addr = 0; @@ -1023,6 +1051,10 @@ dpaa_eth_mbuf_to_sg_fd(struct rte_mbuf *mbuf, } else { sg_temp->bpid = DPAA_MEMPOOL_TO_BPID(cur_seg->pool); +#ifdef RTE_LIBRTE_MEMPOOL_DEBUG + rte_mempool_check_cookies(rte_mempool_from_obj((void *)cur_seg), + (void **)&cur_seg, 1, 0); +#endif } } else if (RTE_MBUF_HAS_EXTBUF(cur_seg)) { free_buf[*free_count].seg = cur_seg; @@ -1080,6 +1112,10 @@ tx_on_dpaa_pool_unsegmented(struct rte_mbuf *mbuf, * released by BMAN. */ DPAA_MBUF_TO_CONTIG_FD(mbuf, fd_arr, bp_info->bpid); +#ifdef RTE_LIBRTE_MEMPOOL_DEBUG + rte_mempool_check_cookies(rte_mempool_from_obj((void *)mbuf), + (void **)&mbuf, 1, 0); +#endif } } else if (RTE_MBUF_HAS_EXTBUF(mbuf)) { buf_to_free[*free_count].seg = mbuf; @@ -1310,6 +1346,10 @@ dpaa_eth_queue_tx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs) DPAA_TX_CKSUM_OFFLOAD_MASK) dpaa_unsegmented_checksum(mbuf, &fd_arr[loop]); +#ifdef RTE_LIBRTE_MEMPOOL_DEBUG + rte_mempool_check_cookies(rte_mempool_from_obj((void *)mbuf), + (void **)&mbuf, 1, 0); +#endif continue; } } else { -- 2.25.1