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 257B6A0547; Thu, 9 Sep 2021 13:15:46 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 773444114F; Thu, 9 Sep 2021 13:15:32 +0200 (CEST) Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2048.outbound.protection.outlook.com [40.107.22.48]) by mails.dpdk.org (Postfix) with ESMTP id 6A8D3410F7 for ; Thu, 9 Sep 2021 13:15:30 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hL30UCEX49oCslGwFCJph8ZSIeoYzcldPD/P1YgkgimCI27d/GlXIdWLPmy/rmZhuPhqT5wdIB11K1N8TFfV3bmJQ0eDQcmpoZcB5e0T777MUeMax0Pt5fGNF1sbXU/Drl5v3bP60FCKXeFMLcFL71PvYhSZeu1NZI4jDEvrqFflyA4A1vFq1rBFSY1cN0QRl2woOxgJF2PXFU/P4UP/6svkczaDHVNKqQeHtsacxyNqKE85gdLlZl0m5noX6mnIGmRP69orgqiVmjlrK9qQQRmfV8YmmJCrw6nqKIn2qUsG9W6mYbcAgOnxs0sXymwC8PTbwn7s56QMYH0wH0dhhw== 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; bh=squn3PlwCp/QWcZqJNF5NxS0pXL6s4V/5pRlQckVlG0=; b=O+pcDoAAEK0am87SgOpxnM9xz95aUDcmhbBKuN43jwyiXftTl9gLq4kMvZVXu0q90igcSdulcQrXvT/3Hdj72aBaF23VwIxjV6WnAUdRgKEHLkOR99lNGoD6cI4iX3VObfkMQgIBH0FIZSTwsp964wxTrdu+0vS1GPdR/uzggDJvDFj/V2vztR0dpPt6F5ChN4MlIYPUUmyjJoIHGESGVem/jDbmO/eHjW9w1OgNkhbjxqy5O/mmOWWkfdUq7oBg2x/vDpL+fpq1ENJ1XRORSaMDRZUfvmVtPqqrWgOZkVw/Bkko0T6x4ZrmP+EWwHCcXtIJNCdSSpmhuGlw9eC9Kg== 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=squn3PlwCp/QWcZqJNF5NxS0pXL6s4V/5pRlQckVlG0=; b=CUvoO4FsmM3Mx97qpKO/ycgJA4iU6xD45zzPkldjD5PsenD4Z3ECAzO0+qkPnkbbgpiYOnWn168fEp6LzkFEosjmPTxbBd244h5yjw42cgyPaB98qX8wiy2NticajyncZ2lRN7OiGenflESad4J/S6JTnGrAO3rWA9KVma5m8wc= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB6960.eurprd04.prod.outlook.com (2603:10a6:803:12d::10) by VI1PR0401MB2367.eurprd04.prod.outlook.com (2603:10a6:800:24::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.14; Thu, 9 Sep 2021 11:15:29 +0000 Received: from VI1PR04MB6960.eurprd04.prod.outlook.com ([fe80::d496:fcce:f667:7aa7]) by VI1PR04MB6960.eurprd04.prod.outlook.com ([fe80::d496:fcce:f667:7aa7%8]) with mapi id 15.20.4500.015; Thu, 9 Sep 2021 11:15:29 +0000 From: Gagandeep Singh To: dev@dpdk.org Cc: nipun.gupta@nxp.com, thomas@monjalon.net, Gagandeep Singh Date: Thu, 9 Sep 2021 16:44:57 +0530 Message-Id: <20210909111500.3901706-4-g.singh@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210909111500.3901706-1-g.singh@nxp.com> References: <20210909111500.3901706-1-g.singh@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SG2PR06CA0149.apcprd06.prod.outlook.com (2603:1096:1:1f::27) To VI1PR04MB6960.eurprd04.prod.outlook.com (2603:10a6:803:12d::10) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from lsv03457.swis.in-blr01.nxp.com (14.142.151.118) by SG2PR06CA0149.apcprd06.prod.outlook.com (2603:1096:1:1f::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.14 via Frontend Transport; Thu, 9 Sep 2021 11:15:27 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8edc91a1-b323-4ab3-5f4d-08d97383219a X-MS-TrafficTypeDiagnostic: VI1PR0401MB2367: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3631; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FlRml5NDgFAoYi3b/jKhcbpUfDW1yoFTxGu4p+Q8ii+pMUIOvV5hiePReunA750It5FU9+pOoKBNtW9TZLI+0e9gd1uF8QgvrJBGac7WKzcze88055rmkgOBkxxqdC/ZhMMYCOrSR8RTW5xp24r9IpiKy3Vp3HQUZpJ+Jjs9UvYLghySUpZPR0xTJbDGqCvXTUOgfTWx45KZxVG9d/HrT6o1xONkKTemQmicaQfpauAaXgCrt6D9yoxLlKceKYPEF0oQrgE5x6/Ob768jGmB3c04Q8B5CpUB5ecN2IMuX96Fh+tBqYRwLG/Ba9xr8Tr1Nx8/e9SxO8HYuH9qjDErRYwsTwLcYiSgg3jrIgPV1qCVny8biOHm5lNeBfaXBIrLyviSiFzHtMq88Tmxuu1xBA1II4kQvv+CSN4geVB18mRfGdfxvNY2BtMXDLGPQLw8GGt8Fsk0QRBkNON5+J1Z65IBpFpEn7FzzmiGNZ7Q9q/sqKzPRDKZkpCXcQWd2jb0cEHIMsCzM+28Aw2ApadGR2UpM1IMFotnsGRixlUkTuP7f9iiYee+ZOPij2+PC8//VlKKolbdBglbgxAofqFHLOMDPd2pzrlYq4QcIE5YREbNp+v/cwl+/Ck9SZ9BNSn57D1bmZj9bUmG5n/rTTe4VCJvLQD0pNfBXIg/ki5SMGPjCjuHDXeUImsGYruT6XA4BWGBtur05Ud2m8LioA31UU4wbaOUTBe2DESB2SaVu00= 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)(136003)(346002)(396003)(39860400002)(376002)(366004)(66476007)(6486002)(7696005)(66556008)(186003)(52116002)(86362001)(36756003)(8676002)(1006002)(83380400001)(5660300002)(956004)(4326008)(6666004)(2616005)(66946007)(6916009)(478600001)(1076003)(38350700002)(8936002)(38100700002)(26005)(316002)(2906002)(55236004)(110426009); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?BjRoY+BXYn/burLLAQ/1A6yXbpzsT8pcET1TOq/bDk0cfwNF1u1cx9DgQH9H?= =?us-ascii?Q?Z6tmrTWieTzESlVj+TdZIQUVwMWqSXTtX/YOlqhwLnUkqM8Qv3dktKms7odK?= =?us-ascii?Q?PWD/AhjvIY7OisCOuUlvVueOqF4sn72ptFZaz/IZSz+tJwH0QV0XHmMQAG9v?= =?us-ascii?Q?cyXX61csyENoaLoLJ1TJIRXcBCyK07i3cJgYJzaoQkW2r1C2e6Lnr9IoKc+F?= =?us-ascii?Q?71+MVH8SQhiWz3VntXZsa6t3ilz69B0iGR5k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ascii?Q?ZPEYm7y2gPC+6l15IiBvxKwBHtltr1CIYmlulITEmHYDxejeyi1JtEAvCgwh?= =?us-ascii?Q?qkDwnIOpaQQcW3uiFbkgOGLhaR8cFf2LOIvmVb1SLsXGeOj7Ns41Zsaj+EgZ?= =?us-ascii?Q?n8v5Y94HCkRksitQzQk9yOHLwuH8tE4UMwIKqyE5iNY3P0KLlBaiEVVwj5MT?= =?us-ascii?Q?z6Nsjwdp4juvTg44M19sR44f?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8edc91a1-b323-4ab3-5f4d-08d97383219a X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB6960.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Sep 2021 11:15:29.5482 (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: iycV2HRc3Q3FUpWpYlwviG/ZGflBhMymUwyZfgcJQ8jFHZORnfXVSyXVK8fVWUX3 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2367 Subject: [dpdk-dev] [PATCH 3/6] 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 | 10 +++++++ drivers/dma/dpaa/dpaa_qdma_logs.h | 46 +++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+) 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 aea09edc9e..8b0454abce 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) { @@ -107,6 +108,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"); return NULL; } queue_temp = queue_head + i + (j * queue_num); @@ -143,6 +145,7 @@ static struct 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; } @@ -227,6 +230,7 @@ static int 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) { + DPAA_QDMA_ERR("DMA halt failed!"); return ret; } @@ -353,6 +357,7 @@ dpaa_qdma_init(struct rte_dmadev *dmadev) ccsr_qdma_fd = open("/dev/mem", O_RDWR); if (unlikely(ccsr_qdma_fd < 0)) { + DPAA_QDMA_ERR("Can not open /dev/mem for qdma CCSR map"); goto err; } @@ -364,6 +369,8 @@ dpaa_qdma_init(struct rte_dmadev *dmadev) close(ccsr_qdma_fd); 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; } @@ -387,6 +394,7 @@ dpaa_qdma_init(struct rte_dmadev *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; } @@ -409,6 +417,7 @@ dpaa_qdma_probe(__rte_unused struct rte_dpaa_driver *dpaa_drv, dmadev = rte_dmadev_pmd_allocate(dpaa_dev->device.name); if (!dmadev) { + DPAA_QDMA_ERR("Unable to allocate dmadevice"); return -EINVAL; } @@ -462,3 +471,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