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 A8839A00BE; Mon, 20 Dec 2021 11:28:17 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1470840E01; Mon, 20 Dec 2021 11:27:53 +0100 (CET) Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00089.outbound.protection.outlook.com [40.107.0.89]) by mails.dpdk.org (Postfix) with ESMTP id 66D574114A for ; Mon, 20 Dec 2021 11:27:51 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hX13bleKVthkivsuddr1wla46ex4yqYlJbSHVTJH9AthVd/O296hS/M/LEzAtHBbpPSkUS2SR1ub4ISyvXU55Jfr+AKjBUte503zNOvgvvT2PLEEhQ7FOi7SEiN3D+h6iTL9GCZNLDRZAEffX0VUYh4WHu4BnMbGMjp7QFj4lfb/a+Hg2B/UK27fxw5CQRE9uyGZEWaIJuquOk/F94IrSFnUZNIyvDEK2z2WYLX6SvSmE4CXaWG4bsEhri6osPahRf70ClKX1+ykg5F0HfMN9Mb43g8vAWPlpay+7tO/zlyvsxU2rPk9o7+uPijmQYLIiv5H7OgqHVnAYLq6ErgW2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=EZdaEAD3zkoCmpwnuF86FXlC5LrhZ+N7jZXVB8V6myc=; b=USA9qg215t2YnTqarBF/v36tfGc1c+NHoOAFxDFdxK7EGr+loIp5LtsszM7go6yRPsgfu9dqkOuEKHaxD+cPqIYx1TR2x/9l/2xagrfq6CyMO7VaTb6gHjNZuNBAigTCaLTBRFnbdTVfMvcS02h1p3HQWwQvT/h3qMkrR7SuG/61NxbId9RQsgS6s73sEMwzsFQ1G3GuqeMKq/a/ZWdH4+ZxLMYzwRTR/OztxcCbQaM90WzPhY+cadY7izAzIlCiL/2rFMZUiMRbVfDMnUcflsq5JFjcCk/+qUKpAHtQPMvD8jola230VSqSMCzcA5+nJrY2XpwbursG0zJ8RkjALA== 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=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=EZdaEAD3zkoCmpwnuF86FXlC5LrhZ+N7jZXVB8V6myc=; b=KM2uCLu58yUj/KCqsamCY/pzLYaOyfQA3xnl+sBnlqshbfNvkGarOKjIXFrDxsmAl/HQtXBWTC9KbB67b2cfyk9En1anEO9jNuCs1AUeYlJfa4JCiU6Uki6ywajinuF0xE3SxOsGrnlJG46jr6tifIsANZ7fQYoiDTqh/vesWVM= 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 AM6PR0402MB3703.eurprd04.prod.outlook.com (2603:10a6:209:19::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4801.20; Mon, 20 Dec 2021 10:27:49 +0000 Received: from AS8PR04MB8198.eurprd04.prod.outlook.com ([fe80::71ab:27ce:856d:5aac]) by AS8PR04MB8198.eurprd04.prod.outlook.com ([fe80::71ab:27ce:856d:5aac%4]) with mapi id 15.20.4801.020; Mon, 20 Dec 2021 10:27:49 +0000 From: Gagandeep Singh To: gakhil@marvell.com, dev@dpdk.org Cc: Gagandeep Singh Subject: [PATCH 6/8] crypto/dpaa2_sec: add useful debug prints in sec dequeue Date: Mon, 20 Dec 2021 15:57:08 +0530 Message-Id: <20211220102710.3083370-6-g.singh@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211220102710.3083370-1-g.singh@nxp.com> References: <20211220102710.3083370-1-g.singh@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SG2PR06CA0205.apcprd06.prod.outlook.com (2603:1096:4:68::13) To AS8PR04MB8198.eurprd04.prod.outlook.com (2603:10a6:20b:3b0::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2d5f91cf-49aa-4232-82d4-08d9c3a35f00 X-MS-TrafficTypeDiagnostic: AM6PR0402MB3703:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:883; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: O26GcElAVJesyihkj7sn/GnR6MyZgihqvBrsU7I8RCwziHsr/ZdJ6QBlhwfbs3XxH71uvCy8mm0YmxL1kaXvtcEHMXxf2IZeMdUl1sCLsTQmn8Iqa3MMzyeWV1P6iioS3qy4OY56VucSo3oD4/YQHJ7XPvFgD0xZYk6i8huvXrmWKYUtcF60uKTLvAx+sRNrEOCtBQ5Zwt4bdVZhlGPdKW9Q5XIhUmtLrMOdJJxWcFB5vSDZZe7rxmz3I1jILLP2VPqwmfOSYJMTg2LXKuSt4atZnWuafYkvA0qAwT+Xr5zW89+KvmXLUYFntiiTummnrgw4e+QvETRfWLGWNeP3HPZUe/9AG2yfYc2rc8TjvIc4CvSh6xXwrjyYFK5JxUn5qvkwDDu2i6S1jHGUSXxzg0h4qPkB4hqizI4vBPnLVTs9ENh38qg+DUHdgNpaUUDaoBYNLIbbn2d42EBEL5TXAefBfpbc7scehrEeX9geX/Bjk6YbbqPhkziwh3dPKmmh4fV1OzXH0yaQwi2ifnNfJkPPk8BuGjbZpMoJ4nhCKRqUrziFb0VGCCSNTdwc9hujdvYfT1rJLs4YJSzbhqIUbN+26RkDwG6ayWg5NugGudFJMeF3zzm7hwTpm37w9Iu6PYoh/b3lR2AZrKTeObN551TX7FmcEBFsOFhFYDixorfbKHI9U7F8H9zsvTBkoLW9sB0VUbXjJgnOXMfHvXWY3A== 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:(4636009)(366004)(83380400001)(5660300002)(38350700002)(8676002)(6666004)(38100700002)(316002)(55236004)(66556008)(186003)(66476007)(66946007)(2906002)(52116002)(26005)(6506007)(8936002)(86362001)(4326008)(6486002)(1076003)(2616005)(6512007)(508600001)(36756003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?6iDThJn0Rtyo8aYjIQWj3EPm9UUiVKW6SNWpSUb+qS0uV4WwZALqwU9eV1Hs?= =?us-ascii?Q?/8mVrWsnMHhGAheXf+QVkc+fyXlo0NrG6gdFq6tiTmgRFfOseqHvthTpLOjV?= =?us-ascii?Q?osL8EMjacmrPjpKGOo0o69liZKYNAHKN9BmzX6m98ueGfP+AnxvQ5WsLjVHv?= =?us-ascii?Q?1YC/lKxvSuL3koC0px7Luw17j/Calx9hrflviqQlxJEY/vp0xEVc1gcZAk0w?= =?us-ascii?Q?2HxQYKj0jlpXmHhbFdWjktN9HA/NMe2iGeYTK6rj4g0cq/m2p6lXaHh/hBS8?= =?us-ascii?Q?xxJeFKwTYqc/wQMXW+25qb3SLDeJbKtwSSQ/84op8ko6qJbT8IvskfkhlyYH?= =?us-ascii?Q?W0YwCgIupnEdiCVrsgBOgncRtYt4p97hlqMN/KRQzMNgjuLLgNj2CGE8vwL7?= =?us-ascii?Q?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vXRL?= =?us-ascii?Q?l9CElA2WffGHkX/7lFjTtzkoC7b/7OD7+mt0tj4yl0pnwB4M4hDdI4SYeaJ8?= =?us-ascii?Q?D0GZ2iKsfCgo2kuBptupfAUiu59Jk/QyvQ570hCzL5tvCnBHwa3FKts4D/qX?= =?us-ascii?Q?5C6nNCZMwfCiI/TJ/UjyVdzDqT30EuCMIIqAz0vvogItwOgiztSk8a8g3vPj?= =?us-ascii?Q?Db3Ik6X1TDPWyw0i+8hkmafFsrRHpXRRx2K5DtJq0JoUbnlqSAXsYJczcugl?= =?us-ascii?Q?1ychmp8NbRBnB1LO8bE=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2d5f91cf-49aa-4232-82d4-08d9c3a35f00 X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8198.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Dec 2021 10:27:49.4964 (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: 5S1ETSSr3nuGHOmqYHOwFxd/xku9PvB5jdxozjwCuaoeFXUl4v1Pu/oYyIYg/ifI X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR0402MB3703 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 Few useful debug prints added in dequeue function. Signed-off-by: Gagandeep Singh --- drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 105 +++++++++++++++++++- 1 file changed, 103 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c index 99f5157abe..b1ad66d2cb 100644 --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c @@ -28,6 +28,7 @@ #include #include #include +#include #include "dpaa2_sec_priv.h" #include "dpaa2_sec_event.h" @@ -50,7 +51,15 @@ #define NO_PREFETCH 0 +/* DPAA2_SEC_DP_DUMP levels */ +enum dpaa2_sec_dump_levels { + DPAA2_SEC_DP_NO_DUMP, + DPAA2_SEC_DP_ERR_DUMP, + DPAA2_SEC_DP_FULL_DUMP +}; + uint8_t cryptodev_driver_id; +uint8_t dpaa2_sec_dp_dump = DPAA2_SEC_DP_ERR_DUMP; #ifdef RTE_LIB_SECURITY static inline int @@ -1784,6 +1793,83 @@ dpaa2_sec_enqueue_burst_ordered(void *qp, struct rte_crypto_op **ops, return num_tx; } +static void +dpaa2_sec_dump(struct rte_crypto_op *op) +{ + int i; + dpaa2_sec_session *sess = NULL; + struct ctxt_priv *priv; + uint8_t bufsize; + struct rte_crypto_sym_op *sym_op; + + if (op->sess_type == RTE_CRYPTO_OP_WITH_SESSION) + sess = (dpaa2_sec_session *)get_sym_session_private_data( + op->sym->session, cryptodev_driver_id); +#ifdef RTE_LIBRTE_SECURITY + else if (op->sess_type == RTE_CRYPTO_OP_SECURITY_SESSION) + sess = (dpaa2_sec_session *)get_sec_session_private_data( + op->sym->sec_session); +#endif + + if (sess == NULL) + goto mbuf_dump; + + priv = (struct ctxt_priv *)sess->ctxt; + printf("\n****************************************\n" + "session params:\n\tContext type:\t%d\n\tDirection:\t%s\n" + "\tCipher alg:\t%d\n\tAuth alg:\t%d\n\tAead alg:\t%d\n" + "\tCipher key len:\t%zd\n", sess->ctxt_type, + (sess->dir == DIR_ENC) ? "DIR_ENC" : "DIR_DEC", + sess->cipher_alg, sess->auth_alg, sess->aead_alg, + sess->cipher_key.length); + rte_hexdump(stdout, "cipher key", sess->cipher_key.data, + sess->cipher_key.length); + rte_hexdump(stdout, "auth key", sess->auth_key.data, + sess->auth_key.length); + printf("\tAuth key len:\t%zd\n\tIV len:\t\t%d\n\tIV offset:\t%d\n" + "\tdigest length:\t%d\n\tstatus:\t\t%d\n\taead auth only" + " len:\t%d\n\taead cipher text:\t%d\n", + sess->auth_key.length, sess->iv.length, sess->iv.offset, + sess->digest_length, sess->status, + sess->ext_params.aead_ctxt.auth_only_len, + sess->ext_params.aead_ctxt.auth_cipher_text); +#ifdef RTE_LIBRTE_SECURITY + printf("PDCP session params:\n" + "\tDomain:\t\t%d\n\tBearer:\t\t%d\n\tpkt_dir:\t%d\n\thfn_ovd:" + "\t%d\n\tsn_size:\t%d\n\thfn_ovd_offset:\t%d\n\thfn:\t\t%d\n" + "\thfn_threshold:\t0x%x\n", sess->pdcp.domain, + sess->pdcp.bearer, sess->pdcp.pkt_dir, sess->pdcp.hfn_ovd, + sess->pdcp.sn_size, sess->pdcp.hfn_ovd_offset, sess->pdcp.hfn, + sess->pdcp.hfn_threshold); + +#endif + bufsize = (uint8_t)priv->flc_desc[0].flc.word1_sdl; + printf("Descriptor Dump:\n"); + for (i = 0; i < bufsize; i++) + printf("\tDESC[%d]:0x%x\n", i, priv->flc_desc[0].desc[i]); + + printf("\n"); +mbuf_dump: + sym_op = op->sym; + if (sym_op->m_src) { + printf("Source mbuf:\n"); + rte_pktmbuf_dump(stdout, sym_op->m_src, sym_op->m_src->data_len); + } + if (sym_op->m_dst) { + printf("Destination mbuf:\n"); + rte_pktmbuf_dump(stdout, sym_op->m_dst, sym_op->m_dst->data_len); + } + + printf("Session address = %p\ncipher offset: %d, length: %d\n" + "auth offset: %d, length: %d\n aead offset: %d, length: %d\n" + , sym_op->session, + sym_op->cipher.data.offset, sym_op->cipher.data.length, + sym_op->auth.data.offset, sym_op->auth.data.length, + sym_op->aead.data.offset, sym_op->aead.data.length); + printf("\n"); + +} + static uint16_t dpaa2_sec_dequeue_burst(void *qp, struct rte_crypto_op **ops, uint16_t nb_ops) @@ -1865,8 +1951,13 @@ dpaa2_sec_dequeue_burst(void *qp, struct rte_crypto_op **ops, if (unlikely(fd->simple.frc)) { /* TODO Parse SEC errors */ - DPAA2_SEC_DP_ERR("SEC returned Error - %x\n", - fd->simple.frc); + if (dpaa2_sec_dp_dump > DPAA2_SEC_DP_NO_DUMP) { + DPAA2_SEC_DP_ERR("SEC returned Error - %x\n", + fd->simple.frc); + if (dpaa2_sec_dp_dump > DPAA2_SEC_DP_ERR_DUMP) + dpaa2_sec_dump(ops[num_rx]); + } + dpaa2_qp->rx_vq.err_pkts += 1; ops[num_rx]->status = RTE_CRYPTO_OP_STATUS_ERROR; } else { @@ -4233,6 +4324,16 @@ dpaa2_sec_dev_init(struct rte_cryptodev *cryptodev) goto init_error; } + if (getenv("DPAA2_SEC_DP_DUMP_LEVEL")) { + dpaa2_sec_dp_dump = + atoi(getenv("DPAA2_SEC_DP_DUMP_LEVEL")); + if (dpaa2_sec_dp_dump > DPAA2_SEC_DP_FULL_DUMP) { + printf("WARN: DPAA2_SEC_DP_DUMP_LEVEL is not " + "supported, changing to FULL error prints\n"); + dpaa2_sec_dp_dump = DPAA2_SEC_DP_FULL_DUMP; + } + } + DPAA2_SEC_INFO("driver %s: created", cryptodev->data->name); return 0; -- 2.25.1