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 CEA8F45A68; Mon, 30 Sep 2024 14:17:56 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B58B640A79; Mon, 30 Sep 2024 14:16:34 +0200 (CEST) Received: from AS8PR04CU009.outbound.protection.outlook.com (mail-westeuropeazon11011061.outbound.protection.outlook.com [52.101.70.61]) by mails.dpdk.org (Postfix) with ESMTP id 3856640697 for ; Mon, 30 Sep 2024 14:16:27 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=aIGGYYVsoq9BSF3papdD1J7CtpzsBSG0nA9ukojfBw9TE1Wt+NL1iSJ3Q9BB2lWwkpOIXufUKk5ooDYr8T0z8R1cpiPc+XNWTBy2ZFTQA/EusO+W/X4h6GeHmovdySLxVcffXH60dErNZleBsmTBMO4AXpI2Z7aUFKUNLCHi8He6ZA85xef9yGoY4dFPgPQNokHv3ncGh5CGdkB3pc9HnnqQekvKxEEbTenAOypeWs3qJsP0QcaH4ITf6lP9itBP2cBpMiUnIHnwOCWBVEnjYfoVehywNJfd7sZaUTQGIFQ12Dblr0R5mdk0TemLJ9qWL6YpStQwjfeJi8dZegms0g== 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=88lhycnP1azZhgbzTwflMvkdTE3cBQd4zrFBMbRfE+w=; b=TOekfZzZzw3B6rqMsLaJBWw9w9WihytGqZKOaotUd69crXgnvSn4pCKsX+yTEbQdfmHPHr/kqEKrrPbrjBY3y1RV7k8fYvgXKseK4r1M5BQW1VOns2ipPxSQrvaOc7h/9bBqvl0LUPcdSETevqcT5GGzBiACGMRhDp57u2A8DfCgVl2aSx1vTndw+dT2daxlLBD9FWwOdkG4NACUVBKp++XcEYmKjQEbw0dwuPHSgBqgxsvnLyBf0p0QXeDHlamg/zNNjcAxIgVIeqAUuezz9mgMQXgsWIz9+uuOY1BsVsZJBAB9Cw3LB+G1zSDGQtFpM0lziDYf/DHdfzr7uU3Zrw== 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=88lhycnP1azZhgbzTwflMvkdTE3cBQd4zrFBMbRfE+w=; b=mocJMz5SwBodSuUDFNSdvMABLMRdA9nXjujxQcVICkF3M8LzMHz0wPz6t4jmmZTHeC1PXFkTq84IG3RhF/zgBVivIvLSxXh8DWQhEpUguGMCBchTKfIw/Pj26RFT9EJZHKVCqm5VHtIxT0VFGF6aDbZpg3SBmlg6knbltXvDIUg/JxExTIVGpA5IQCtE20cpztpt9fJvHLr2tsqW8d1XROTNMKYN29kCjby8GVLsnxITTn3jWJV6ZBAVh9faw0WDEJX8/Maii5Zc//qUuAWjlsd+4ydYXEKadYX0AHwvnXgkqzV8UOb2mVDzZYJMzPbKcQuJW//KxMK0Ar7fhYUTxw== 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 GV1PR04MB10583.eurprd04.prod.outlook.com (2603:10a6:150:203::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8005.26; Mon, 30 Sep 2024 12:16:25 +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.8005.026; Mon, 30 Sep 2024 12:16:25 +0000 From: Hemant Agrawal To: dev@dpdk.org Cc: ferruh.yigit@amd.com, Gagandeep Singh Subject: [PATCH v4 13/18] net/dpaa: support mempool debug Date: Mon, 30 Sep 2024 17:45:20 +0530 Message-Id: <20240930121525.3452847-14-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240930121525.3452847-1-hemant.agrawal@nxp.com> References: <20240823073240.3708320-1-hemant.agrawal@nxp.com> <20240930121525.3452847-1-hemant.agrawal@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SG2PR01CA0124.apcprd01.prod.exchangelabs.com (2603:1096:4:40::28) To PAXPR04MB9328.eurprd04.prod.outlook.com (2603:10a6:102:2b6::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9328:EE_|GV1PR04MB10583:EE_ X-MS-Office365-Filtering-Correlation-Id: 66933027-fd48-47d7-3fe5-08dce149b482 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|366016|52116014|376014|38350700014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?dSqZLl5CWExGrGyCuedcp7drLxy+tfBqmeRYvHmu7yoJnrJOCo4inZnXVbQx?= =?us-ascii?Q?mruWQOEAqrqMjBsks1/6MxVvb5cfeM+Ol8hRWl25ED/c7XiyT1o5Mgk2naZX?= =?us-ascii?Q?v/Y6Yr6vvpWkhfLH9/K0nIPcCxHeMzxLSMD81x6YKowgtc3QeJJbE0PNidYP?= =?us-ascii?Q?KKfLVXdFlU03sgEkLX7i3syL1hbbxBldvH3CJsKlGCzA4ScmW9JPSsyri1fp?= =?us-ascii?Q?KCSqLZ4nu1VIYmahDsb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ascii?Q?3H06G3arcACtoHEimH3XendiSbYA70bGcBRjNf8CV4Ksjunv4ShW5yVSd1+X?= =?us-ascii?Q?v14qkuDCFq5lAi2GJjfu6om38ulmoyjFCpM9XpLm+34LbCUk2fKdkHhndrZP?= =?us-ascii?Q?Y7FSctxGKfp4o6TecW8QMJdNJEouplErYv80yYWWykMK9+X1reppUElbz6FF?= =?us-ascii?Q?Ra6wQ4BqQ7keDQmOyvM2YwbTj64IHY74S8cIealhr80xZQ=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)(1800799024)(366016)(52116014)(376014)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?xQflENAxKNFMMYhlIW+EM2UYUus7zITxSOzgAHlYDpWGO70vEE4m7aHdLikh?= =?us-ascii?Q?X5ocLuvXQH8A2Jo6OPRTO4DFfm52JJ2ZWj3n4RwpUwyYfOldJx7+7Wps81b4?= =?us-ascii?Q?uLsCV3cxPDu92Z+DpLEnTuMUtBiuorUdebaavfg0PM8PrhDQrNZ2gi3s+kyj?= =?us-ascii?Q?SnexQjv3+1hKYkseCaClNnyVXh5YF0d/xWFezqzBrczey3xcudTWX8FISXiM?= =?us-ascii?Q?nRe0lAmJXAx9W4EPLYPImxiqd5QuspZjHOy6Redjfb08AyCKnIbRgzeYQL10?= =?us-ascii?Q?odTd7goHEI1Dce4Gs/BbQbPb/OVA5gxOia0PLOEGsQ65NiUJT//bmDQ9tmt7?= =?us-ascii?Q?waplnc216ueGvHSd8akjo3XBRqGiSD32eofUQqnotyjxWgxXROd+f+zG3MOf?= =?us-ascii?Q?ePAjU0mebbeAW0KpS2rTa42MKGZ/YZgcMiCgC6we+4gbGXxZ3RHMNlKGfn2a?= =?us-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FHlK69MKTnbzcNu?= =?us-ascii?Q?rj8iGz39qcjyFBRWRuZclKz5IKTAZCGalF7KIqbZMG2qXPByweLwwrW42pK1?= =?us-ascii?Q?ikmFntwYm1hlye99CYJoqBLfxPWkpBK6s3v8ARE5cIjq8LYuxqmXrsPFRKvm?= =?us-ascii?Q?ymXAXxZDY0oCjCi1GN+/+4t5MDF0l+47lP0dzit5I59A5coRDwslF1ibZO2b?= =?us-ascii?Q?D4DQYzRgdNa074sEYr0ws18acmD2FpmjBOP1aUZUsadOawa4GWh8vxAyXaS3?= =?us-ascii?Q?6w=3D=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 66933027-fd48-47d7-3fe5-08dce149b482 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9328.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Sep 2024 12:16:25.8762 (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: BMO3vw0FzWpuwhiTQSpgnpm64iQBO3SZFXj/XkzaKLu2v8RLAHT51VpoDUeAFmU1dU1FE6XXrIYBnTmDm6zimw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR04MB10583 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 945c84ab10..d82c6f3be2 100644 --- a/drivers/net/dpaa/dpaa_rxtx.c +++ b/drivers/net/dpaa/dpaa_rxtx.c @@ -494,6 +494,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; @@ -511,6 +515,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; @@ -522,6 +530,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; @@ -562,6 +574,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; @@ -676,6 +692,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 (dpaa_ieee_1588) { @@ -722,6 +742,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 (dpaa_ieee_1588) { @@ -972,6 +996,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; @@ -1017,6 +1045,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; @@ -1074,6 +1106,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; @@ -1302,6 +1338,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