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 65AAB45AD2; Mon, 7 Oct 2024 10:40:36 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3DA2840E0B; Mon, 7 Oct 2024 10:40:36 +0200 (CEST) Received: from EUR02-DB5-obe.outbound.protection.outlook.com (mail-db5eur02on2066.outbound.protection.outlook.com [40.107.249.66]) by mails.dpdk.org (Postfix) with ESMTP id C1A4840151 for ; Mon, 7 Oct 2024 10:40:34 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=IdGCSyDaRyqufgy9lKvgr3sGcOTpqskEQrTjXBC4ISebaBNTYKaNJr34g/VnmJBKqMveMmhR4yeGDzHhU+QnNxsh/iUvXHUxIhm9Ax6MnDMR/oOExc7l4QNG23EPoU1PnYuxXKtf6jyN58zJNXP/969NCGcDkhCLYKuY+U0p35ywUg67MwIRLdGDM9zyAmDxGWSrktHDv32fRpATNVTX5xHUziNNA+Rd+kW3xpzU1DKI9Pr3kw7PTXeXOugOTUyTnoHDTZzQAZljIBmXkdv9tOQ7vQsXoaB4+0am3yOsaRbqhX1CXsf+8UTfeXRnBy6WIhSOI6k06qVNZOBGbHQEkA== 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=e7qp4vE9l7yMzm8QgL5ZODbmYCr884WdDSgf3B9UH48=; b=zUyOW1rhXH6XjWom86SALJ1qHM+p2PVwISaR+zR1cWBEc/1/5vHID9vceQ03CS/GNrFY3hgiadwowYIVnhqlrT8s0TC6BpRpGj0oQ+tMLU4AJ8f6cdCUxjmBI8PYNXtP9ZFqcUM5C+OwTbeY8tVyKRXY3Pzk62scaJl+kqDv0/qixyeYvUkEYJI+g2shezaer9ZELZO4l3kFIjVsNjnH4XvtvO+mVpsgD1SKpKtk2RLZjPIlar+dlXePiRzHJPdjnybLoN9muRJ7K2Spy8jFAggxfmdIstlsYIukU2g0SV7AEkGfSg/azmdhGaXs5U2fnky9FotRLYHODlu9jINdsQ== 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=e7qp4vE9l7yMzm8QgL5ZODbmYCr884WdDSgf3B9UH48=; b=Qgj6gjJhvBZxJftfirf80LJ6blnfgOA9lV8g8UCfblvh3uiVQGj5vy4mmefZPGtLhj16rVd6xUnsPt+xzQbj6hM+7qlsh30gfNEudAnDrV7fLllGlFIHmhUc/ga1RsqXKkuLFFisuj22NfJPRXy14eBbZmS9eI/S3yAygX//7QoWlaRKXKR+LjiZA4VqV/84/ljbS77ypvG+Cv0UbD5lwoLwqhzX5/F2qD/29Lzee6TaPiclEYWlRMa7WEMPnkeUAp0Hawyzsb50d+mQ0lh8rdstfbwWyoraqLqmjS7HhqdFhHlT3Z+/PQYUH8dEr8aKg9qQ5++oDTASyN/TnoqkGw== 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 AS1PR04MB9558.eurprd04.prod.outlook.com (2603:10a6:20b:482::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8026.23; Mon, 7 Oct 2024 08:40:32 +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:40:32 +0000 From: Gagandeep Singh To: dev@dpdk.org, gakhil@marvell.com, david.marchand@redhat.com Cc: Gagandeep Singh , Jun Yang , Gagandeep Singh Subject: [PATCH] crypto/dpaa2_sec: rework debug code Date: Mon, 7 Oct 2024 14:10:14 +0530 Message-Id: <20241007084014.851198-1-g.singh@nxp.com> X-Mailer: git-send-email 2.25.1 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SI1PR02CA0031.apcprd02.prod.outlook.com (2603:1096:4:1f6::11) To AS8PR04MB8198.eurprd04.prod.outlook.com (2603:10a6:20b:3b0::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB8198:EE_|AS1PR04MB9558:EE_ X-MS-Office365-Filtering-Correlation-Id: a49023ea-e824-4029-7481-08dce6abb4b6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|52116014|366016|376014|38350700014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?c7wptx+4g82bAR98m5AFukTiUX1EYQB83fyv5X8OJ02XRd06+a4achaTTrw0?= =?us-ascii?Q?q96QZo8P8T0RgKvtK33p+gSwlJhUsE86hOwLzCt++YNLd8/dQG0M/CE+tz7H?= =?us-ascii?Q?/g4RyCbXDfX1a7tiboc1k3hRqttCaqJCCBrKGD4JETLFVWCNBQ2yvVIOPULC?= =?us-ascii?Q?0nR8hxOERxoR6fo9SYeq/VYoqE9vrMDUHTBCa94GB80TXboWg0u0RZ3+1NAC?= =?us-ascii?Q?RBue+CcNp/iPB6+z43GwnQEMNCngnv6Sx26F+zMFD/7mGDi9pmKcDLoYzp0i?= =?us-ascii?Q?VMEK/GXmL6o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wnzooQ2ja?= =?us-ascii?Q?DyxML5karIiLvYtcwQJjqy+jqyK/kfkFOwVZxxot7wvi5nnObeYbtzT7HPUY?= =?us-ascii?Q?OLJNGyyP6fd5QacH/SgeorKwjXm17X8LHy/pxpdDcjdNVJFRQNZXDcB/SLod?= =?us-ascii?Q?DPtpwxZ6mCRZB1KQw+kxtRtMFEfS+qNEbPjfP1Wfr46KGw=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)(1800799024)(52116014)(366016)(376014)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?DDJGAHa59QTm25zLlRdaqMpSxzU3Ov6Vzj9q4C8xoYEG+9bucz4oUIwgdw7S?= =?us-ascii?Q?sjlxH7o1bNj3wynoWNLkHDICez+Rhjdx1L9WMv6AvkwKj+lEk7iDxvjUh2P3?= =?us-ascii?Q?NU2mTZaw+suhnARLYG2C22nrnIOJRqUI2WI0qZ1QkDPpa1dHenICazRGgvfh?= =?us-ascii?Q?k5rU9NrWLwj78G4DDc1n3oiAlFpOpns7Mn0HBiPsOmrfROT/lu3lzwOFfxUK?= =?us-ascii?Q?ZcvqVdZsFqst3DkQp99LPCg85U5FgrP5mgW5NZ4bo4Fam12m3KuSiTuvLej1?= =?us-ascii?Q?4lA4Zf7ZSG+mPzmgU22xMey2TKuAfSANx3HqRk+YiDDF1i4wQzjVC7hgjSXL?= =?us-ascii?Q?cymA+QLyXBvhV/s/c2tvo3vl5Q9+EFqO9wE5CrFEod2CDDkpqkl3lalfLWlz?= =?us-ascii?Q?pHwFH98RcmVYD/ARbrqqhui26eQEKwE391MX7xW0VG2SBuWYFiMiDEDJiHIj?= =?us-ascii?Q?LHQF8GipoN3cXRtKRl7GyDE1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ascii?Q?x8IUENmFt0Ec+HqcCuPSXqy9ZscR3eOIZZ2MhU2TZTssdku7tndVpZmK66Nv?= =?us-ascii?Q?5oUgiG9hQYpQvCGkZNpoBfjib1B5A9pk+wW/AfLqccI7WI5b3bRdj7UzXcdy?= =?us-ascii?Q?Pnj13GWAIngaN4xVbfMdNlMXulO197/p8ZVPN2J/ogT+4w4lJOFqA7vzcHlh?= =?us-ascii?Q?3m5GbbjFcD1AFS345pw=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: a49023ea-e824-4029-7481-08dce6abb4b6 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:40:32.7406 (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: d9UUO+wg7SvaMS9UCGp9fFQJ0lGYSjGWG+0wHsimdS7nTfCrdWTVczafmvVH6IB7 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS1PR04MB9558 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