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 3246E4574A; Tue, 6 Aug 2024 12:28:40 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F14F942E1D; Tue, 6 Aug 2024 12:28:04 +0200 (CEST) Received: from AM0PR83CU005.outbound.protection.outlook.com (mail-westeuropeazon11010070.outbound.protection.outlook.com [52.101.69.70]) by mails.dpdk.org (Postfix) with ESMTP id 5035442DD6 for ; Tue, 6 Aug 2024 12:28:03 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Es9FXDsTxvmW8GDvNoebSX86hhC4b+fUsJgEtAFE/NfG0ErDBlb9gMfhyQui+X0hM/lCaYinlB5RcPdUgUICOR1eUkdu6Z7AckQRd0wUk/yRU1g3CsvVkNWtJeDuyJDViDRpF4c8bwMgT1IEhy9tzfcjB1DeyiL/gtibapn3+xX3Nzdwj9k4ic5XemqLWGRHvsYMujlrGjRIXPlxUD27AkuKPneZzQy2/pCgqUlW4MFEoxvdDLO+yX+Gd6qmPDgeH6XsRSgSM3iznXn0TJck1Qaxg2wgm2pwX6UoK4z/lJMvFsJu8+aCSkvEoE0GmIMZYKm9eB49fwIEyH1oHNOU2A== 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=RLxDTqWXpYUon1puF/VeYKLN1e5NKTgjQEFWSyW3Tew=; b=bGfJHhK0WWTU+Dnjd+CCDSc0Bsks9WXvnUYR3StccrCb07jVU6Vb0UZgO7KlVFUvZ6z722TOO9XnEN3V46CnxrWa8l+zObeZlnLegjKGpspjPuY2GhnC1TLhTe9nQ1ntWV/CsGBwguXZShrg0OOdP61s8kXll8mHSP8V4Zj+aADKJsjrG4skU+/vS3svhTHm8HtseyUXCFA9tAUwq4IJ5ci6yxlAIj4NiLZ4jGfE/u/A5EQuwyB+PtIcT+4e42H4DtFFGuQ0rqPbQxD27NwlWUlPEGzQQa5dYxnnLwQekZ5Vsjb+qy3b32Sp1JQCg0jF2mI4xW4QxwWzfHXukCcFrg== 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=RLxDTqWXpYUon1puF/VeYKLN1e5NKTgjQEFWSyW3Tew=; b=SCRvfj+AB5Qmuya2ZinT1YBAY11dPxZ0G3Miege0hIfB2jb5ILC4CQhCCJX1Zmq/KmNrtgRjQ6VERgxH3XVHna2gfeaCVcZcymmlSm6jivlTdMnVSoao8dSyBNqak+71K/9i4fkqQctHMu+OZN9zsXNqJhAWWlaQYK8MFAuERc3dZAe3ArAU8GlcBp4v2fyT6NDHKq6g3bAsrVU3Rkjs4cGsSGJ02RVCNt7+Jok0lOjDetW5OH6GbMGc1MV5d57/jeVTnlWqWMc0+eAxY2RljfkWyreZYQzlhISP8G9CMU+oXeu065vGERtDrhVqq8/vwCu84rrjtvC5EGs6yDlgWQ== 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 VI1PR04MB6974.eurprd04.prod.outlook.com (2603:10a6:803:133::15) 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 10:28:02 +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 10:28:02 +0000 From: Gagandeep Singh To: dev@dpdk.org, Hemant Agrawal Cc: Jun Yang Subject: [v2 7/7] crypto/dpaa2_sec: rework debug code Date: Tue, 6 Aug 2024 15:57:32 +0530 Message-Id: <20240806102732.3225536-8-g.singh@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240806102732.3225536-1-g.singh@nxp.com> References: <20240806084136.3212615-1-g.singh@nxp.com> <20240806102732.3225536-1-g.singh@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SG2PR04CA0188.apcprd04.prod.outlook.com (2603:1096:4:14::26) To AS8SPR01MB0024.eurprd04.prod.outlook.com (2603:10a6:20b:3d0::24) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8SPR01MB0024:EE_|VI1PR04MB6974:EE_ X-MS-Office365-Filtering-Correlation-Id: 69e53a41-300d-4d6f-af68-08dcb6027339 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?J99qC5OEPewtT0TKgwP1iW0swxuqkRkamWq2/ArPGY2bl6qAY35zNhUWGYSn?= =?us-ascii?Q?Lt372xfCvM1gzYmkGiUXW4lAqa+t6O6W6pBiizKarPqwbQLH1GSLgd8E0Fgu?= =?us-ascii?Q?vsKDt/q1wtQSOJ1KzL1uUEnOJyIpjzLChzUL8GXFm0mug97aZBzNSD35R9gq?= =?us-ascii?Q?6aJBpvfJaDuk/unGZljg7iT7yO1co+nu6Gc8xpCdutX16cHYkCTpvoUak0lm?= =?us-ascii?Q?PeB4cypT/FMWH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+GHtdhV8O4vR?= =?us-ascii?Q?MyQzMOfw2/w/O9KsNMfZOJTfV5ZD4wAV0HtVEyb183mD71SZ9PB5zNz8OsIl?= =?us-ascii?Q?V9GtbZQ//L3uG4o9ITqnOE3HVy1H07/V/dVObFOPer/5K+mdvu7VjZrBMjtM?= =?us-ascii?Q?t8R+82x2JnskrkaNoFv+/jB/S1nXTYISWv3pR1HB0uOgOUMbY+ph/jd8LKrq?= =?us-ascii?Q?+smEFNqf698BjMfeeftzN7DZH7tY+xvjHv7KouBJK1OC0Np0ZOLgH33LgYAp?= =?us-ascii?Q?9HQhPI+8H9lhx5k1IyCjvyfxbg2XcRC1pyLkhezcThX3tODzHw=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?aSxoJFHqJhL/Dx7fXaCpL3z9gJ4IdiR01tJO4R7o9Jc4/GkeIMYutGGmW0tr?= =?us-ascii?Q?hg0y1pWs4jzBXl/bfs4XofIrG58DN5YMh4IHkeKTAo12323+I4lk1eoSZvUA?= =?us-ascii?Q?9WTAISiBWkCO002KrJPIqP32Q35+7ZEsuSqjDguTLvNaH2u1cDx0UuTvTJR/?= =?us-ascii?Q?wZVHV2klsGmmOERJZOxKI8Bzg2BU8CKZosTQ/P+halt8VgHEEfC+r+mutWMH?= =?us-ascii?Q?A7b0DNtm0aAg/M/A+G21j00qXvlsQPree6pJvgSvvjxexK44LNVzfbN2ZdFQ?= =?us-ascii?Q?cTNU2ywklc2N1LBgqv0Gpz4wQp2mD3aBcOu1oqax01cndaE9sUudkrb7B98W?= =?us-ascii?Q?csZFhxR0f2NBUnrGo+3qliJ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?Q?8K9G0hcpgowYqOHj/s1z5dKLdAdXY+Q8qLoFu8n+LcMAH111BmjB2gUCA8cF?= =?us-ascii?Q?gMWPtfBX5NpQK7S90Vtn2+4mqrG7drga0HSE+ZKego0/WjWazOJW9sUaS7AO?= =?us-ascii?Q?37ftn71q4wTVJu5JKXHhnr5KztqXpIq0HlwLzzQE5PkNYInhTkb2t09561FB?= =?us-ascii?Q?33rnxGbb/vuBBFq+iNHNu3GgHKAG+DBThLuBi8thALaRPJhxfVyK+VJfcOOp?= =?us-ascii?Q?FQd7ucxBd1RG1fGUlffq/Mn4q0pAcM5r3NDo4GqxAWewxW7o8kt5Qda83fm5?= =?us-ascii?Q?jC7OBUSLMERKXavlirdiVPPXdfL3V8EcZYz8I+4p?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 69e53a41-300d-4d6f-af68-08dcb6027339 X-MS-Exchange-CrossTenant-AuthSource: AS8SPR01MB0024.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Aug 2024 10:28:02.0777 (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: g2v15iek4kD8xRV9MlVRswz4GdNSzbkFdGFUJ5ka8oMTyaVyaVmSipWHIDVdb83F X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB6974 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 | 87 +++++++++++++++------ 1 file changed, 63 insertions(+), 24 deletions(-) diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c index 1e28c71b53..a293a21881 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); @@ -1602,15 +1635,21 @@ sec_fd_to_mbuf(const struct qbman_fd *fd, struct dpaa2_sec_qp *qp) dst->data_len = len; } - DPAA2_SEC_DP_DEBUG("mbuf %p BMAN buf addr %p," - " fdaddr =%" PRIx64 " bpid =%d meta =%d off =%d, len =%d\n", - (void *)dst, - dst->buf_addr, - DPAA2_GET_FD_ADDR(fd), - DPAA2_GET_FD_BPID(fd), - rte_dpaa2_bpid_info[DPAA2_GET_FD_BPID(fd)].meta_data_size, - DPAA2_GET_FD_OFFSET(fd), - DPAA2_GET_FD_LEN(fd)); +#if (RTE_LOG_DEBUG <= RTE_LOG_DP_LEVEL) + offset = sprintf(debug_str, "Mbuf %p from %s pool ", + dst, DPAA2_GET_FD_IVP(fd) ? "SW" : "BMAN"); + if (!DPAA2_GET_FD_IVP(fd)) { + offset += sprintf(&debug_str[offset], "bpid = %d ", + DPAA2_GET_FD_BPID(fd)); + } + offset += sprintf(&debug_str[offset], + "private size = %d ", dst->pool->private_data_size); + offset += sprintf(&debug_str[offset], + "addr %p, fdaddr =%" PRIx64 ", off =%d, len =%d\n", + dst->buf_addr, DPAA2_GET_FD_ADDR(fd), + DPAA2_GET_FD_OFFSET(fd), DPAA2_GET_FD_LEN(fd)); + DPAA2_SEC_DP_DEBUG("%s", debug_str); +#endif /* free the fle memory */ if (likely(rte_pktmbuf_is_contiguous(src))) { -- 2.25.1