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 1759C45843; Fri, 23 Aug 2024 09:34:58 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 241C9432C8; Fri, 23 Aug 2024 09:33:26 +0200 (CEST) Received: from AM0PR83CU005.outbound.protection.outlook.com (mail-westeuropeazon11010019.outbound.protection.outlook.com [52.101.69.19]) by mails.dpdk.org (Postfix) with ESMTP id D09F743276 for ; Fri, 23 Aug 2024 09:33:17 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=fRoji1IpMarVWJnIiFJHqjHCh2elqNfmWQd5czKi+FRpzH8fQ5ZFaZvF/tQPDVVmD/9hgZPGfMdCraCxnrhFyoLb0tblcmv3A8lJO58vEb5thBQZbHpadez9ecmLOQmN56v56kva0CC3IesyF4ewShZiny0MSX/hZu7F+dzC2uDIKQ0JmlMBAl6Em7MwPrZJYvu07KdVoS4XIdI/eOsSJjwMnKPa/NZ8xkZPByvLMO3Zy0BH6zgeANxs8KndhOhETynBU/+up1gZhYv8xYbA1orGM8LN20MmgTqSiSHL//50fEbCqIMxIqGhcEbjtHDx/KSMREds4OHjQJSqfhnxGQ== 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=qaEzM6hKrDC0rxOKcoUXVFhGEd4RvWA5obgx25wLbd/6y84qxfZ2QaAvm0hUQN8WLsQoW0QmRSrRm10no3CI3Tk+Qy7nAtnGa/Wy1LWs8jvvP+c/uGlaOwMuINpqdAyvE4PQqSVcVQKYossOcIjhkW9daOjEQgvH8Sn6zx1K0TpCbpinX6epNwDJ/Cn1JQP+Bl37EH6B0qcptRaNyfezGyxhSGmi4wZnlXfUJvLPrvF+0+GYFIxtY25TTjZNI0wUzeSK/FRiP0yFiRAO6XJifivw5q2Fq/kTLllygE+PzH0HZE8o6o8kaR9IobSS3/y/fHqv/gym5HmHQs3M5Gz2ug== 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=Aqn2JNT1TeCEfUA91ecHe/yJ5spfAT+0HNNSg5SFEncZpgrzhyN7MNqtdvoM3Xdrd2mGdwUkogSjM1/vlQ7DvEqnc4TIZ2a0TixVdTI+Q8kz4e6BZFwBWgXyt6dZcnF4Ks0NWvCn89EXXG0QWZD7lhu/WSwnRo9itDN3wQ9lmwLAJ0QiWQ8AqOOkjjq+UZngMbIXGNlp3vtaq264ep/E9whmYJsI0J6hsDcCmxcoAXlo1dmuAZB+Haktg9BvAhFe6bN5E32Sl4dR1WYqMDPuPZ0rYzaqMRInpov6VsLANUYCkUDuerhICOQhy21mGCmWnOUyBRcDZyPMFY4DUcaS6A== 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 DU2PR04MB8789.eurprd04.prod.outlook.com (2603:10a6:10:2e0::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.18; Fri, 23 Aug 2024 07:33:16 +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.7875.019; Fri, 23 Aug 2024 07:33:16 +0000 From: Hemant Agrawal To: dev@dpdk.org Cc: ferruh.yigit@intel.com, Gagandeep Singh Subject: [PATCH v2 13/18] net/dpaa: support mempool debug Date: Fri, 23 Aug 2024 13:02:35 +0530 Message-Id: <20240823073240.3708320-14-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240823073240.3708320-1-hemant.agrawal@nxp.com> References: <20240801105313.630280-1-hemant.agrawal@nxp.com> <20240823073240.3708320-1-hemant.agrawal@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SG2PR02CA0028.apcprd02.prod.outlook.com (2603:1096:3:18::16) To PAXPR04MB9328.eurprd04.prod.outlook.com (2603:10a6:102:2b6::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9328:EE_|DU2PR04MB8789:EE_ X-MS-Office365-Filtering-Correlation-Id: ad7d48c6-0427-48c7-a719-08dcc345da84 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|52116014|376014|1800799024|366016|38350700014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?yw+XCGH3A10sloo/cKW3FpCN1TR7b14oQ40Z9W3UK29YsrAK6zMawbn8uyFf?= =?us-ascii?Q?ycxZAkXdWVz4Y9PjrYkLHsbu591HSIsdapyTw5zAg5uXtBz0x78px+MlIHvb?= =?us-ascii?Q?cnSJz/WGACQwBrOU4kc3tz8uYdKZuaoy+OlK1lU+ez1UTIL4/UjlbbR4ZQGE?= =?us-ascii?Q?r0l+iXQsx/mIjldXUEW7Q5lsscdRNa4Uizfn6XqYBqzVvZquHMHHIfyBTfki?= =?us-ascii?Q?l+tFjoJ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ny1IshPSKFhTlRTH4E?= =?us-ascii?Q?s5xdTG95CX26Gwrw4Lu9tF44/v6JGdiRDWGpgd7dKwyTXohsws68rIFZwICM?= =?us-ascii?Q?5MvgL3OEUe2yA1QkeiEF8wymsKVvkQphCsQpMcf2R4NhN+cgzQOqfVds4496?= =?us-ascii?Q?6wzpfZTDyJAGbp5bmcxdqxLO8BOf9aSZxP9a1l9eVqvV4xlbQ20usqqM06et?= =?us-ascii?Q?JBBfv9AemuMbn28CpMg5JZjXYRikPq8xOSSKEzH71r4rObhk2UmdZwr0pf1Y?= =?us-ascii?Q?sGz+M7OqWY4I/QOQ0z3ZXovbMLBj2h/SrqLTPsV6uJvKFokVkA=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)(1800799024)(366016)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?aUL5etohqEbe7yzG0XOWIppgIEZ4+bqg/jlVMXhSYXk8YA9xqV58AlyrZWn5?= =?us-ascii?Q?NKbVUf6gbgt2A1P2tZCmpKaVl+h/TaJO11nO7WFMIUtEsPNQ7Gfntcp15c9o?= =?us-ascii?Q?vW309OVTiWM9YKvq7BYxUjB+01ar6BUl6wF+dyXNMNMr34wbRzFw6/etC5v7?= =?us-ascii?Q?rRitYxntmlM/sM549iZxEYDZJRduaODsSkUy0eXAmRbB5P02pRprGV5wS01Q?= =?us-ascii?Q?8rl9qRXSa9O2cqmutDvb9h6sL/zTa+zUnF7IWK1a86rN80DCJXrjg7dSoybP?= =?us-ascii?Q?vWUcyagqbtQsGv/OisuroHkLp3/ggL6U8nIoWZWaUqZNiabAgz8QpBCuLYrC?= =?us-ascii?Q?6ezFDyJJTn28Mw6hF6RyaFtClU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aAifxgB5TdiHnkiSmijFr1rRpqVvazv91ne7XzG0uQQMIAltPl?= =?us-ascii?Q?OD0h36BNig8eRHvoSOiroXk/XCkoylhn9LuWDv9aXF3sa8lI2nxegw1EOjPu?= =?us-ascii?Q?JEu06tjebSyAyZ9ZvULE6quVA1f4ctaxMusdi2tpDUyYk9SKhzgsOKWnqM/7?= =?us-ascii?Q?oambzKm4lhg3tPb9Xo8IX2hW7DcbAQssAQqPWXyeLsvFNcEvCfkVvCvFF21W?= =?us-ascii?Q?+6hpj1XKI6sYK0Z4uI/sw2FG26Sb4B+/I6y3ki+tRUTHIeAiB8MDBSxAKAFB?= =?us-ascii?Q?mJ/T64oZaPz3C06McLEwqaEzHuPzX287vYxe17+4x2LaU0KoMMVB77Y/cCXX?= =?us-ascii?Q?tQ=3D=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: ad7d48c6-0427-48c7-a719-08dcc345da84 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9328.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Aug 2024 07:33:16.7271 (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: AxCmSeWx7gp9UG+LQ1lJMoOIqGdchqaWswkc+hI2/zuZRS2xuaC5lHGo5Lin0/zbed4y/jOlvm9P+uDoD+JKXA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8789 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