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 C8ABB4554D; Tue, 2 Jul 2024 15:09:32 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1DA1E409FA; Tue, 2 Jul 2024 15:09:20 +0200 (CEST) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2061.outbound.protection.outlook.com [40.107.20.61]) by mails.dpdk.org (Postfix) with ESMTP id 9D4A64066A for ; Tue, 2 Jul 2024 15:09:17 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CCYRNho7IyVGWjl2uebBVxsdrTSTEpjaJBWW9I3eieXbA2BQulUvA00vabyqEt2VANCJSwiHY6R3m16Th2RfkWIJ2U6lzry+3aKISgWbifqnp4uQ7aVo6XpFZBn22ETohmz88HdhdAJWK0IqlYNalk8yi/xxfzGeAU3BoIpoP5J5KGzSrZplgHwG6+g7RZciLrjdM+7YspyW590qEpo3bStIKyXmDAg4HQhpETrY8Y1uo7gyhppPWPKCgoCZxioLPYxv/zSIIP0u1IyzFVIORBeVVSSZEL5OCc3bOaGQ5Ia/3KO1Vt8MxX9//zwKOdXo/GF+UNTKiiKmt3H5XJp/UA== 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=oZgsRynkJk5gbrH9eF4q6taG3rsM4e4Ijb3TqXylamw=; b=DxtGWKitJ6wcQfYJccBHRV8kN9jyMFJttfGuBuef5mo8z6l7kKxFwIMfJkF0lPj5MusTV07t+kRc8pEwkaqqB9wpUqg6eJ6xR5AA7TBFKkxUdcvQ1uKu0aRAkvYMFI604uMwRgxSL1NdGMhkELAZ8n3Zw6loGMs9rrjwEtYJqPP2RiINL0U69vgKhIsci/elY3Bn16wQ3zEQVeUoMaMm1OKUwO9pUnxREfyT4Ezug+2t1Vn+GqjuZRyD7ZJQqFHRV4Nv35uR+D4Bzngv1TAHaMHvWJgXYxkPb84e0j3ya2xF5lGfcousl/439Uo4L4q4/u/3beHJvTkVeP7IDTTujw== 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=oZgsRynkJk5gbrH9eF4q6taG3rsM4e4Ijb3TqXylamw=; b=U0pCW2A8C4+l/4KgqfIIUB5BcpdKqRJdzKDRy3OxPd6ewY4C7n58IZ12tH2n+qk8viwnyy3TX70xCYvo1FFKJESrHlwc8Is3BLOyGOHLnyCFRu+8esrkR5AXaIrqe+FIH/bbbSZ4SDoZl7irey8DgkimQgANCAitJpZGGQyOD2I= 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 AM8PR04MB7906.eurprd04.prod.outlook.com (2603:10a6:20b:24e::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7719.34; Tue, 2 Jul 2024 13:09:16 +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 13:09:16 +0000 From: Hemant Agrawal To: dev@dpdk.org, thomas@monjalon.net, stephen@networkplumber.org, david.marchand@redhat.com Subject: [PATCH v3 3/3] drivers: replace printf with fprintf for debug functions Date: Tue, 2 Jul 2024 18:38:56 +0530 Message-Id: <20240702130856.3927348-3-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240702130856.3927348-1-hemant.agrawal@nxp.com> References: <20240702104013.3813272-1-hemant.agrawal@nxp.com> <20240702130856.3927348-1-hemant.agrawal@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SG2PR02CA0120.apcprd02.prod.outlook.com (2603:1096:4:92::36) To PAXPR04MB9328.eurprd04.prod.outlook.com (2603:10a6:102:2b6::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9328:EE_|AM8PR04MB7906:EE_ X-MS-Office365-Filtering-Correlation-Id: 3f940b7a-5e2a-4074-efc8-08dc9a982cde X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|1800799024|52116014|376014|38350700014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?PMpEWU6nDSrDGWQYoFII0F8+bCxLgKL4dasJw4q2L1z9zjKc0JS3jqqOZaLJ?= =?us-ascii?Q?pcbU5LeuJSxnBfijsSHU+qYcq16uF4w+xD3vTY8vhNushRLiUoYf/HLuc9Ox?= =?us-ascii?Q?xEWhzZ8RbgqXiVns3hHIhtT6bgPEXpKjwtqiC86mZxN9XMahOfvtm5Z7uLmt?= =?us-ascii?Q?7syT1n1NgvzXHuNqAS6DoLtdjrIM5U66u61OasJtx16LbPCI1CD/G7fgfUc8?= =?us-ascii?Q?ZSfCG2jomvUUwyVV407XWE3q00RkVV3cfh93q9b/0sqsBqoaM0xUkJgolb77?= =?us-ascii?Q?BHn11P3gIR0fveuND9AXgCkgYVfN+Dmzcb+FoWk8G4Co31rOUk4TCpEQh7xR?= =?us-ascii?Q?RKeuG5wu1R/+1gxr66A9YDLU5V9AbfNEcSd33E+PciZBgwapzQG0pbuWddcG?= =?us-ascii?Q?L30VatSAC98YiIvE8Q0vpP4YZP8uL4a9W/laahwXNgWfW2X/5FmYCVI0xCpg?= =?us-ascii?Q?fHJQbCnJyvnLZUcbgFLqZRNP7rytXXmVBZpkcj9tRRWdNfF3FsM2i1vdozli?= =?us-ascii?Q?vKjxgJQkt32aqF9ZZS/wWI2+GDRmkkXGEUT/lxaMQsXGpERITys2UlOzbyLO?= =?us-ascii?Q?YTDJstbjHvIUt9AtGrnJINkt63uJzsJRLgmW5HsFWIfN6qPFKK+EHQ4V0Eaf?= =?us-ascii?Q?Q62wZh2I/eZp/SdqUVJPk+9S/nX1exorRGdod6mgm+3ruGg3+vhzJXiRPiL+?= =?us-ascii?Q?eF6aptRoaaovn4Gzw5N9W3aIzSToj3YVBSWmn0voMCqzo2wLc4xFXHpEi96K?= =?us-ascii?Q?GJyQ8OMeUXsay24PQuL5J31YC+I1GooZXX8MKLc3EcDTvydZZqxHuPcxPm0k?= =?us-ascii?Q?XddS3nme3IZ96Ag59Zl9dADyAuZDl/WjuL8O93ak/g1+9WoHeyIs2cPDJFJ7?= =?us-ascii?Q?PQEUysJsVVDneULTBj52fqdAU95AltJVGndsPzjM49+vqXLIcXuADCkaMxc8?= =?us-ascii?Q?GclM6/uC4Z4ud4yqo33TMAqx+lZvu13lzbIYGtGVb9Fn+hRbduu8Hz7dTsmf?= =?us-ascii?Q?lPqD3oc6QpuYVIigBwvaP7KVvWuooOWkj1Mpxal24zWUqWmoSoz1HPILqJFE?= =?us-ascii?Q?CwhF2sQGOZEowT3OIHRCLEnfc72PhMD47KVuXVRZKCvkGWB7bENQkEp1braB?= =?us-ascii?Q?ceMmZKIug8YBrmLZ/kojhRbeIBab6Be370A/xfh30IeAMkmI2hftzs7d2zrs?= =?us-ascii?Q?j8p6gQYuWbu1a2yNJUztXQkwnExoI1URioi/WXBAfg28Aj7UYuceJ1ELkHLu?= =?us-ascii?Q?vVFI6ivAZemPhn1/HwaO76/pWRga32QNvITXWJjLZ235Eq+GisG4M/yPZdpb?= =?us-ascii?Q?bhrp5SxdANF/LceAL8E9A6qxkfR0N9WelPdf3QLm2R2jTP9KEadfQmr5fXsP?= =?us-ascii?Q?wqp0SRirZuG/PPR0vkp1tIVGm6DEUyXooQ5p066I/TrnOglSAA=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)(366016)(1800799024)(52116014)(376014)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?bFlqULrf30n3lDAnlFSORkcf6me2cZZBc+btEZrSo139/24uESpvfgE3HgjM?= =?us-ascii?Q?2UsnN+/S8u5QHk7hHTw+B59rf81xUUlGDdPmV+OH91+RrgBydoGFFwp8kmuB?= =?us-ascii?Q?axQfmoY9+3RIZABFwvNMMXUTGb4fZTcsHeMS6d3vLbeo0c5PRpf4lw5vD6eZ?= =?us-ascii?Q?gAPQhW+G5O6sthwEwnJ3F4/5PQIGW713BzOVMnR9DBPSifeg0FJhv59Qyvj3?= =?us-ascii?Q?WVo8KJjEeBkKR+SFofu3ZQ9QXWQroiaVu7sNzqic+l85lCtrttOpXKjupnKo?= =?us-ascii?Q?Qi0k5fkOxAFdGZBqjOxnVdj4E+ens3BbPkqAcVO7aZDlyY3d0v8WHk4x0WE9?= =?us-ascii?Q?1Dy5uzpiYZgsABv9EwWnJ//IibulvnCXV7PXZ4cynove6X4+eiZm5YPPpTAo?= =?us-ascii?Q?m/ejv8mDeX/kuzFZmqhcy6ro8uTMfMsSEgEr1CnlkYp8zrs+hhgLsBQGv2V8?= =?us-ascii?Q?dVuILL9RAlbnnTcjjo3jrOVS5dZ99WM5GS2ueERKcGo9cxsUP+dymj1Qencz?= =?us-ascii?Q?al+g3Nkw0XiFvehxiSH3r3MWeVwWPZnRnyfGGf3mJ/d+cxpwHoLLIjmIhBQx?= =?us-ascii?Q?03Pt6rFYx652PGQagFXjBB05xSwk/dzV2cv3QO/z/z3lQGXA/GtVtUEHOuXC?= =?us-ascii?Q?BhLFSA8Lkv/kJmjTf3AxIWd6zWCMpVVJkjGzBdbHzu9kUcQ7onrvvK0B/ksD?= =?us-ascii?Q?pCxFPA/nDiuz/xRG74QGzN37tOI6fYBokMyNs0cErqjFgu9J+sqdK3MLVgGT?= =?us-ascii?Q?Y1c6yyt1uidyHqVeLlLCr4PEfESyy+NAR+uO0E4A+o8DhHnCA7hxL3098JH9?= =?us-ascii?Q?Xw0WoF5NqnO9bOcQ8R/qgwVLIsFIKu6ltC6XXwuN01SjGIXV4dO+DQrFiDz4?= =?us-ascii?Q?i99TfP9jP/CA75I1XBaa+N4Z55OwAkO2ItYVotgoMu9APz4mjyAhrfOKhKTy?= =?us-ascii?Q?YgA+MRso4v1HFkPQyu9H07Mmgjk2PCpEw3CJ5v2KVAA+NZJkIqAqBBOKVhXJ?= =?us-ascii?Q?RAWw6jdlGsk61CUaJOiujvVBceziy9JnY2+bOb1a/Ri3+IcETpF51d9j7nCF?= =?us-ascii?Q?FAbPNgeL1SyV5KM0V7JLJ0gAegQzi2T8+z+9vjiHWnbAhn8tQ67+K3cYYLYw?= =?us-ascii?Q?igTq/fdcMdI8J/WyjoIH9f/qr+nxb+qhHPVWxM1fCinnARCxyRHlDnw7OHnZ?= =?us-ascii?Q?D/ZL2+NN49Ep57AXI2hSPMzzXGosKGx+/EBZzdwLjTifxsynskbh8SHrTnvX?= =?us-ascii?Q?J1cEm5OvPtqGNDjBwToA7bvgYr2In1Ysp76YKGCz64I1ZqE5E9Lj6lLWKIQW?= =?us-ascii?Q?Pazy4FkjLQplpB1bVVxsBjr50LzsA/ZsezE2BSCOEfI/qzkw97FHofPmzCpj?= =?us-ascii?Q?M25JqLF3j2YPaO5NW2Z06oisadGEVZuhojcPAq4y1437NsnePMADh54gPvQQ?= =?us-ascii?Q?Upiw2JcsMPOYoHzYmsiunOOm2AIT9UyFDw0gW1cL7QwPBu2wKxZsjJsj6S4T?= =?us-ascii?Q?xYbfLuBF7ArKahrMFccffO/1EMuZRx0GtQFvqqZXcH31iscibPHQ1naREKNb?= =?us-ascii?Q?Gf/pz/yy3SBWiKAggKj7cjzW206hBDWTkWBhbs+P9oX2SUrOj9u7sbL6TdqY?= =?us-ascii?Q?Ww=3D=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3f940b7a-5e2a-4074-efc8-08dc9a982cde X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9328.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Jul 2024 13:09:15.9741 (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: PtYG3B5CcDoctBon7m4OMvC+DXeJ3RLh3PA/cRbI9qiMGrLHiJznjSAPztNQM9OHsye+YfErM3z1gkemQ3op3Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR04MB7906 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 | 4 +- 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, 98 insertions(+), 96 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 e483428ddc..8ce93abd84 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 fb9ac9cb30..c836cc128a 100644 --- a/drivers/crypto/caam_jr/caam_jr.c +++ b/drivers/crypto/caam_jr/caam_jr.c @@ -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