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 4CA02A0C4B; Mon, 8 Nov 2021 10:07:48 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 33C944113C; Mon, 8 Nov 2021 10:07:37 +0100 (CET) Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-eopbgr50077.outbound.protection.outlook.com [40.107.5.77]) by mails.dpdk.org (Postfix) with ESMTP id F0B9C41124 for ; Mon, 8 Nov 2021 10:07:33 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=W1cHdlhWtlGIeCiMGhciEN2JQE/floR+ofuqMmPZDJxs5ZTzgKATVlANBb3qf00Vi+4g9Rbe74DtjHJ71zSXEshm5VBn1MRo0eB8owriXw47wmuDYFZo41E5I7DtNL8giNfRSPCwROxMrZqMYez0ZJv8QaGo5Gf2W8a/g+of+R5ni/UImwNGEUtPY+Rt2be1Wr78pTjFXHiqy5lcrw2lrGPl0pvP7tM2xarDngVWhkIRNpvLZ3HW6ZI5mNurK77qhOTIThtqLTEQlB3582BUzUj6Og9OsFq1HJWCTdl4YNSF62Rf65YgFXfoCfgC3qZ+vjyWjsX8i19tdJTrHy3VIA== 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=emllWLl8Gc8txl0g0GWUAZ7X31yHRtvd9AoYFjDvvGE=; b=B/aNSOnHY4Ja5bPIHjJryzfiNnAJA4CojtDG/JjEVI8DrfDImRv62mkScXOE0CDiZZDHvGl+sixrXzdHUIbosCIxnM8mCEq9so/yO8gv4Ftuz87CHqcaM4ALGXO/fMEPIUE74YkBwzMIlydtT7I0XI69696bLkpYK0y8s5vmzDbB4RVRqz51VCrQcLz4XHwzck1ByxcX8DVhP80qPr36cEFs/JNsxjd7HRe5Jiv2YT8L3jvf5kn/jTzV7LdERTyhapj75+tSgSNAa94NzOdo/VyYFud9E9HOVxgKTvhXtzDdTOXEko4EcEzBaIEjZzh1ZT0PTsC7ANt5UNUz+0NynQ== 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=emllWLl8Gc8txl0g0GWUAZ7X31yHRtvd9AoYFjDvvGE=; b=c3kOJjxwVJFeR5bzWdUbg+dI88uks+PifsY0QC9vFahOriivyZozKkQ2wgytseodaRmRvzwo8AEgLELTKaAV/insHmLsfMv4zH7L/c6CBL8hD3TjCJQcuWXZ06hcRYFnoo+fn5pP7/GAuV0PLZ81pUiH+PT7+BN5+JVBZyPEA4M= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB6960.eurprd04.prod.outlook.com (2603:10a6:803:12d::10) by VE1PR04MB6495.eurprd04.prod.outlook.com (2603:10a6:803:11d::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.13; Mon, 8 Nov 2021 09:07:33 +0000 Received: from VI1PR04MB6960.eurprd04.prod.outlook.com ([fe80::11d9:6f32:90e:80c1]) by VI1PR04MB6960.eurprd04.prod.outlook.com ([fe80::11d9:6f32:90e:80c1%7]) with mapi id 15.20.4669.016; Mon, 8 Nov 2021 09:07:33 +0000 From: Gagandeep Singh To: dev@dpdk.org Cc: nipun.gupta@nxp.com, thomas@monjalon.net, Gagandeep Singh Date: Mon, 8 Nov 2021 14:37:00 +0530 Message-Id: <20211108090704.3585175-4-g.singh@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211108090704.3585175-1-g.singh@nxp.com> References: <20211101085143.2472241-2-g.singh@nxp.com> <20211108090704.3585175-1-g.singh@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SG2PR02CA0077.apcprd02.prod.outlook.com (2603:1096:4:90::17) To VI1PR04MB6960.eurprd04.prod.outlook.com (2603:10a6:803:12d::10) MIME-Version: 1.0 Received: from lsv03457.swis.in-blr01.nxp.com (14.142.151.118) by SG2PR02CA0077.apcprd02.prod.outlook.com (2603:1096:4:90::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.11 via Frontend Transport; Mon, 8 Nov 2021 09:07:31 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e3ebfafe-9187-4285-f59e-08d9a29732f3 X-MS-TrafficTypeDiagnostic: VE1PR04MB6495: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3826; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: pQ7TxJAr5Sfef9RUt8NudNZLQBiflOg9r+w1Bow8qmoKR0qsihRMN1AE5jnj5m63Cpnlsz3GBVRtNJZcEwTsHxgTVAuSkiAoBOoOWm3YyZBvLAIzCX1dgKRur4hQ/FVE6e1VYzsbYWlWQFi1fhIx+2QoLepaTSiRwL/FUi9BlbRYRpmuIU/25R7zqhcA6LYx+EW4sK3PDgIve6vrF2N5yvefj9KX1c4X99BdZs5Hrf81NM5HYh2uuBgAWlqlhIy0t+TggMU0Mn9R4me5pnq/6pWeOWoLETMSsyw8DfCH90Jrm5yOqLS1TJqOodzEryA0q+bhO0+oDN3oLhOMFCdW0qInYwkuoRD2PLVx62ysFZ8u2hk5RWmwKHZKlQRrOiw5DYXbKsoPdT8xqQc5YsHJciK1eukUqT7ElcyDsTyK/UnQ1/ur84o85o3Y9LoOMEmv/1OI4aq3u2fRNXd4IFQWbnZHqZoRydSQ+QWUzecC5traoT9UB3eH6EbF/9FvjcHgVqJ7gTO4kPinOfWDxB/ksgAYfrnDXzcfeLbzTxyte3hbbDwpX+L8uHm3imOOxhnp9Ox2rF36MOg7HWQIVU3b3Wq9BU/BvfVa8pKoiTnwvxWqoTTUj6bV6oHbxKpm3w8l9rv1hmcy9zZiVP2IPOQlvntAzDMFRlJ3DehUWt7IzyEmtiCAa/9r2PofTJyU9UdV7Ej7rVKxaPacGBSZPHT8+e56X3CE1hJP7BBUqLKNzeA= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR04MB6960.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(1006002)(8936002)(66556008)(5660300002)(6666004)(36756003)(26005)(55236004)(508600001)(2906002)(66476007)(38350700002)(38100700002)(8676002)(83380400001)(6916009)(1076003)(52116002)(7696005)(316002)(4326008)(956004)(186003)(2616005)(66946007)(6486002)(86362001)(110426009); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?3Jb0xbBwCmpGzzUcVjy+tn0+R6UL6oluoijFZaw9F5ViMb6pn8KDT3lGvXR3?= =?us-ascii?Q?Gm0j6ksOmb1rJoLG74fBKCkSIUfPXqwTW+Z2KrjUPHbhkStYoHP89tBUyzzk?= =?us-ascii?Q?knMviCYFFZaIAZwPS51rB+Q+ZjVKuTQj+vv3jLY20XxNHzJmXjR62ZUL+0oN?= =?us-ascii?Q?TOBcfOAdX763MkwhSTFJUijbLIg2RDXdJhquMqnOiPAmxREVlBi8Nv/EFItD?= =?us-ascii?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qUljguHAtA8yIaPK4tq?= =?us-ascii?Q?OJU15Y/5h0qomP/YE6eYnJyZjwLF9gVOm84xPO7QmXYCgdc4OspiqDJFFLJ0?= =?us-ascii?Q?UW+Mx8uDakd6BhQ3w39sWUdZb1VMATDNUSlOxnLBhdDYGGuJDXH7uv05riGb?= =?us-ascii?Q?mYYK6Mfa6v6TypFbpn4hdS2QuOa3Em41T8goKBNhvaUZ7kE72NMiQDOX6sVd?= =?us-ascii?Q?PrCTR4oLsjLkQZEePCKiNnlYZ/ZwaJBPftsSwT8xtSMAg0sr50c4hhEFiwaN?= =?us-ascii?Q?AoMD4CrM0v8gge8BJsTeXXGGs8RgIdYQXXjeplea+1Yxz1fTzORPsHWxTtmq?= =?us-ascii?Q?78HxwyYE9zBbvOpip3spezZ8J3UyQ8EcXMEJj4OjZXmx+v1baAO64js3K5GR?= =?us-ascii?Q?SFYZTvJnW421wtVqVDB0/rKBjEBGMrOU15Z7p2JbOEcsLIkJa+ScdHaS0Owv?= =?us-ascii?Q?ZagQqdItCr6SxJmUGd0=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: e3ebfafe-9187-4285-f59e-08d9a29732f3 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB6960.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Nov 2021 09:07:33.0625 (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: rly3GVZTUvKPr8n6PMhkco5bAEGLtAPlN06aJCOE8PBNYiVghL4Xc9cOcXzIkexz X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB6495 Subject: [dpdk-dev] [PATCH v3 3/7] dma/dpaa: add driver logs 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 Sender: "dev" This patch supports DPAA DMA driver logs. Signed-off-by: Gagandeep Singh --- drivers/dma/dpaa/dpaa_qdma.c | 22 ++++++++++++--- drivers/dma/dpaa/dpaa_qdma_logs.h | 46 +++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+), 4 deletions(-) create mode 100644 drivers/dma/dpaa/dpaa_qdma_logs.h diff --git a/drivers/dma/dpaa/dpaa_qdma.c b/drivers/dma/dpaa/dpaa_qdma.c index f958f78af5..c3255dc0c7 100644 --- a/drivers/dma/dpaa/dpaa_qdma.c +++ b/drivers/dma/dpaa/dpaa_qdma.c @@ -6,6 +6,7 @@ #include #include "dpaa_qdma.h" +#include "dpaa_qdma_logs.h" static inline int ilog2(int x) @@ -114,6 +115,7 @@ static struct fsl_qdma_queue for (i = 0; i < queue_num; i++) { if (queue_size[i] > FSL_QDMA_CIRCULAR_DESC_SIZE_MAX || queue_size[i] < FSL_QDMA_CIRCULAR_DESC_SIZE_MIN) { + DPAA_QDMA_ERR("Get wrong queue-sizes.\n"); goto fail; } queue_temp = queue_head + i + (j * queue_num); @@ -163,6 +165,7 @@ fsl_qdma_queue *fsl_qdma_prep_status_queue(void) status_size = QDMA_STATUS_SIZE; if (status_size > FSL_QDMA_CIRCULAR_DESC_SIZE_MAX || status_size < FSL_QDMA_CIRCULAR_DESC_SIZE_MIN) { + DPAA_QDMA_ERR("Get wrong status_size.\n"); return NULL; } @@ -250,8 +253,10 @@ fsl_qdma_reg_init(struct fsl_qdma_engine *fsl_qdma) /* Try to halt the qDMA engine first. */ ret = fsl_qdma_halt(fsl_qdma); - if (ret) + if (ret) { + DPAA_QDMA_ERR("DMA halt failed!"); return ret; + } for (j = 0; j < fsl_qdma->num_blocks; j++) { block = fsl_qdma->block_base + @@ -375,8 +380,10 @@ dpaa_qdma_init(struct rte_dma_dev *dmadev) } ccsr_qdma_fd = open("/dev/mem", O_RDWR); - if (unlikely(ccsr_qdma_fd < 0)) + if (unlikely(ccsr_qdma_fd < 0)) { + DPAA_QDMA_ERR("Can not open /dev/mem for qdma CCSR map"); goto err; + } regs_size = fsl_qdma->block_offset * (fsl_qdma->num_blocks + 2); phys_addr = QDMA_CCSR_BASE; @@ -385,8 +392,11 @@ dpaa_qdma_init(struct rte_dma_dev *dmadev) ccsr_qdma_fd, phys_addr); close(ccsr_qdma_fd); - if (fsl_qdma->ctrl_base == MAP_FAILED) + if (fsl_qdma->ctrl_base == MAP_FAILED) { + DPAA_QDMA_ERR("Can not map CCSR base qdma: Phys: %08" PRIx64 + "size %d\n", phys_addr, regs_size); goto err; + } fsl_qdma->status_base = fsl_qdma->ctrl_base + QDMA_BLOCK_OFFSET; fsl_qdma->block_base = fsl_qdma->status_base + QDMA_BLOCK_OFFSET; @@ -408,6 +418,7 @@ dpaa_qdma_init(struct rte_dma_dev *dmadev) ret = fsl_qdma_reg_init(fsl_qdma); if (ret) { + DPAA_QDMA_ERR("Can't Initialize the qDMA engine.\n"); munmap(fsl_qdma->ctrl_base, regs_size); goto err; } @@ -431,8 +442,10 @@ dpaa_qdma_probe(__rte_unused struct rte_dpaa_driver *dpaa_drv, dmadev = rte_dma_pmd_allocate(dpaa_dev->device.name, rte_socket_id(), sizeof(struct fsl_qdma_engine)); - if (!dmadev) + if (!dmadev) { + DPAA_QDMA_ERR("Unable to allocate dmadevice"); return -EINVAL; + } dpaa_dev->dmadev = dmadev; @@ -478,3 +491,4 @@ static struct rte_dpaa_driver rte_dpaa_qdma_pmd = { }; RTE_PMD_REGISTER_DPAA(dpaa_qdma, rte_dpaa_qdma_pmd); +RTE_LOG_REGISTER_DEFAULT(dpaa_qdma_logtype, INFO); diff --git a/drivers/dma/dpaa/dpaa_qdma_logs.h b/drivers/dma/dpaa/dpaa_qdma_logs.h new file mode 100644 index 0000000000..01d4a508fc --- /dev/null +++ b/drivers/dma/dpaa/dpaa_qdma_logs.h @@ -0,0 +1,46 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright 2021 NXP + */ + +#ifndef __DPAA_QDMA_LOGS_H__ +#define __DPAA_QDMA_LOGS_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +extern int dpaa_qdma_logtype; + +#define DPAA_QDMA_LOG(level, fmt, args...) \ + rte_log(RTE_LOG_ ## level, dpaa_qdma_logtype, "dpaa_qdma: " \ + fmt "\n", ## args) + +#define DPAA_QDMA_DEBUG(fmt, args...) \ + rte_log(RTE_LOG_DEBUG, dpaa_qdma_logtype, "dpaa_qdma: %s(): " \ + fmt "\n", __func__, ## args) + +#define DPAA_QDMA_FUNC_TRACE() DPAA_QDMA_DEBUG(">>") + +#define DPAA_QDMA_INFO(fmt, args...) \ + DPAA_QDMA_LOG(INFO, fmt, ## args) +#define DPAA_QDMA_ERR(fmt, args...) \ + DPAA_QDMA_LOG(ERR, fmt, ## args) +#define DPAA_QDMA_WARN(fmt, args...) \ + DPAA_QDMA_LOG(WARNING, fmt, ## args) + +/* DP Logs, toggled out at compile time if level lower than current level */ +#define DPAA_QDMA_DP_LOG(level, fmt, args...) \ + RTE_LOG_DP(level, PMD, "dpaa_qdma: " fmt "\n", ## args) + +#define DPAA_QDMA_DP_DEBUG(fmt, args...) \ + DPAA_QDMA_DP_LOG(DEBUG, fmt, ## args) +#define DPAA_QDMA_DP_INFO(fmt, args...) \ + DPAA_QDMA_DP_LOG(INFO, fmt, ## args) +#define DPAA_QDMA_DP_WARN(fmt, args...) \ + DPAA_QDMA_DP_LOG(WARNING, fmt, ## args) + +#ifdef __cplusplus +} +#endif + +#endif /* __DPAA_QDMA_LOGS_H__ */ -- 2.25.1