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 1C8B545AEA; Wed, 9 Oct 2024 07:07:36 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E4D22402BC; Wed, 9 Oct 2024 07:07:35 +0200 (CEST) Received: from DU2PR03CU002.outbound.protection.outlook.com (mail-northeuropeazon11012042.outbound.protection.outlook.com [52.101.66.42]) by mails.dpdk.org (Postfix) with ESMTP id 091AA4029C for ; Wed, 9 Oct 2024 07:07:34 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=UegPEZY9ZuKR3yAB/MedMaXNRktRXvEf1OrH/xhOjPxIcl3F0vKjwWsAEI3v6EZacuybHWYNZ8aFpat0HMJqu4beqBGdRZ2S1sl77wDYtHo1Hxq2TuqlfkMlm8AdxVglxtgUnSrvJN9b5qTjHvatvA6004c43E10l07BCZ0AddKtD4Hq44j5yobLwH6FCjc6A2QMXohPlgaTE7CIv5Duc9ijq0w+4oboo1dZ6w0OgZgCHpel3E/yjZNljuM2pBdTZFGh//DZjfXHL/Rlb3lJhAjlrTVsKswUspn3NiR0Xc+J5BY7m5H52ss8LY/m79+4GhAjj197IUIb9tWYak/i9g== 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=yzvWnBVpg/BubVk+88kg7zSfAXOuOuWuLI3vbsUhc94=; b=uzApIE0UiPrOAQ41TOLQc5hpV18a2dKg0qUpEQxMsrESFBtvSqW7bcAO6yGV42NZFUBmI+PnLofk2/7kaMeaPJjLG7mtmz9n85xdzvXijhkj40yWzWNxREzowMzA4xnIBF7r/4NSqqDF/AD+eksTm4io47eJw+D6/USvhyqPUMyKDwZC3j9NEbTzJnSjMQoyiGHgK2IXOyF0kxVwzL4dvbyD6uwhIYz6JE2W+THAxagsTKNS4cJe7pPKFaGVyJmA8F7QBNRW2B1AfvyhfV6XJRJWDkvFjwRuP50iq7KM3gaQvIEp5ekPuqXD01C11UTo2DOaFAhLaLlplt6kUA3obA== 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=yzvWnBVpg/BubVk+88kg7zSfAXOuOuWuLI3vbsUhc94=; b=OZQpw3H3FPW1lSz8DrlBNnRJaYPbYB/huKWy1GNL8kOhHiswJkIVbD2IIw2ub0tBhENylvqRcYvuIKPbvP/s1LgXPfW9OYEy8v+nHf+GA5mHblFyFSKd6XHZvb1qSTPO2O3xMyPgbNRlMS0gHrCRKEDf7KSY5rHg/eLCNF8KB1czvPhpIxnyGR1KdwyzzJjJ6O8h1ylYP/qqcO2VrR8dMNroxQKtt/4RB/v4FyQUVPSBJndyG1/nIcd1dC4WexabMrnfepED4VmhDPV75by8sLvKv0k2s8fCgvkVmKXHOrj3ZQxUoZxveEYCYbioDRoFsaELCiCbiAHtR5YhV43EPQ== 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 DB9PR04MB9702.eurprd04.prod.outlook.com (2603:10a6:10:301::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8026.23; Wed, 9 Oct 2024 05:07:31 +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.8048.013; Wed, 9 Oct 2024 05:07:31 +0000 From: Gagandeep Singh To: dev@dpdk.org, Hemant Agrawal Cc: Jun Yang Subject: [v2] crypto/dpaa2_sec: rework debug code Date: Wed, 9 Oct 2024 10:37:16 +0530 Message-Id: <20241009050716.2007024-1-g.singh@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241007084354.852733-1-g.singh@nxp.com> References: <20241007084354.852733-1-g.singh@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SI1PR02CA0060.apcprd02.prod.outlook.com (2603:1096:4:1f5::17) To AS8PR04MB8198.eurprd04.prod.outlook.com (2603:10a6:20b:3b0::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB8198:EE_|DB9PR04MB9702:EE_ X-MS-Office365-Filtering-Correlation-Id: 75d1e124-8f32-4da8-a4a2-08dce8204766 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?Tc3e+oBvP9Loq63PUl8XbIk84AEL/GI+49E5Zq6NWwpYMOFNebQXTA4rFohV?= =?us-ascii?Q?heNeZpYVxcRX/dfOBHQ75Mbxucv9F8njbyUR4FmJksEDSb2I+ZGBbdtGIoH0?= =?us-ascii?Q?XzgRs7QrusoLIZge5C2RAf/WONv5a4DEEJJl9pjXF3/Lrnr0rKvplwdHpzkt?= =?us-ascii?Q?PPFJ8a0+0TIOhiQyWOXLwftrmg1XVq6si3W/4BmewtC0twBzczVxLNqVkoJ6?= =?us-ascii?Q?lelIxoh0L3m3S2ipLyRbrrxRncmLBZGsgPE8veYnYrGLp6zMwx+8J4hIybd1?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CEecvNQlPKgaKkAUlG/DxaO?= =?us-ascii?Q?+TRdozxaTmCeL9REkJFBi9Lj2S5bCboqe09UI1PSEINmeQf0fFOcT4QJdlG4?= =?us-ascii?Q?6eT0ZSMZAVI/OmqFiMTlLWuVoP6a9rEEZ3bMhDRMUAV9QAhsCobiPLhE68bR?= =?us-ascii?Q?2Qqw1ytmiit0cvrZhnk3OPbixb1vFqyQfgozK3oudVvVxQ=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)(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?xYeW1OIcuYV0mpHcYhhnjJSNnEod3P8TkkRCfEYpQSDO1VwPrHUp1WOMo3hC?= =?us-ascii?Q?908YmODoKAoxzgSceEi5Xmqe183suEpGB7mw0Bh6FFlfiojdpZia+/4U18PV?= =?us-ascii?Q?zoBNA+pZaS9CtNUin2s5sjfihF8xSwsYnY0pEwj/6tIRKycQvWoyXE2BdqvM?= =?us-ascii?Q?j7m5Owxuiyq+D6rxbC7fptAMBUNzs9y2XTSGeO7Q70uuouuC+sPqrWh8slDf?= =?us-ascii?Q?QjCxjs1clYIl6lQMrrvcoqaF/+Xhq0+yzz3dQ2VdRH27gb2rilHVMtRM2f6O?= =?us-ascii?Q?ecTI/095jWLilohjLN6v/OKABWoUkGHACXl5xtlfx8Ey3lg1qikBjvR5UCb6?= =?us-ascii?Q?vzPHVFmkbHLxpCk7+uFsGLdCV5j8Ntf1Ol2XSqKkmQUsz8il6ZroPYwPCNrd?= =?us-ascii?Q?lTRvVvyEZJm3C5lADP8PEZvObeMhwbV81XyxWiKKWXyuhMPD5eVHGhCl1wUB?= =?us-ascii?Q?ShRCo+xF5H4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?= =?us-ascii?Q?SaA+BKcRmqtcMUWLa78UIHXnQPTnZQpoim/Z/piY9pUZGE8yrOYDfBFdFP68?= =?us-ascii?Q?A6uP77JPXPIWOAa/Ue9BdG0w8qjSr/CDduy8kQWfPh6oNEcZvWijmjhRuUo/?= =?us-ascii?Q?o2OaQABc0t8xhRbY/syUkl72JMY9PzLFjBN0W54jNwnUq/vmqKuSEc40uH7Y?= =?us-ascii?Q?9mBbtcUEAxs8MQRa3WA=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 75d1e124-8f32-4da8-a4a2-08dce8204766 X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8198.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Oct 2024 05:07:31.6087 (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: kszaq9q/VCDLpnkA8TUdOsb1SaHCT371KSplozSfSEF1iQBUAL44y6ooRnApkV2X X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB9702 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 | 72 +++++++++++++-------- 1 file changed, 46 insertions(+), 26 deletions(-) diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c index 2cdf9308f8..0c96ca0023 100644 --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c @@ -65,6 +65,47 @@ enum dpaa2_sec_dump_levels { uint8_t cryptodev_driver_id; uint8_t dpaa2_sec_dp_dump = DPAA2_SEC_DP_ERR_DUMP; +static inline void +dpaa2_sec_dp_fd_dump(const struct qbman_fd *fd, uint16_t bpid, + struct rte_mbuf *mbuf, bool tx) +{ +#if (RTE_LOG_DEBUG <= RTE_LOG_DP_LEVEL) + char debug_str[1024]; + int offset; + + if (tx) { + offset = sprintf(debug_str, + "CIPHER SG: fdaddr =%" PRIx64 ", from %s pool ", + DPAA2_GET_FD_ADDR(fd), + bpid < MAX_BPID ? "SW" : "BMAN"); + if (bpid < MAX_BPID) { + offset += sprintf(&debug_str[offset], + "bpid = %d ", bpid); + } + } else { + offset = sprintf(debug_str, "Mbuf %p from %s pool ", + mbuf, 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 ", + mbuf->pool->private_data_size); + offset += sprintf(&debug_str[offset], + "addr %p, fdaddr =%" PRIx64 ", off =%d, len =%d", + mbuf->buf_addr, DPAA2_GET_FD_ADDR(fd), + DPAA2_GET_FD_OFFSET(fd), DPAA2_GET_FD_LEN(fd)); + DPAA2_SEC_DP_DEBUG("%s", debug_str); +#else + RTE_SET_USED(bpid); + RTE_SET_USED(tx); + RTE_SET_USED(mbuf); + RTE_SET_USED(fd); +#endif +} + static inline void free_fle(const struct qbman_fd *fd, struct dpaa2_sec_qp *qp) { @@ -1097,7 +1138,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; @@ -1212,14 +1253,8 @@ 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", - 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)); + dpaa2_sec_dp_fd_dump(fd, bpid, mbuf, true); + return 0; } @@ -1326,14 +1361,7 @@ 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", - 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)); + dpaa2_sec_dp_fd_dump(fd, bpid, dst, true); return 0; } @@ -1604,15 +1632,7 @@ 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)); + dpaa2_sec_dp_fd_dump(fd, 0, dst, false); /* free the fle memory */ if (likely(rte_pktmbuf_is_contiguous(src))) { -- 2.25.1