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 DA897A0C57; Mon, 1 Nov 2021 09:52:29 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 938C541120; Mon, 1 Nov 2021 09:52:15 +0100 (CET) Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-eopbgr50057.outbound.protection.outlook.com [40.107.5.57]) by mails.dpdk.org (Postfix) with ESMTP id F0D4E41120 for ; Mon, 1 Nov 2021 09:52:13 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=B9JjI9rX+oEUSMXA6O0DSWSN8ahtar58PbFYihPobO343woXscB7FX1l/jqNRtTYz92hTPUqfc6ztyhsx+g488QFoEXGWOMd0BwjyedEPpJb3/KkLMczGTy3sVRDuxSP6PtT+zMecim/OkWD6xcl1KXuZKF2sv3mkMWD9D440fovrVuHZBKj9a+SIYth7DWI5vLrsYOg04Wbxq1cJM0+hrfXAzoXqhg9US8kllfo8QHZP+lUVHI2/uhfMQRtFFJplKzG0CrZ9XzOI/I5OBMqriVwQ8lDP3N1VRYXrwhI8vhHcOxc4gJZHqq8YEkB35Qnk9dU9RoAsU2F3Yw/ST881g== 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=oH0J3/ehaR46dZQ+cXaaoA2uazszzhO4Xkp60zX86cE=; b=YcLJs1M/2aSFqD8CCxoYthrZUcJi60yqb+QLdhnytoFt2DGNWG7Wz7+ia6e21MjXy4cqeur1XQNFAi7lM/cGG/GSWu2WgtQ7VR3sBwBH6jpTpKdjYcncDeWUSS2LyH5vz3+O0D5P+oDBpQ+P+73G7Bn0JVS2w9I4z7GL1YG5FPm0NmvHEjRdwO3K4EgTAmy+w2kZwzD6evIosiUySSNx0Dj37R5U/PusyVtUCdgDDs3B2M/8V7cQ/LLYY9SJqFpxbZVhUFlH8EqLffjWKYd4x8d6AhsVqvOX/OXexggZQyQbDl7Z9nd1z0wMFmIyEMl8cDVL/NfNQ655kDZGUryfdA== 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=oH0J3/ehaR46dZQ+cXaaoA2uazszzhO4Xkp60zX86cE=; b=djlF4V5PKUwIvV4/lvuF9bC++qxorFLMPh6+hQuObDQMGrbIng1oqANHnit+YO9Zmbihum+apNSDGeNdzYpzvyIEWdmXgdffzTjk/YnCnzIzdk9R8pkzzr91MQpF3WmuQo94Ch6k9oluPbaelF37RMgd71MnQGUVfJJw7vVwrso= 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 VI1PR04MB5086.eurprd04.prod.outlook.com (2603:10a6:803:62::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.15; Mon, 1 Nov 2021 08:52:13 +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.4649.019; Mon, 1 Nov 2021 08:52:13 +0000 From: Gagandeep Singh To: thomas@monjalon.net, dev@dpdk.org Cc: nipun.gupta@nxp.com, Gagandeep Singh Date: Mon, 1 Nov 2021 14:21:40 +0530 Message-Id: <20211101085143.2472241-4-g.singh@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211101085143.2472241-1-g.singh@nxp.com> References: <20210909111500.3901706-1-g.singh@nxp.com> <20211101085143.2472241-1-g.singh@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SG2PR02CA0092.apcprd02.prod.outlook.com (2603:1096:4:90::32) 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 SG2PR02CA0092.apcprd02.prod.outlook.com (2603:1096:4:90::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.15 via Frontend Transport; Mon, 1 Nov 2021 08:52:11 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0e622799-b345-44fc-8ac9-08d99d14e57e X-MS-TrafficTypeDiagnostic: VI1PR04MB5086: 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: 8EnqUEJGT2mZR+NjAHZf/TO5bEuJPVFh255nHNN1ZjAc2caKiR78fOmyfi9o4OMspNMPVJ+uBO+1VikO7ueNE1UWb88gISlGbx3L1u4IdF8Tz3evMTMQun8JwfqSkT+sce1ILb5LY5QdOtk2M1kXmbV8EOmmN88CP89zJ8NCUdRyM30zTJCmNyx6NVQKVXu4uTjSz8nDNWIK6woUZPLhl2JscxjEgczrMWIkNE/ftwEDftYpM7h6YaAevOoy2jfHB4puRq+5E8CB/m/7CWGQ5dbSBSvuOCwyciH58zd5JlMMa4xxdgNEX4H1/fq+nTbTOc3G89PNObuYq/P7XuDmLPs2sPYOjOc8X+TJ4w0TTxIRaIILurZEgM/hY85jHeahYn20VoItx/yMjodcUK4w5tA8/LvxbGzT0EX5PGuAFw3q0ub41YBXGvIawcLy9gBZChJRn7MiCKF968eQS+ekPz9Lj/ricyneVljJAKZl6rPg3jyDCxKgb+lVJvjqu/Tuk/9gfP6sWcdXoeCwbhJ4wJUUHPALvl5Nnr46pCfkYwnqJpEaS7K3CforKDS9ANneGWvmi0CtoONLh8gm0uaPrzoNvGsNeYcuJKoO8Mtl2KTAbJu1B5564LkV+hpPn+iH+EwYGq9JduzT91Rtsj5L8AVdb+4iaATOXi/QRfNeSCcpaAViNxHG6ZuA2svE5jCU0mt87R2AUETTM8Y+IotIEhQlf9pI4LlzwktkQqIYgPA= 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)(38350700002)(38100700002)(55236004)(6486002)(6666004)(186003)(1006002)(4326008)(5660300002)(316002)(956004)(2616005)(86362001)(66556008)(7696005)(66476007)(26005)(36756003)(52116002)(8936002)(2906002)(66946007)(8676002)(83380400001)(508600001)(1076003)(110426009); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?gx0wZEnZ02bPFMps1jHAMjCRgq0JKHM5ze9d4e1jNokYHstwIvUdvj3Xz4e8?= =?us-ascii?Q?V25RQ0Cu2p9cLFf02El9o5PgEumYwZllIKpPS3lGPSL0MpEykr5+DXfRDlof?= =?us-ascii?Q?6e2XFgNpyy/isfihOfJYvnC0A/dUJokf2dPHqH/RR+6kLGJgp0dJvtqdkwsa?= =?us-ascii?Q?hJ5nGZCmn//wClJR0IgHATBksaHIgTx38tibuh0iIySnFNi1N4RZ17XkYhP8?= =?us-ascii?Q?ZrFHrJMzeo2LNmAeeexJFK67PPQRhV/RQTx0z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3lV08phhENxrmjyaY2FIgT6tit8k/h9NzV5tuW26yprSExjMf40O1UUOj?= =?us-ascii?Q?aZIkF0RKWcQVEI/lr/5utlDH4gk69zzg5Q8X2RxVuTlTnWvodtb1t7BbQ8tF?= =?us-ascii?Q?CPFr2jlASqqh3AR/N8WoxWNMfg38YVdpO6axaOOy5m20o8ukdFObd03Qwgck?= =?us-ascii?Q?oG3UrAFams6ftXQ9AchbMQQYSeKul5yUwrju4G2AH08goWVuB9rjRR6gBXkz?= =?us-ascii?Q?Tngg2sxD67Skie2JUYuEhXfAiUAwcSAsCoBMUUsXSXCn4+mlUvlbjtC5m0GM?= =?us-ascii?Q?8/6Vj0SF3HK129+KbRpLLwnWTSTsY/lfYvVcatoZ3B3fTeWdbo6GWt91Lyxu?= =?us-ascii?Q?Cb92iGWgNFgjk8jg7qSCxOjrRp7RSIzUkecK5FMeJdZAgRDXfPBI+uUj5s0i?= =?us-ascii?Q?z4ix0+gW7WH6AInldJo=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0e622799-b345-44fc-8ac9-08d99d14e57e X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB6960.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Nov 2021 08:52:12.9537 (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: wDvCECTUATH9cGSSFv+nCzvNCBzyeROsERW5Yq0tmq+de/22J0a0zS52gU6RIocr X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB5086 Subject: [dpdk-dev] [PATCH v2 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 3ad23513e9..7808b3de7f 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_dma_dev *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_dma_dev *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_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; } @@ -411,6 +419,7 @@ dpaa_qdma_probe(__rte_unused struct rte_dpaa_driver *dpaa_drv, rte_socket_id(), sizeof(struct fsl_qdma_engine)); if (!dmadev) { + DPAA_QDMA_ERR("Unable to allocate dmadevice"); return -EINVAL; } @@ -456,3 +465,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