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 A269F45549; Tue, 2 Jul 2024 12:40:35 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 97A1240ED1; Tue, 2 Jul 2024 12:40:32 +0200 (CEST) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2050.outbound.protection.outlook.com [40.107.20.50]) by mails.dpdk.org (Postfix) with ESMTP id 701F140DD3 for ; Tue, 2 Jul 2024 12:40:31 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=f46ISW2N+NZIIAiG96DOiMICFx6iAsFToHeZ/K8J8F0nsVb9pQil/GuHyJHqrKmT3QEzbTaJ4pVWHVfXXmSHlvnaBmrMB+jHTkDIYjT6YPqWK29F+BWL6B0l2NEKnYdw//22SsAJ25xNM/oVBuvJKidRETFejyaI648ysLjYL8fC962TQTLMa665RXqKuUnr4Jwe1HVNcBXvLkzfjrdzaXxKI20v1R7YXvI4pX7moehj3k6M9d+c98641yVJta+bAntQyh/fKn8MjLvAOGLgmLtCxhChCXv37gXiUWgX1rsJ9BM2H3J5eq41R3tKE0GqXQB0ychYIfmVU4jUzXgK6A== 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=70PEK80vHaQKEzHmcREfivPslip39BQ0nX12pBKQzeo=; b=Wnk6HoRVEjbXQqEgnDDHmPtHh0x7ACmZF9xsoX6PuiDmJYiWuSppqwLItTBKqlyTjH+4j7uNXtCX/Qt/vo+6ZVmdujrSpzulGUAeL3qsIvEn1lZvowvOEwNENlW9BELQOJcpNhT4G81TpkYQkQXrFIkgVjMhdDBJ9F7NuL/7Xv4CDwbVywCfHQMiMr38ZsjGUrqCu60V9Qo/jWs9FsO2Dmxi0eJLdDjZCm1wANUR3UoTq7wkxNAGZBq9q9TWC2cb6Bjon1GPaMsLvNZYxcvSi5ZIpf2/vwWczn7Wx+yOIsiDxEpy871yResfDwlHbWhZn231oFaMNWH4LWrtKLSEhw== 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=70PEK80vHaQKEzHmcREfivPslip39BQ0nX12pBKQzeo=; b=RV4ngo2K+7wS0MskmbMaNnffM1PlTfjhxygQfrS/qZgaxfO5txy67NrFu40HgVg/t6SDm9oiatuVfuqhEG6JBR3w80VMFp3ayAPczQQBZYMe25y/3JZX9QsRZmDzjB9XvwvNWqedCs0en9e1eyaBBANtmkB7OldbINc8AfZRKA8= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB9328.eurprd04.prod.outlook.com (2603:10a6:102:2b6::15) by PA2PR04MB10423.eurprd04.prod.outlook.com (2603:10a6:102:41c::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7719.29; Tue, 2 Jul 2024 10:40:30 +0000 Received: from PAXPR04MB9328.eurprd04.prod.outlook.com ([fe80::367:d59:375:fb87]) by PAXPR04MB9328.eurprd04.prod.outlook.com ([fe80::367:d59:375:fb87%4]) with mapi id 15.20.7719.028; Tue, 2 Jul 2024 10:40:30 +0000 From: Hemant Agrawal To: dev@dpdk.org, thomas@monjalon.net, stephen@networkplumber.org, david.marchand@redhat.com Subject: [PATCH v2 2/2] drivers: replace printf with fprintf for debug functions Date: Tue, 2 Jul 2024 16:10:13 +0530 Message-Id: <20240702104013.3813272-2-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240702104013.3813272-1-hemant.agrawal@nxp.com> References: <20230215102905.22767-1-hemant.agrawal@nxp.com> <20240702104013.3813272-1-hemant.agrawal@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SI2PR01CA0033.apcprd01.prod.exchangelabs.com (2603:1096:4:192::23) To PAXPR04MB9328.eurprd04.prod.outlook.com (2603:10a6:102:2b6::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9328:EE_|PA2PR04MB10423:EE_ X-MS-Office365-Filtering-Correlation-Id: 8ab64685-8e8c-4929-d5bd-08dc9a8364a9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|366016|376014|52116014|38350700014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?LNcU/utp3GVnCNRVJ11/O5KhxKTFJ3ojRjUx6t/TuAjURfT+cCpcyg5DSHLW?= =?us-ascii?Q?JxyKE58Uy1E7rWb1rvSmTqJYfhH1SlC+Cu4pgPHmCUI6MpOypY+yXOJYX4/r?= =?us-ascii?Q?d/KEPnk6qiRu8UxtWATzB7Hz79zvlDdpYFeup01JT8VyLaq7aSAnUhO9QT1L?= =?us-ascii?Q?4SFqBuvVDAg32CfU0i1pomoqBv7zFQRJN4p8MIWO8++8rwURd5rcLhF612Ff?= =?us-ascii?Q?eUw/f3tw/KlmVQn3G3aGZqMh8YtYkbu9O1RUJ+hDTUs9z33VbRa+i2F56qot?= =?us-ascii?Q?oFLwwcU+IcGlYJVf3LXjhcuzVLnLnE4KAsFjMvXdS0pVUBrgF6ruD9Rn0YRG?= =?us-ascii?Q?GJZGzkiALBlCgGx7XN3I5Fw22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9I8+T+BYVy+rgP7LY+LGH7gZ2HZTacrGOV5bb7TiqPBbFA1OvzvmumPAa7Q?= =?us-ascii?Q?U+v89+T5o20F0+2IvHELmM0UyepgDZKJEw6IPEk8Apv8m/o38AxqB2IwGbDD?= =?us-ascii?Q?tTR/ZZPMgoG5rESOUK8XFIo2QJgZquSWDmx4eM5o4JN+w6tQ4A=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PAXPR04MB9328.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(366016)(376014)(52116014)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?bT+MThNMOrOxf6XxDUml/j25EdNEj6rc31Fpbuo6sbUNONEcHsLk1doO7P5J?= =?us-ascii?Q?pLRHCQYXDyVppRUdrnAXWp9g753gwC0xQebVdgdbfdeWm7J6upcKz4boO9rg?= =?us-ascii?Q?YxzaZ/GZoRDo1ls0FVpFFHe9lddFVAsle0JxFTr8kwCcgrl2ewmt5ioavNZY?= =?us-ascii?Q?y1It5uhqZvjC9AyJ6gTSrPQ89Uqmo3pbtHdooKt1kYnhp8h11OEzUnP8tAp1?= =?us-ascii?Q?j7kZ4Dic7dbfA8aXo0guVipjmK9oZdlz503vLzDPfj9JUOGv4BAqx+aZqEwP?= =?us-ascii?Q?TuI0iQMDficE36t0fE4WZJR/k+W6rpdS36EyJBASJ5upzACDf2m9L7FyVvC2?= =?us-ascii?Q?kloFS/KuR0dX0NKgo5bkMy19VKUZ/oHwkGW5k+wrnz+sPKoSGu4tdM9i0h3R?= =?us-ascii?Q?C+y004pFHEMDgZPdBxI6TZKfdQgJfa5fipZLH3WgIZfLjMTEzJCX8caXnQjl?= =?us-ascii?Q?KtmDQo+P9b2gTfBvd8jPTfkMNv/k8JtvpNKG5Jmur0pq5Y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u5LoxhtjD/4sy3hdNbSFD/mw5xMWq34vI2ShIq6mTTTi9?= =?us-ascii?Q?1P81045GcfZqdoHP90rvbErHWy80G++PaTp0E2PaaogWBZZRXw6ONv3aLvWa?= =?us-ascii?Q?lnx1bkiadcZgcU+3dwQF5phL7CSgufSJdWm6tgO5N9z/r8qPzlv2hbj5K+PD?= =?us-ascii?Q?6HPcEhrB9cC8//JeuelQqa/RHsDCoRu+kiLWhuK9SkdzqlaPzznPXvGan/WO?= =?us-ascii?Q?Qg=3D=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8ab64685-8e8c-4929-d5bd-08dc9a8364a9 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9328.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Jul 2024 10:40:30.2436 (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: mDVfo5eBDe6u2KSo9cZXsPeU8wstIMwJVougvhd4lO1EOs6dmn911YlkCwdBZzBhnXs9m9QCdxaRP/5auwiakw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA2PR04MB10423 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 This patch replaces simple printf with fprintf for debug dump related functions for various NXP dpaaX related drivers. Signed-off-by: Hemant Agrawal --- drivers/bus/dpaa/base/fman/netcfg_layer.c | 22 +++---- drivers/bus/dpaa/dpaa_bus.c | 2 +- drivers/bus/dpaa/include/netcfg.h | 2 +- drivers/crypto/caam_jr/caam_jr.c | 6 +- drivers/crypto/caam_jr/caam_jr_desc.h | 4 +- drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 32 +++++----- drivers/crypto/dpaa_sec/dpaa_sec.c | 62 +++++++++---------- drivers/net/dpaa2/dpaa2_flow.c | 66 +++++++++++---------- 8 files changed, 99 insertions(+), 97 deletions(-) diff --git a/drivers/bus/dpaa/base/fman/netcfg_layer.c b/drivers/bus/dpaa/base/fman/netcfg_layer.c index 6a405c984d..57d87afcb0 100644 --- a/drivers/bus/dpaa/base/fman/netcfg_layer.c +++ b/drivers/bus/dpaa/base/fman/netcfg_layer.c @@ -29,37 +29,37 @@ static int skfd = -1; #ifdef RTE_LIBRTE_DPAA_DEBUG_DRIVER void -dump_netcfg(struct netcfg_info *cfg_ptr) +dump_netcfg(struct netcfg_info *cfg_ptr, FILE *f) { int i; - printf(".......... DPAA Configuration ..........\n\n"); + fprintf(f, ".......... DPAA Configuration ..........\n\n"); /* Network interfaces */ - printf("Network interfaces: %d\n", cfg_ptr->num_ethports); + fprintf(f, "Network interfaces: %d\n", cfg_ptr->num_ethports); for (i = 0; i < cfg_ptr->num_ethports; i++) { struct fman_if_bpool *bpool; struct fm_eth_port_cfg *p_cfg = &cfg_ptr->port_cfg[i]; struct fman_if *__if = p_cfg->fman_if; - printf("\n+ Fman %d, MAC %d (%s);\n", + fprintf(f, "\n+ Fman %d, MAC %d (%s);\n", __if->fman_idx, __if->mac_idx, (__if->mac_type == fman_mac_1g) ? "1G" : (__if->mac_type == fman_mac_2_5g) ? "2.5G" : "10G"); - printf("\tmac_addr: " RTE_ETHER_ADDR_PRT_FMT "\n", + fprintf(f, "\tmac_addr: " RTE_ETHER_ADDR_PRT_FMT "\n", RTE_ETHER_ADDR_BYTES(&__if->mac_addr)); - printf("\ttx_channel_id: 0x%02x\n", + fprintf(f, "\ttx_channel_id: 0x%02x\n", __if->tx_channel_id); - printf("\tfqid_rx_def: 0x%x\n", p_cfg->rx_def); - printf("\tfqid_rx_err: 0x%x\n", __if->fqid_rx_err); + fprintf(f, "\tfqid_rx_def: 0x%x\n", p_cfg->rx_def); + fprintf(f, "\tfqid_rx_err: 0x%x\n", __if->fqid_rx_err); - printf("\tfqid_tx_err: 0x%x\n", __if->fqid_tx_err); - printf("\tfqid_tx_confirm: 0x%x\n", __if->fqid_tx_confirm); + fprintf(f, "\tfqid_tx_err: 0x%x\n", __if->fqid_tx_err); + fprintf(f, "\tfqid_tx_confirm: 0x%x\n", __if->fqid_tx_confirm); fman_if_for_each_bpool(bpool, __if) - printf("\tbuffer pool: (bpid=%d, count=%"PRId64 + fprintf(f, "\tbuffer pool: (bpid=%d, count=%"PRId64 " size=%"PRId64", addr=0x%"PRIx64")\n", bpool->bpid, bpool->count, bpool->size, bpool->addr); diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c index 5d4352bb3c..7e5d713bb9 100644 --- a/drivers/bus/dpaa/dpaa_bus.c +++ b/drivers/bus/dpaa/dpaa_bus.c @@ -586,7 +586,7 @@ rte_dpaa_bus_dev_build(void) } #ifdef RTE_LIBRTE_DPAA_DEBUG_DRIVER - dump_netcfg(dpaa_netcfg); + dump_netcfg(dpaa_netcfg, stdout); #endif DPAA_BUS_LOG(DEBUG, "Number of ethernet devices = %d", diff --git a/drivers/bus/dpaa/include/netcfg.h b/drivers/bus/dpaa/include/netcfg.h index 5bdcc9186a..ebbbaf6d10 100644 --- a/drivers/bus/dpaa/include/netcfg.h +++ b/drivers/bus/dpaa/include/netcfg.h @@ -60,7 +60,7 @@ void netcfg_release(struct netcfg_info *cfg_ptr); /* cfg_ptr: configuration information pointer. * This function dumps configuration data to stdout. */ -void dump_netcfg(struct netcfg_info *cfg_ptr); +void dump_netcfg(struct netcfg_info *cfg_ptr, FILE *f); #endif #endif /* __NETCFG_H */ diff --git a/drivers/crypto/caam_jr/caam_jr.c b/drivers/crypto/caam_jr/caam_jr.c index ab06fab387..ea474a079f 100644 --- a/drivers/crypto/caam_jr/caam_jr.c +++ b/drivers/crypto/caam_jr/caam_jr.c @@ -461,7 +461,7 @@ caam_jr_prep_cdb(struct caam_jr_session *ses) } #if CAAM_JR_DBG - SEC_DUMP_DESC(cdb->sh_desc); + SEC_DUMP_DESC(cdb->sh_desc, stdout); #endif cdb->sh_hdr.hi.field.idlen = shared_desc_len; @@ -1410,9 +1410,9 @@ caam_jr_enqueue_op(struct rte_crypto_op *op, struct caam_jr_qp *qp) rte_pktmbuf_mtod(op->sym->m_src, void *), rte_pktmbuf_data_len(op->sym->m_src)); - printf("\n JD before conversion\n"); + fprintf(stdout, "\n JD before conversion\n"); for (i = 0; i < 12; i++) - printf("\n 0x%08x", ctx->jobdes.desc[i]); + fprintf(stdout, "\n 0x%08x", ctx->jobdes.desc[i]); #endif CAAM_JR_DP_DEBUG("Jr[%p] pi[%d] ci[%d].Before sending desc", diff --git a/drivers/crypto/caam_jr/caam_jr_desc.h b/drivers/crypto/caam_jr/caam_jr_desc.h index c85278bf1e..a4507613be 100644 --- a/drivers/crypto/caam_jr/caam_jr_desc.h +++ b/drivers/crypto/caam_jr/caam_jr_desc.h @@ -110,13 +110,13 @@ ((struct descriptor_header_s *)(descriptor))->command.jd.desclen) /* Helper macro for dumping the hex representation of a descriptor */ -#define SEC_DUMP_DESC(descriptor) { \ +#define SEC_DUMP_DESC(descriptor, f) { \ int __i; \ CAAM_JR_INFO("Des@ 0x%08x\n", (uint32_t)((uint32_t *)(descriptor)));\ for (__i = 0; \ __i < SEC_GET_DESC_LEN(descriptor); \ __i++) { \ - printf("0x%08x: 0x%08x\n", \ + fprintf(f, "0x%08x: 0x%08x\n", \ (uint32_t)(((uint32_t *)(descriptor)) + __i), \ *(((uint32_t *)(descriptor)) + __i)); \ } \ diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c index 1cae6c4505..4c5b98d9be 100644 --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c @@ -1621,7 +1621,7 @@ sec_fd_to_mbuf(const struct qbman_fd *fd, struct dpaa2_sec_qp *qp) } static void -dpaa2_sec_dump(struct rte_crypto_op *op) +dpaa2_sec_dump(struct rte_crypto_op *op, FILE *f) { int i; dpaa2_sec_session *sess = NULL; @@ -1640,18 +1640,18 @@ dpaa2_sec_dump(struct rte_crypto_op *op) goto mbuf_dump; priv = (struct ctxt_priv *)sess->ctxt; - printf("\n****************************************\n" + fprintf(f, "\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, + rte_hexdump(f, "cipher key", sess->cipher_key.data, sess->cipher_key.length); - rte_hexdump(stdout, "auth key", sess->auth_key.data, + rte_hexdump(f, "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" + fprintf(f, "\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, @@ -1659,7 +1659,7 @@ dpaa2_sec_dump(struct rte_crypto_op *op) sess->ext_params.aead_ctxt.auth_only_len, sess->ext_params.aead_ctxt.auth_cipher_text); #ifdef RTE_LIB_SECURITY - printf("PDCP session params:\n" + fprintf(f, "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, @@ -1669,29 +1669,29 @@ dpaa2_sec_dump(struct rte_crypto_op *op) #endif bufsize = (uint8_t)priv->flc_desc[0].flc.word1_sdl; - printf("Descriptor Dump:\n"); + fprintf(f, "Descriptor Dump:\n"); for (i = 0; i < bufsize; i++) - printf("\tDESC[%d]:0x%x\n", i, priv->flc_desc[0].desc[i]); + fprintf(f, "\tDESC[%d]:0x%x\n", i, priv->flc_desc[0].desc[i]); - printf("\n"); + fprintf(f, "\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); + fprintf(f, "Source mbuf:\n"); + rte_pktmbuf_dump(f, 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); + fprintf(f, "Destination mbuf:\n"); + rte_pktmbuf_dump(f, sym_op->m_dst, sym_op->m_dst->data_len); } - printf("Session address = %p\ncipher offset: %d, length: %d\n" + fprintf(f, "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"); + fprintf(f, "\n"); } @@ -1951,7 +1951,7 @@ dpaa2_sec_dequeue_burst(void *qp, struct rte_crypto_op **ops, 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_sec_dump(ops[num_rx], stdout); } dpaa2_qp->rx_vq.err_pkts += 1; diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c index 44528eaf7f..7aa163330a 100644 --- a/drivers/crypto/dpaa_sec/dpaa_sec.c +++ b/drivers/crypto/dpaa_sec/dpaa_sec.c @@ -654,7 +654,7 @@ dpaa_sec_prep_cdb(dpaa_sec_session *ses) } static void -dpaa_sec_dump(struct dpaa_sec_op_ctx *ctx, struct dpaa_sec_qp *qp) +dpaa_sec_dump(struct dpaa_sec_op_ctx *ctx, struct dpaa_sec_qp *qp, FILE *f) { struct dpaa_sec_job *job = &ctx->job; struct rte_crypto_op *op = ctx->op; @@ -678,9 +678,9 @@ dpaa_sec_dump(struct dpaa_sec_op_ctx *ctx, struct dpaa_sec_qp *qp) cdb = &sess->cdb; rte_memcpy(&c_cdb, cdb, sizeof(struct sec_cdb)); #ifdef RTE_LIB_SECURITY - printf("\nsession protocol type = %d\n", sess->proto_alg); + fprintf(f, "\nsession protocol type = %d\n", sess->proto_alg); #endif - printf("\n****************************************\n" + fprintf(f, "\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%"PRIu64"\n\tCipher alg:\t%d\n" @@ -689,11 +689,11 @@ dpaa_sec_dump(struct dpaa_sec_op_ctx *ctx, struct dpaa_sec_qp *qp) sess->cipher_alg, sess->auth_alg, sess->aead_alg, (uint64_t)sess->cipher_key.length, sess->cipher_key.alg, sess->cipher_key.algmode); - rte_hexdump(stdout, "cipher key", sess->cipher_key.data, + rte_hexdump(f, "cipher key", sess->cipher_key.data, sess->cipher_key.length); - rte_hexdump(stdout, "auth key", sess->auth_key.data, + rte_hexdump(f, "auth key", sess->auth_key.data, sess->auth_key.length); - printf("\tAuth key len:\t%"PRIu64"\n\tAuth alg:\t%d\n" + fprintf(f, "\tAuth key len:\t%"PRIu64"\n\tAuth alg:\t%d\n" "\tAuth algmode:\t%d\n\tIV len:\t\t%d\n\tIV offset:\t%d\n" "\tdigest length:\t%d\n\tauth only len:\t\t%d\n" "\taead cipher text:\t%d\n", @@ -703,7 +703,7 @@ dpaa_sec_dump(struct dpaa_sec_op_ctx *ctx, struct dpaa_sec_qp *qp) sess->digest_length, sess->auth_only_len, sess->auth_cipher_text); #ifdef RTE_LIB_SECURITY - printf("PDCP session params:\n" + fprintf(f, "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\tsdap_enabled:\t%d\n\thfn_ovd_offset:" "\t%d\n\thfn:\t\t%d\n" @@ -717,63 +717,63 @@ dpaa_sec_dump(struct dpaa_sec_op_ctx *ctx, struct dpaa_sec_qp *qp) c_cdb.sh_hdr.lo.word = rte_be_to_cpu_32(c_cdb.sh_hdr.lo.word); bufsize = c_cdb.sh_hdr.hi.field.idlen; - printf("cdb = %p\n\n", cdb); - printf("Descriptor size = %d\n", bufsize); + fprintf(f, "cdb = %p\n\n", cdb); + fprintf(f, "Descriptor size = %d\n", bufsize); int m; for (m = 0; m < bufsize; m++) - printf("0x%x\n", rte_be_to_cpu_32(c_cdb.sh_desc[m])); + fprintf(f, "0x%x\n", rte_be_to_cpu_32(c_cdb.sh_desc[m])); - printf("\n"); + fprintf(f, "\n"); mbuf_dump: sym_op = op->sym; if (sym_op->m_src) { - printf("Source mbuf:\n"); - rte_pktmbuf_dump(stdout, sym_op->m_src, + fprintf(f, "Source mbuf:\n"); + rte_pktmbuf_dump(f, 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, + fprintf(f, "Destination mbuf:\n"); + rte_pktmbuf_dump(f, sym_op->m_dst, sym_op->m_dst->data_len); } - printf("Session address = %p\ncipher offset: %d, length: %d\n" + fprintf(f, "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"); + fprintf(f, "\n"); - printf("******************************************************\n"); - printf("ctx info:\n"); - printf("job->sg[0] output info:\n"); + fprintf(f, "******************************************************\n"); + fprintf(f, "ctx info:\n"); + fprintf(f, "job->sg[0] output info:\n"); memcpy(&sg[0], &job->sg[0], sizeof(sg[0])); - printf("\taddr = %"PRIx64",\n\tlen = %d,\n\tfinal = %d,\n\textension = %d" + fprintf(f, "\taddr = %"PRIx64",\n\tlen = %d,\n\tfinal = %d,\n\textension = %d" "\n\tbpid = %d\n\toffset = %d\n", (uint64_t)sg[0].addr, sg[0].length, sg[0].final, sg[0].extension, sg[0].bpid, sg[0].offset); - printf("\njob->sg[1] input info:\n"); + fprintf(f, "\njob->sg[1] input info:\n"); memcpy(&sg[1], &job->sg[1], sizeof(sg[1])); hw_sg_to_cpu(&sg[1]); - printf("\taddr = %"PRIx64",\n\tlen = %d,\n\tfinal = %d,\n\textension = %d" + fprintf(f, "\taddr = %"PRIx64",\n\tlen = %d,\n\tfinal = %d,\n\textension = %d" "\n\tbpid = %d\n\toffset = %d\n", (uint64_t)sg[1].addr, sg[1].length, sg[1].final, sg[1].extension, sg[1].bpid, sg[1].offset); - printf("\nctx pool addr = %p\n", ctx->ctx_pool); + fprintf(f, "\nctx pool addr = %p\n", ctx->ctx_pool); if (ctx->ctx_pool) - printf("ctx pool available counts = %d\n", + fprintf(f, "ctx pool available counts = %d\n", rte_mempool_avail_count(ctx->ctx_pool)); - printf("\nop pool addr = %p\n", op->mempool); + fprintf(f, "\nop pool addr = %p\n", op->mempool); if (op->mempool) - printf("op pool available counts = %d\n", + fprintf(f, "op pool available counts = %d\n", rte_mempool_avail_count(op->mempool)); - printf("********************************************************\n"); - printf("Queue data:\n"); - printf("\tFQID = 0x%x\n\tstate = %d\n\tnb_desc = %d\n" + fprintf(f, "********************************************************\n"); + fprintf(f, "Queue data:\n"); + fprintf(f, "\tFQID = 0x%x\n\tstate = %d\n\tnb_desc = %d\n" "\tctx_pool = %p\n\trx_pkts = %d\n\ttx_pkts" "= %d\n\trx_errs = %d\n\ttx_errs = %d\n\n", qp->outq.fqid, qp->outq.state, qp->outq.nb_desc, @@ -852,7 +852,7 @@ dpaa_sec_deq(struct dpaa_sec_qp *qp, struct rte_crypto_op **ops, int nb_ops) DPAA_SEC_DP_WARN("SEC return err:0x%x\n", ctx->fd_status); if (dpaa_sec_dp_dump > DPAA_SEC_DP_ERR_DUMP) - dpaa_sec_dump(ctx, qp); + dpaa_sec_dump(ctx, qp, stdout); } op->status = RTE_CRYPTO_OP_STATUS_ERROR; } diff --git a/drivers/net/dpaa2/dpaa2_flow.c b/drivers/net/dpaa2/dpaa2_flow.c index eec7e60650..6c7bac4d48 100644 --- a/drivers/net/dpaa2/dpaa2_flow.c +++ b/drivers/net/dpaa2/dpaa2_flow.c @@ -236,7 +236,7 @@ static inline void dpaa2_prot_field_string( } static inline void dpaa2_flow_qos_table_extracts_log( - const struct dpaa2_dev_priv *priv) + const struct dpaa2_dev_priv *priv, FILE *f) { int idx; char string[32]; @@ -244,7 +244,7 @@ static inline void dpaa2_flow_qos_table_extracts_log( if (!dpaa2_flow_control_log) return; - printf("Setup QoS table: number of extracts: %d\r\n", + fprintf(f, "Setup QoS table: number of extracts: %d\r\n", priv->extract.qos_key_extract.dpkg.num_extracts); for (idx = 0; idx < priv->extract.qos_key_extract.dpkg.num_extracts; idx++) { @@ -253,15 +253,15 @@ static inline void dpaa2_flow_qos_table_extracts_log( priv->extract.qos_key_extract.dpkg.extracts[idx] .extract.from_hdr.field, string); - printf("%s", string); + fprintf(f, "%s", string); if ((idx + 1) < priv->extract.qos_key_extract.dpkg.num_extracts) - printf(" / "); + fprintf(f, " / "); } - printf("\r\n"); + fprintf(f, "\r\n"); } static inline void dpaa2_flow_fs_table_extracts_log( - const struct dpaa2_dev_priv *priv, int tc_id) + const struct dpaa2_dev_priv *priv, int tc_id, FILE *f) { int idx; char string[32]; @@ -269,7 +269,7 @@ static inline void dpaa2_flow_fs_table_extracts_log( if (!dpaa2_flow_control_log) return; - printf("Setup FS table: number of extracts of TC[%d]: %d\r\n", + fprintf(f, "Setup FS table: number of extracts of TC[%d]: %d\r\n", tc_id, priv->extract.tc_key_extract[tc_id] .dpkg.num_extracts); for (idx = 0; idx < priv->extract.tc_key_extract[tc_id] @@ -279,16 +279,16 @@ static inline void dpaa2_flow_fs_table_extracts_log( priv->extract.tc_key_extract[tc_id].dpkg.extracts[idx] .extract.from_hdr.field, string); - printf("%s", string); + fprintf(f, "%s", string); if ((idx + 1) < priv->extract.tc_key_extract[tc_id] .dpkg.num_extracts) - printf(" / "); + fprintf(f, " / "); } - printf("\r\n"); + fprintf(f, "\r\n"); } static inline void dpaa2_flow_qos_entry_log( - const char *log_info, const struct rte_flow *flow, int qos_index) + const char *log_info, const struct rte_flow *flow, int qos_index, FILE *f) { int idx; uint8_t *key, *mask; @@ -296,27 +296,27 @@ static inline void dpaa2_flow_qos_entry_log( if (!dpaa2_flow_control_log) return; - printf("\r\n%s QoS entry[%d] for TC[%d], extracts size is %d\r\n", + fprintf(f, "\r\n%s QoS entry[%d] for TC[%d], extracts size is %d\r\n", log_info, qos_index, flow->tc_id, flow->qos_real_key_size); key = (uint8_t *)(size_t)flow->qos_rule.key_iova; mask = (uint8_t *)(size_t)flow->qos_rule.mask_iova; - printf("key:\r\n"); + fprintf(f, "key:\r\n"); for (idx = 0; idx < flow->qos_real_key_size; idx++) - printf("%02x ", key[idx]); + fprintf(f, "%02x ", key[idx]); - printf("\r\nmask:\r\n"); + fprintf(f, "\r\nmask:\r\n"); for (idx = 0; idx < flow->qos_real_key_size; idx++) - printf("%02x ", mask[idx]); + fprintf(f, "%02x ", mask[idx]); - printf("\r\n%s QoS ipsrc: %d, ipdst: %d\r\n", log_info, + fprintf(f, "\r\n%s QoS ipsrc: %d, ipdst: %d\r\n", log_info, flow->ipaddr_rule.qos_ipsrc_offset, flow->ipaddr_rule.qos_ipdst_offset); } static inline void dpaa2_flow_fs_entry_log( - const char *log_info, const struct rte_flow *flow) + const char *log_info, const struct rte_flow *flow, FILE *f) { int idx; uint8_t *key, *mask; @@ -324,21 +324,21 @@ static inline void dpaa2_flow_fs_entry_log( if (!dpaa2_flow_control_log) return; - printf("\r\n%s FS/TC entry[%d] of TC[%d], extracts size is %d\r\n", + fprintf(f, "\r\n%s FS/TC entry[%d] of TC[%d], extracts size is %d\r\n", log_info, flow->tc_index, flow->tc_id, flow->fs_real_key_size); key = (uint8_t *)(size_t)flow->fs_rule.key_iova; mask = (uint8_t *)(size_t)flow->fs_rule.mask_iova; - printf("key:\r\n"); + fprintf(f, "key:\r\n"); for (idx = 0; idx < flow->fs_real_key_size; idx++) - printf("%02x ", key[idx]); + fprintf(f, "%02x ", key[idx]); - printf("\r\nmask:\r\n"); + fprintf(f, "\r\nmask:\r\n"); for (idx = 0; idx < flow->fs_real_key_size; idx++) - printf("%02x ", mask[idx]); + fprintf(f, "%02x ", mask[idx]); - printf("\r\n%s FS ipsrc: %d, ipdst: %d\r\n", log_info, + fprintf(f, "\r\n%s FS ipsrc: %d, ipdst: %d\r\n", log_info, flow->ipaddr_rule.fs_ipsrc_offset, flow->ipaddr_rule.fs_ipdst_offset); } @@ -3017,7 +3017,7 @@ dpaa2_flow_entry_update( qos_index = curr->tc_id * priv->fs_entries + curr->tc_index; - dpaa2_flow_qos_entry_log("Before update", curr, qos_index); + dpaa2_flow_qos_entry_log("Before update", curr, qos_index, stdout); if (priv->num_rx_tc > 1) { ret = dpni_remove_qos_entry(dpni, CMD_PRI_LOW, @@ -3124,7 +3124,7 @@ dpaa2_flow_entry_update( curr->qos_rule.key_size = FIXED_ENTRY_SIZE; - dpaa2_flow_qos_entry_log("Start update", curr, qos_index); + dpaa2_flow_qos_entry_log("Start update", curr, qos_index, stdout); if (priv->num_rx_tc > 1) { ret = dpni_add_qos_entry(dpni, CMD_PRI_LOW, @@ -3142,7 +3142,7 @@ dpaa2_flow_entry_update( continue; } - dpaa2_flow_fs_entry_log("Before update", curr); + dpaa2_flow_fs_entry_log("Before update", curr, stdout); extend = -1; ret = dpni_remove_fs_entry(dpni, CMD_PRI_LOW, @@ -3237,7 +3237,7 @@ dpaa2_flow_entry_update( curr->fs_real_key_size += extend; curr->fs_rule.key_size = FIXED_ENTRY_SIZE; - dpaa2_flow_fs_entry_log("Start update", curr); + dpaa2_flow_fs_entry_log("Start update", curr, stdout); ret = dpni_add_fs_entry(dpni, CMD_PRI_LOW, priv->token, curr->tc_id, curr->tc_index, @@ -3541,7 +3541,8 @@ dpaa2_generic_flow_set(struct rte_flow *flow, /* Configure FS table first*/ if (is_keycfg_configured & DPAA2_FS_TABLE_RECONFIGURE) { - dpaa2_flow_fs_table_extracts_log(priv, flow->tc_id); + dpaa2_flow_fs_table_extracts_log(priv, + flow->tc_id, stdout); if (dpkg_prepare_key_cfg( &priv->extract.tc_key_extract[flow->tc_id].dpkg, (uint8_t *)(size_t)priv->extract @@ -3580,7 +3581,7 @@ dpaa2_generic_flow_set(struct rte_flow *flow, /* Configure QoS table then.*/ if (is_keycfg_configured & DPAA2_QOS_TABLE_RECONFIGURE) { - dpaa2_flow_qos_table_extracts_log(priv); + dpaa2_flow_qos_table_extracts_log(priv, stdout); if (dpkg_prepare_key_cfg( &priv->extract.qos_key_extract.dpkg, (uint8_t *)(size_t)priv->extract.qos_extract_param) < 0) { @@ -3646,7 +3647,8 @@ dpaa2_generic_flow_set(struct rte_flow *flow, } flow->qos_rule.key_size = FIXED_ENTRY_SIZE; - dpaa2_flow_qos_entry_log("Start add", flow, qos_index); + dpaa2_flow_qos_entry_log("Start add", flow, + qos_index, stdout); ret = dpni_add_qos_entry(dpni, CMD_PRI_LOW, priv->token, &flow->qos_rule, @@ -3697,7 +3699,7 @@ dpaa2_generic_flow_set(struct rte_flow *flow, flow->fs_rule.key_size = FIXED_ENTRY_SIZE; - dpaa2_flow_fs_entry_log("Start add", flow); + dpaa2_flow_fs_entry_log("Start add", flow, stdout); ret = dpni_add_fs_entry(dpni, CMD_PRI_LOW, priv->token, flow->tc_id, flow->tc_index, -- 2.25.1