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 1712145A67; Mon, 30 Sep 2024 12:31:54 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0F34240A72; Mon, 30 Sep 2024 12:30:35 +0200 (CEST) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2074.outbound.protection.outlook.com [40.107.20.74]) by mails.dpdk.org (Postfix) with ESMTP id C7460402A3 for ; Mon, 30 Sep 2024 12:30:22 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=l9fz/8dOFxxPoQUiUaM8GcnLGVyV7ERrVCjShEYUorXp3iKDpIzjdR467sXF//vw0YPrDBRvp9lw8m7KUlj4NeNZkUHvVTvt3mTBLwMEVb1tiymJTBnP8KIkaRYSEqVTbs57cO9cJth3Zbrkb39WYz38cFeQZb+t8vwaV1dHQDpL070E3K9nWO0EFrMDh03OzxNsaYJFu5UMqyV49hQRaa72toVWFJtxdw3ELGwIeWkcGyPBUqTaOGG4eYVy7TbTrlLhEVPn6/+fsRDHqsgBXm/bjIaHP58N2tA6zuchQT2oDwGrmTuLoNd8xnmz9HoTP8JK4HB7fBtdLiJSOUdzHg== 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=hUkfYTc8v1EslcOZbutwcZVqf8hBZfUfybPIwqQD5oWcRBvum0gU1arfDtQd43DNhZf4Yz2FXQMHLS6rKNzfP+RBDkZJUyUtGDFgId4i815SzFuoa99agcZrrWM0WIxbS0sKCNtzmutWrCeB7WbHr4MGPI50wEYjsTXr+7G66YC/HVhsDbLqmUCxRxUL0M5wxbzIUjwsaDaeYI5YsAIL5Fl5X1Q84YtklLvluCL1HMVjiS3gZZAGfG0XRwfmkhj2+lDye1pc5jbaN4YrSq+ehJ3LgZFgqAsDMHe6rIZecKUplmfSA34oW8elvd97ubQpeIdzU9mg0bz/fPylIDzD6g== 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=mpoKXgI/bm1u3f69RaxpBBnN32A/ddOVRxjJnd+yy6e1fCveBPHo4UejYPSfbJIM66L2l5vg8qDAsr1p+LWdylbcf9VSmOUBEgC77QPEBPHbIZrIPMVERm2VbEgA9ht8Ua/jbgsuc2sAK/fIkgIOlDAY6qORAuTc0+cEOhNiTISCYCOyIJVTrjqwyXum0hvuRBJtEt0t82S+yrHDU6/YM1BJRHOpETkwfBeXmpccOcSHwb7DmCdfUQtcsGkMp5sGA1K8icxMmkHdwnphp22Q2ozrlS9cp/l18inSjyk0EVSU0lsgYJdHeTK8SJ5o08Cp+wJdyMiAnuJTwmNg82SBQA== 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 VI0PR04MB10161.eurprd04.prod.outlook.com (2603:10a6:800:242::6) 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 10:30:21 +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 10:30:21 +0000 From: Hemant Agrawal To: dev@dpdk.org Cc: ferruh.yigit@amd.com, Gagandeep Singh Subject: [PATCH v3 13/18] net/dpaa: support mempool debug Date: Mon, 30 Sep 2024 15:59:41 +0530 Message-Id: <20240930102946.3236998-14-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240930102946.3236998-1-hemant.agrawal@nxp.com> References: <20240823073240.3708320-1-hemant.agrawal@nxp.com> <20240930102946.3236998-1-hemant.agrawal@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SG2P153CA0027.APCP153.PROD.OUTLOOK.COM (2603:1096:4:c7::14) To PAXPR04MB9328.eurprd04.prod.outlook.com (2603:10a6:102:2b6::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9328:EE_|VI0PR04MB10161:EE_ X-MS-Office365-Filtering-Correlation-Id: a925ba57-b240-4aca-13b7-08dce13ae31b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|52116014|376014|366016|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?K3jY13W1LNy0NuIoAyJrlOSDhwJnPwPrXDBWA4VIJravpo200bzMH7yZ83Xz?= =?us-ascii?Q?pmaFhZ00l4rxWwatcouxpI73D65ZWF5kBH7Ix935DOTnHObQEr6dASpMXXQb?= =?us-ascii?Q?ntMCrki4gtBQ8YQJXRrVWlJY7UqrvnBdBITbQpVx4C72usmzlsB/UwlTGw2U?= =?us-ascii?Q?DCL0peIYtGVzwPUWQg/j5/TE3ThOgCKueKVgmRBAtYV2szoNSYMSq3Bb+At9?= =?us-ascii?Q?zw1/Jf12BGD/CuaadIn1O4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l+RC0OTmIKCQe+9l+1Ry9gNCK+lkuJaSx81AEuJi3M18yB9EOO6qBn?= =?us-ascii?Q?sp9FQJeYNNp7yt5nsymLI5ewd1VSX7D4J3TiqyLaSEFx9mL9fleog6feH4gy?= =?us-ascii?Q?gMiHpflFZLV8+3P1yo/iBjm/ZXt50r8tDTtNFbEMc0z0+sVb22Ee/jh8iCBQ?= =?us-ascii?Q?5/W/lLDJsTbs8OxF2h5QsPrNMZpfa6/1ZdanjI2Rwg9esQ=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)(52116014)(376014)(366016)(1800799024)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?J7t4ByJMR0ZPpGng4ykAaWdEEbMfe8/L4lUuLwCWO4+ull5+Oby9Jn5ONqD7?= =?us-ascii?Q?vJzYzLg3YJ2fy6Zcyr3VJgPlQ5XUcOUCXoOjuxT8r/jTf+60eGbO05ieaJ8k?= =?us-ascii?Q?qA7ijCPUcPekPsO3RloytcCkW6LP/UMUaeTwyBBSY3jTl5huYlSpVDwx/oCz?= =?us-ascii?Q?XCvnQeilSIob6Kbi3P3GwDBOQ9ajYlZ4wfeXSNC1fYyyXNOI1iO+sAv2ZNko?= =?us-ascii?Q?O50psp4vevKP4uZXC/pjk6RfTPW5DyuxSgjvg3iCTG8Zn/dVvu1FJlwKoHvI?= =?us-ascii?Q?0+XEB/qrd7gmnKfXOyxMz50MlMJAEsTKdDs6DYCvwNPCGHr8eynelJlhuH21?= =?us-ascii?Q?2y8VBrrIg9+THgZ0Vy2+KNgE1SJxQ9uP5ETKQaeYFIOl3l50sG///Fk1es9H?= =?us-ascii?Q?vKex+CUaBhfpCscgbVGT5+7sChJts+q01/8Dcr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z7K5TLVCQ3cJwBklYASP2aX4Up5+0IKjxtvGYOf+v+q1Chj1nF5jTAp6dD2l?= =?us-ascii?Q?LGOxgxH/DYbNMkqZ52elgFpnpy8bEovQEEV/HWhCl6K7GMZ+iL7vq83I8dsJ?= =?us-ascii?Q?aITdYX50QZJLQzSXyxPZ1agf40DPwoiPDpRNuVJiAKlP+vWUHv5v+SxUVu5P?= =?us-ascii?Q?wscOpmCBvcNUU9ZP8M23oxirPJZ6koeei+frDoEOwRdxpCFYibDuluC9gogC?= =?us-ascii?Q?yiKuKs4BFIVFf8yzFCL7/cx68gUWaW8gpei9OGopOHasAFcovF0HQvTT1dWO?= =?us-ascii?Q?4g=3D=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: a925ba57-b240-4aca-13b7-08dce13ae31b X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9328.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Sep 2024 10:30:21.5883 (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: msziA9WCBZ/p4Y05w8SOZQ30w5tOyEQX9Nl8YwWh5BFidiDypru8N9sJfD5fUcprnoIP7iUqaJa2EZXnXrPTRg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI0PR04MB10161 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