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 F021D45748; Tue, 6 Aug 2024 10:42:40 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F188E40F1A; Tue, 6 Aug 2024 10:42:08 +0200 (CEST) Received: from EUR02-DB5-obe.outbound.protection.outlook.com (mail-db5eur02on2089.outbound.protection.outlook.com [40.107.249.89]) by mails.dpdk.org (Postfix) with ESMTP id 4F3EE40ED9 for ; Tue, 6 Aug 2024 10:42:07 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Gtk6F92sGtf26wFLLbl4AQz2DEZgDkbuvIN0kKbCsuWb6Km+conzdKmIoDNKSoeLRm33ePyc8UyAhgWw4Q6mdPxwwb6aIZH6f9nVsrF4wJWp6P+RVtmfL0f99n3zptS9RhNXGP4BggKyAcAVdNyMBQibDt5aihwB9E7WdmbPzD4zAa20s6ZMNl7yFmrgg+ZSxqaf360WGmOcMAMmwEFQZwWt0SvZAxQMRe0623+hEc9dALcQm2sHw/YT3EYVIcRzpcm5wt8LxuJQGQ5RP/Kepe4ieOeD5Stw8x8UyeZAVJipsBkFS1eQcqrDZ3eErRDVUMPcrxMxuo+ccl2bbg0L4A== 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=JH3AH00UnGCCf3g8KMYAD5OoXM7g8zzoBmWstMYx0Ao=; b=Bfn5Z0eUC7dmvwxoVohc+37E+xYEzOQYayQlOC0R36WUGiD0K3Dh2O+Ed6em4e6W0hFNMl68fJ+jBxLB3CUBhmhDCaKy3t9Q1iF6maljO1yEUjhKDYaT0pSIkj+P+XK0t9fMpaRLZNKxVHDlj3l3dqOXUELG1kExs7RXwxGy8x3zIJAOEJRfjxCC0qUwPbROuOO2sOZMR32XBSxg1yGVPEsbSdJ5V5AE6WLgRkAorQXN02xUe98mTUqRfWg5M8IR820ps0a4Nj7fRecuaDcK+g1GuVl0deHCV0aRoJFab0Tmy1CYweFWZlMErHNAKGCMSI3gi6RCZe0OE60xfhuH7g== 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=JH3AH00UnGCCf3g8KMYAD5OoXM7g8zzoBmWstMYx0Ao=; b=WbJVWHbRhXjVBZLGaC6Pb0mQGFApIfABZIhuIKB4lEU0LI9faDZp+4lySFxV+wq2z++TN0gDvwaoDI2ST87VPLA5o5kedxLgPMROfmYG07yEDkOgDMQ7+jBg2hyHzxF5/WZDqq1VNRSWlCeBiZ99d6TkcOnGslvsdCdUpAq5DWXt7T2Y5gLCkyi2KhjxobEBekvgYP2UwvdIbeoBRd1XM7o8Uak/Fwi42epQU7hBYV00+FNDasyQhM0dq7WEDEvSBd81VP3Fh2c9ZYP2t3tUS4Tr5UosFQ9igbgGMUrbrbyNFZWhyAotob4LFRrM+kuLRt/W8yfIjxqv2t/l3f0z2A== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AS8SPR01MB0024.eurprd04.prod.outlook.com (2603:10a6:20b:3d0::24) by PR3PR04MB7210.eurprd04.prod.outlook.com (2603:10a6:102:8f::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.26; Tue, 6 Aug 2024 08:42:06 +0000 Received: from AS8SPR01MB0024.eurprd04.prod.outlook.com ([fe80::c634:479e:8f8a:a325]) by AS8SPR01MB0024.eurprd04.prod.outlook.com ([fe80::c634:479e:8f8a:a325%7]) with mapi id 15.20.7828.023; Tue, 6 Aug 2024 08:42:05 +0000 From: Gagandeep Singh To: dev@dpdk.org, Hemant Agrawal Cc: Jun Yang Subject: [v1 7/7] crypto/dpaa2_sec: rework debug code Date: Tue, 6 Aug 2024 14:11:36 +0530 Message-Id: <20240806084136.3212615-8-g.singh@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240806084136.3212615-1-g.singh@nxp.com> References: <20240806084136.3212615-1-g.singh@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SI2PR01CA0041.apcprd01.prod.exchangelabs.com (2603:1096:4:193::15) To AS8SPR01MB0024.eurprd04.prod.outlook.com (2603:10a6:20b:3d0::24) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8SPR01MB0024:EE_|PR3PR04MB7210:EE_ X-MS-Office365-Filtering-Correlation-Id: cdd10745-8064-418f-73c9-08dcb5f3a6a8 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?d3UiRmckqVJv/ZxXPu6NshnvemAIrRO8EnML4GHjApW+0Ikveflh2PH9OoSa?= =?us-ascii?Q?HW9ea6JEzKLMHMxARXedsCCDEKpoQyqtoY3wVpfHTPtjcolON5ypptd/8kLC?= =?us-ascii?Q?xgPCKThrPgUtcyCVCYNZVOvZkIqKoJZJ1Dk6UZ0G8+1n4BvZ2QcNZdaw+rX4?= =?us-ascii?Q?9/df6nIN0oeLMCOmmfbRejnEdvcBmWSl6y95QzoACLq4F8LGfS+tYBdjGTPx?= =?us-ascii?Q?hkHK54LaooaMwMyvBZGJNdX8U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ascii?Q?Evcq2J4stlsy2wODSH7qTUyQ4n+Tb038SxeZvJAsBL2kVz2Y7nN8syqTIm4O?= =?us-ascii?Q?iwNBFqJUijTxKcQXqQerSknQHlSGu6wRbkX0etJM+81kEJVX45gKtbiVLluP?= =?us-ascii?Q?mT/ix3D4lFiqetT+eZ4if5C34UTwFC1gVSFd9K2BCbXWDpmXifm6UeWVHFKM?= =?us-ascii?Q?yJdJ/6YH7ZSnp8knJfSwNdNMaPVyKLXTgloW5oDsaAKzBllotkLBZoJXlj2q?= =?us-ascii?Q?7sYqH67VpPYR/oEADcw7ephbV7X/mxrQQwFDNRJ/faOI8SFiFQ=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AS8SPR01MB0024.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?gmvo1UmD733bYj3jjSWW4xFkp1DBMCYLMmFZj/pltm3i3UmyTbszRZXNrKsH?= =?us-ascii?Q?j+XNksBMcsDXXrTADm0nMqNz1YjmC6X4Wq1g0smhlLFcBTvY61jIjmokZeBJ?= =?us-ascii?Q?cUbOq/OBsDwsvSZ2UXz8MVHk9h1H9ANaDtdkuJnDGUgYoW57szHQTyn7V596?= =?us-ascii?Q?/V1fxUAaG2zTEmZ4DuAkDq1/3dT3ydDSuh7R0n0bi/JcboVOsEdz5Kz9bORv?= =?us-ascii?Q?dIRjRe0H8PKgPxjOslAb79sh3IcGpgogKcQ5UgIPymG664wNnma5G0il0mYd?= =?us-ascii?Q?33wOEi+BYKKDnIV/1obzSvynwUyuTrJHTzIV7wJpcxexBJR7fW4tnWx4j0Iw?= =?us-ascii?Q?ah6R2vYiG0EhcTrTIk8BVQqsQ0pFuPebZoDdPvGke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pWHs0+JAwvrzfPSmtLvRNgGRmIJeVr0/VOSMg4O?= =?us-ascii?Q?VTqgMIlr9FkaO//nPYjJimKfPkrbt12mKcIWfw768puTgOhCQgBEywDjjW0o?= =?us-ascii?Q?U+DgDpzog/Ak2YSrcR+r26nMp9g/c+doFlrCH8KsPkkgX+yK30T7XhgaMXUE?= =?us-ascii?Q?NcE+nCXZdv+dqHH6e9BITQF4FFajvh2K5fmTen9Jb/ymsU3xf+8+0rbCMDCQ?= =?us-ascii?Q?xY3+HG/+gQSTOl/PVtIx8kHec9Zbepb4zfo6FsvfsD0Xp2pXlgdLMqBBEcgv?= =?us-ascii?Q?6+vgmVm9Ijv0bJCv3tuAG8HaSCKv1P56mOPwQ4y2?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: cdd10745-8064-418f-73c9-08dcb5f3a6a8 X-MS-Exchange-CrossTenant-AuthSource: AS8SPR01MB0024.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Aug 2024 08:42:05.9158 (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: BctOjR10jc2VFgscigbQy9o9j1t1oxiNG/RRSy1nQx4NrYZzbnQg/IPyMYf5y4fw X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3PR04MB7210 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: Jun Yang Output debug information according to various modes. Signed-off-by: Jun Yang --- drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 63 ++++++++++++++++----- 1 file changed, 48 insertions(+), 15 deletions(-) diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c index 1e28c71b53..da3bd871ba 100644 --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c @@ -1095,7 +1095,7 @@ build_auth_fd(dpaa2_sec_session *sess, struct rte_crypto_op *op, static int build_cipher_sg_fd(dpaa2_sec_session *sess, struct rte_crypto_op *op, - struct qbman_fd *fd, __rte_unused uint16_t bpid) + struct qbman_fd *fd, uint16_t bpid) { struct rte_crypto_sym_op *sym_op = op->sym; struct qbman_fle *ip_fle, *op_fle, *sge, *fle; @@ -1105,6 +1105,10 @@ build_cipher_sg_fd(dpaa2_sec_session *sess, struct rte_crypto_op *op, struct rte_mbuf *mbuf; uint8_t *iv_ptr = rte_crypto_op_ctod_offset(op, uint8_t *, sess->iv.offset); +#if (RTE_LOG_DEBUG <= RTE_LOG_DP_LEVEL) + char debug_str[1024]; + int offset; +#endif data_len = sym_op->cipher.data.length; data_offset = sym_op->cipher.data.offset; @@ -1210,14 +1214,26 @@ build_cipher_sg_fd(dpaa2_sec_session *sess, struct rte_crypto_op *op, DPAA2_SET_FD_COMPOUND_FMT(fd); DPAA2_SET_FD_FLC(fd, DPAA2_VADDR_TO_IOVA(flc)); - DPAA2_SEC_DP_DEBUG( - "CIPHER SG: fdaddr =%" PRIx64 " bpid =%d meta =%d" - " off =%d, len =%d\n", +#if (RTE_LOG_DEBUG <= RTE_LOG_DP_LEVEL) + offset = sprintf(debug_str, + "CIPHER SG: fdaddr =%" PRIx64 ", from %s pool ", DPAA2_GET_FD_ADDR(fd), - DPAA2_GET_FD_BPID(fd), - rte_dpaa2_bpid_info[bpid].meta_data_size, - DPAA2_GET_FD_OFFSET(fd), - DPAA2_GET_FD_LEN(fd)); + bpid < MAX_BPID ? "SW" : "BMAN"); + if (bpid < MAX_BPID) { + offset += sprintf(&debug_str[offset], + "bpid = %d ", bpid); + } + offset += sprintf(&debug_str[offset], + "private size = %d ", + mbuf->pool->private_data_size); + offset += sprintf(&debug_str[offset], + "off =%d, len =%d\n", + DPAA2_GET_FD_OFFSET(fd), DPAA2_GET_FD_LEN(fd)); + DPAA2_SEC_DP_DEBUG("%s", debug_str); +#else + RTE_SET_USED(bpid); +#endif + return 0; } @@ -1233,6 +1249,10 @@ build_cipher_fd(dpaa2_sec_session *sess, struct rte_crypto_op *op, uint8_t *iv_ptr = rte_crypto_op_ctod_offset(op, uint8_t *, sess->iv.offset); struct rte_mbuf *dst; +#if (RTE_LOG_DEBUG <= RTE_LOG_DP_LEVEL) + char debug_str[1024]; + int offset; +#endif data_len = sym_op->cipher.data.length; data_offset = sym_op->cipher.data.offset; @@ -1324,14 +1344,23 @@ build_cipher_fd(dpaa2_sec_session *sess, struct rte_crypto_op *op, DPAA2_SET_FLE_FIN(sge); DPAA2_SET_FLE_FIN(fle); - DPAA2_SEC_DP_DEBUG( - "CIPHER: fdaddr =%" PRIx64 " bpid =%d meta =%d" - " off =%d, len =%d\n", +#if (RTE_LOG_DEBUG <= RTE_LOG_DP_LEVEL) + offset = sprintf(debug_str, + "CIPHER: fdaddr =%" PRIx64 ", from %s pool ", DPAA2_GET_FD_ADDR(fd), - DPAA2_GET_FD_BPID(fd), - rte_dpaa2_bpid_info[bpid].meta_data_size, - DPAA2_GET_FD_OFFSET(fd), - DPAA2_GET_FD_LEN(fd)); + bpid < MAX_BPID ? "SW" : "BMAN"); + if (bpid < MAX_BPID) { + offset += sprintf(&debug_str[offset], + "bpid = %d ", bpid); + } + offset += sprintf(&debug_str[offset], + "private size = %d ", + dst->pool->private_data_size); + offset += sprintf(&debug_str[offset], + "off =%d, len =%d\n", + DPAA2_GET_FD_OFFSET(fd), DPAA2_GET_FD_LEN(fd)); + DPAA2_SEC_DP_DEBUG("%s", debug_str); +#endif return 0; } @@ -1564,6 +1593,10 @@ sec_fd_to_mbuf(const struct qbman_fd *fd, struct dpaa2_sec_qp *qp) struct qbman_fle *fle; struct rte_crypto_op *op; struct rte_mbuf *dst, *src; +#if (RTE_LOG_DEBUG <= RTE_LOG_DP_LEVEL) + char debug_str[1024]; + int offset; +#endif if (DPAA2_FD_GET_FORMAT(fd) == qbman_fd_single) return sec_simple_fd_to_mbuf(fd); -- 2.25.1