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 2FAE445AD2; Mon, 7 Oct 2024 10:44:13 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F3AC840E0B; Mon, 7 Oct 2024 10:44:12 +0200 (CEST) Received: from DB3PR0202CU003.outbound.protection.outlook.com (mail-northeuropeazon11011027.outbound.protection.outlook.com [52.101.65.27]) by mails.dpdk.org (Postfix) with ESMTP id 8E5D140151 for ; Mon, 7 Oct 2024 10:44:11 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=A4qkU6gK67DxyQKXNlfL8TqIXVhkkQHMqQvhajTezSHXn/65bJ9V4Bn0khOORvnGkyauXCVL5oMpUYkettlOlbFmmBLSr1vOkpslJMU4KHWCWEIHdyp2QJGqAewkGR6KbAylxnLb7EPoGbZU+FjQt/M+s1g2cIAfQSeO8jDIir7gX67vUB5hVWGAZk8BD0l78LvFK1q4u8NcUKFT/OmdK518XibMhFhT9N0wV9ZB+jIkYothiuhPVZTJwr6Ay1FnobeSL9zkoKlJn26fo60qLl1K7W24qxVbCKFUf5zoEApnS04F9JjKc4yN2ojRF74Fi7K2UIi3KhC/bsoe9JBifQ== 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=BL9zF6hS3NqAJ0KtffvcO9JS+vnSaicPCi7JLdpdtxk=; b=iAWnRg+ytOBhJs0E0eAqJx4pZPTMVV6o3wt1SP+X7smlHLf7ze6HEEl37enkYMRDUP/DCUoPFd2Kyn5fsfGznHEfbZP2+PyQTdZVfIJlkjw2hw9sbIm9HJv1Zxfqel8DmIJQ+7tLClgyiY2zcobgMxeu8QysTMxsFBmdQATH2nigkWUAs/jA8nBTXXdsJf7iB4FMUEP7BCj2tX9UqpyVG4+kLjlcgGL9Qhbwa9xI9Rl23vsPI+5P0SY+W78kvhNlUHa01fbGbLLGbqzM/fdr3isC+I8iOWMFrfQAvXY2dYcSlW1HXCN3Hm65bWtWs0HI9DlXXBoOa/PJX1JB6eYrow== 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=BL9zF6hS3NqAJ0KtffvcO9JS+vnSaicPCi7JLdpdtxk=; b=et9xZzxC4tWmmpqZOrzKgRUSNLDVIFSAd1ezMhL316aAyoyVW2BuQfzE0X3IqweuI8wTYdsztruTsEz6Wov6RzxC65tEKGCz2IJTcPqkI6W/f5ARN3tePMzteaSNvklAmBD3G29RnhRNV6f9SYD8vuYhwS69e+gNYlDvyHKMZeguiNPUIW6dmhqNHYlDTyW4cNEXtvKaZoYWIuBfxUP39NXE2rgFHVuN5HvFFYFAvzdVwQ7PKTkTQyvv43P0J+IG00ydUMBBMwIpejvUNi66hohmp6CgLjPsVDaE3nVj1gUmjbFyF1V1DTr7jAnKuGuF85ECgZ6eTofTfz2Yr8baHA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AS8PR04MB8198.eurprd04.prod.outlook.com (2603:10a6:20b:3b0::14) by AM0PR04MB6883.eurprd04.prod.outlook.com (2603:10a6:208:17f::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8026.22; Mon, 7 Oct 2024 08:44:09 +0000 Received: from AS8PR04MB8198.eurprd04.prod.outlook.com ([fe80::2e32:1a4a:7d29:195]) by AS8PR04MB8198.eurprd04.prod.outlook.com ([fe80::2e32:1a4a:7d29:195%4]) with mapi id 15.20.8026.020; Mon, 7 Oct 2024 08:44:09 +0000 From: Gagandeep Singh To: dev@dpdk.org, gakhil@marvell.com, david.marchand@redhat.com Cc: Gagandeep Singh , Jun Yang Subject: [PATCH] crypto/dpaa2_sec: rework debug code Date: Mon, 7 Oct 2024 14:13:54 +0530 Message-Id: <20241007084354.852733-1-g.singh@nxp.com> X-Mailer: git-send-email 2.25.1 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SG2PR02CA0125.apcprd02.prod.outlook.com (2603:1096:4:188::13) To AS8PR04MB8198.eurprd04.prod.outlook.com (2603:10a6:20b:3b0::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB8198:EE_|AM0PR04MB6883:EE_ X-MS-Office365-Filtering-Correlation-Id: 18805004-9ef3-44d6-be40-08dce6ac35f4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|376014|52116014|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?EcCK+56tCW3EOLY7o+8O40zFcNjltSYPZm6OPknU9bUmJvxxVg1XIG/4h6iX?= =?us-ascii?Q?A4LkxGtQJ6WzEJDa+5LucIN7+C2dXH6X/CuaxHA4lhKRGmeFiz3b1a5rwBaq?= =?us-ascii?Q?YG7U6hdSMDCvpqJ98hxopA6zy62Ig00SHr1kIw9zSMqiiTY3eMqppz5KgJiD?= =?us-ascii?Q?Cef8+nDECkWv5zfGIIKwO6cNWuMiYQdvJGPLLrpNCTJjobBxf+4RMS4SmD2C?= =?us-ascii?Q?G/rG/U2Sr8DxAJRGvUKDydDpRKinJh5EoQnTOMbslNguMePq9e/7p1oVY/s+?= =?us-ascii?Q?YKKpAZ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WyHOpmL?= =?us-ascii?Q?9hkqmkexApKqfucyuH6YY3HhWynVz52VidHJyLHatzjFXk3CFHkK6jE3jll0?= =?us-ascii?Q?Tig3HfKr1CynO8w2gYiObvWCXPRJrGnlLUT7vTCZ/kA4tHI+yM0WQwQUXaHU?= =?us-ascii?Q?1LoG9PgA4Pj6Gf1rMt7i37oD8vEp6mWgbxxoPnmHxBu/0w=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AS8PR04MB8198.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(376014)(52116014)(1800799024)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?405xRMQC4xsDS0e69q03yeLg0OzjMfOEYjSlgc5PHpOIA3I1gBK13Kki4Ft+?= =?us-ascii?Q?CMEAWqq8bUd+iM55//SpIRp0lbWoZ6jVw+MDdH1kityLxNPIQ1CToDT29u1I?= =?us-ascii?Q?wbAEakUj+AMlYerBR3FE51qJP6hJUMH0CKSTWp4hMkIECXH84EvpIdI9EL6w?= =?us-ascii?Q?IJHYJSmc+VJ5nzImVIbY7kj9QZoIDmM3qUnBOyBIP+1fZslGb0kXK2UjQfRI?= =?us-ascii?Q?PvwMf42YxLMjWhoocsXGz0L4wkAZfDHnYlzv42UZL4f/v6S7xW9IAbY7AVZt?= =?us-ascii?Q?0NFV/RJxLxVJUooI2xOZdey5+pcoVhls0Hmya+PGLzZZQY9/YCLw5MYYrOuY?= =?us-ascii?Q?KRjCjVbkXinkkC339B7wy8FxiJqb2kamQaDDWKEYO5WDGgTCTLFRfWjEaTkE?= =?us-ascii?Q?kfx7j8C/SPOZrnTv8bDLAIsguOXvsXUF5gsIRogN6ST+Fr4sq7tVgSbj+iVL?= =?us-ascii?Q?mpbF25edcIMgT+8rmcjtfqRHXGwxiOc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Q?S/8Ft0oE0xqkklQIzB5ZxEv7xIyWjs+WFU/qkZIAkOiJkHnoj3aLV+rHAPZU?= =?us-ascii?Q?UoZFxHw6WJTTC7zdwE0GA3PG7wK6E1KEe/LaefaK3WPFxFw1Auc6DXJtD3ce?= =?us-ascii?Q?+EvsZZcpwnxLU1c4LcO947YCcaFBRMnETD97/XOCzUgTvJCnxrIR+NgGeaVL?= =?us-ascii?Q?I4L/1u1vl8Z6eDAwKMk=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 18805004-9ef3-44d6-be40-08dce6ac35f4 X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8198.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Oct 2024 08:44:09.5540 (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: s30Pc7AyB+lPDDxuwP7T9mdxqYe+2eJyAKQgGfE3jLn3QlQZU3xPszCJRc0BW+Tr X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB6883 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 Output debug information according to various modes. Signed-off-by: Jun Yang Signed-off-by: Gagandeep Singh --- 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 2cdf9308f8..1a897514e1 100644 --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c @@ -1097,7 +1097,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; @@ -1107,6 +1107,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; @@ -1212,14 +1216,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", +#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", + 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; } @@ -1235,6 +1251,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; @@ -1326,14 +1346,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", +#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", + DPAA2_GET_FD_OFFSET(fd), DPAA2_GET_FD_LEN(fd)); + DPAA2_SEC_DP_DEBUG("%s", debug_str); +#endif return 0; } @@ -1566,6 +1595,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); @@ -1604,15 +1637,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", - (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", + 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