From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0044.outbound.protection.outlook.com [104.47.42.44]) by dpdk.org (Postfix) with ESMTP id 2EC1B2AA0 for ; Fri, 7 Sep 2018 17:23:18 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=AQUANTIA1COM.onmicrosoft.com; s=selector1-aquantia-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kQfG8l8gzAqk7A2RMyBVh0HH+LHuMNNGV5woCJJ9FiM=; b=uE2PwYnAezZ/FwaC2cExTIHFz1Y+GiH3Ga4qc47mOvmgHsH7vq0s6T/3cTswRvNlcda7QJn292VVgzZBl2tpeeJO4QUaGUu0Hx1x7G8N2DUaVZZ3qu0uyhZ1C4svj02O/QxrIHGLUMIh/1n62/Q1Bkrgyf4ado5d2QigzZfMans= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Igor.Russkikh@aquantia.com; Received: from ubuntubox.rdc.aquantia.com (95.79.108.179) by BLUPR0701MB1652.namprd07.prod.outlook.com (2a01:111:e400:58c6::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1122.16; Fri, 7 Sep 2018 15:23:05 +0000 From: Igor Russkikh To: dev@dpdk.org Cc: pavel.belous@aquantia.com, Nadezhda.Krupnina@aquantia.com, igor.russkikh@aquantia.com, Simon.Edelhaus@aquantia.com, Corey Melton , Ashish Kumar Date: Fri, 7 Sep 2018 18:21:41 +0300 Message-Id: <1536333719-32155-4-git-send-email-igor.russkikh@aquantia.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1536333719-32155-1-git-send-email-igor.russkikh@aquantia.com> References: <1536333719-32155-1-git-send-email-igor.russkikh@aquantia.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [95.79.108.179] X-ClientProxiedBy: BN6PR20CA0060.namprd20.prod.outlook.com (2603:10b6:404:151::22) To BLUPR0701MB1652.namprd07.prod.outlook.com (2a01:111:e400:58c6::22) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: afdb006d-837f-4c68-8ee8-08d614d5d01e X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:BLUPR0701MB1652; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1652; 3:WtYf5inVvM0SxIuAihIjtpOMwJCdkB4MzMeKTvKvTU0Wx5O48pS5ge4n1z2jzbzAa87am3HmH2FDCKb0H+nYQowRak5csJlnzSW16ZlBazHdI9hNMXI3s67KvWRGyQfjAIo6HlatORcQRWGPU2K/N+paL/tpxozeRuS9Zec+FMPSSPLm641o0c2MZ64lfpxqGai0MM3bSOq9zqbIMiWrmg9Bzp057qMpTCu1CF7O33U/n89CXGUyv3BSLEMjmkBq; 25:czXDrCoRX1WHxo+YhDHmkUPzyq2H4XOCVB08DOrX1iDCP0SYDE+IzB/muiWgcYyy4NEdRyzye53xb4iC7kt7MH6ptxBwq+gDuRQPF/6yN+ebhCRmdoJX64iivAkV6hxS2lxoNQiZ7EtFUa8hKyg+jj4il1zhDW1BlvoGGzMhnjtewzf90zWUM89phQvqq1vW1jYDTJqvrtsSyyI7gYRJICV+T17nNYVernXgGukYEUyyM3zLsaFsCtAZd1Mb9z6czhmwDf0bohhwTK3OY6Ayd2Ib2eydVdOfdYZtLmANpfQFzLourj93o3pJKv2jz5rCSOws0dHcMswIZQ/0HIinWA==; 31:YL96QpALAUwkAfrnAhWHqEdwUk5eMqbxUaochNvZRVHgj6qp9UVftGlfbfkg5fRfWqF4YVyPYMiITWMjn5KIwByYPA9pFRAB1DYzmTWfUzkMdZuzOuK8VrnOn7TTC84LFe20uU8YzlK8NL13iXIHuQgbrt6ym485RscSxgE2HK4xlUMK04AtROmmbGfkVA4wG+zq5SVmB1dmfr4O4AAJLm4kB8cooQrNe83X17XKuqk= X-MS-TrafficTypeDiagnostic: BLUPR0701MB1652: X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1652; 20:XSHKPlzwjir8LZ4m3myBROSGLNoeuiEhmJkCYS6UjVJixs2CCzPJfmcaARk07bp/G80tNRFuXo5ipIQ4tlSpSvVhOXj4uMiVWSTlaUabpWSEOrD6K9DKJ4ZaGaDK+eSdY2vZ7woGaGn6G7kW0viR8KjcxhzH6bgi8XjRzgvnD8bLdtwWWO7pOosCMSb/f95EBY7ht8vc7mjRHhFQGA4JK7gDGs+ksq6782GelCUSRrmGpEVIDFlbWvyiOi2d1dVC75wNNVgh3ecmMlVOz7prsKvbJKBuZcaYavE7cw0eZgXZs2JK7ngDKe2H/OvOspzceg8ro+uP+GCJM0vQ4rVrrpl9HVOf9xUhaxI06ZjyRdCNDzQTjQgE0FGB9kI+QmsN78U93ZSEFFvsete0wVJfPF47csa6CpnLce9Fvy75qPMbsHh8xgOOPu+deL/2nwWzmWsakhP64zTRcm7fZwxTObq4TDZ0E2iYpmnF6h1fngQ7+9f6HXEUaODLfvN+jer8; 4:nhp+ElINKcYpvEBs9te3bYOfar5ziD9SNV7+n5O5ESQMi2T1brSkO3FGxez3G1+0j0lDExIgEK3F61Fmnn8xF5RDsdMnLY1nvMk6EUVXUdirD3Ci80qRO83sdLTnbJb6tJPF1uckLvmxKJOAqwH/1yf1GwIdFoNPWcI1U1RHHeNX3IeoOaRx7Sh+xiOokTFctWroucEcUHxuBsj+HjszmYZkZ2hQsb1lIG77Wst6e0gCbxi1bz/nyF9CLwSzRChsuaaXzEn5UU4E7VUanKTd+g== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(3231311)(944501410)(52105095)(10201501046)(3002001)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201708071742011)(7699050); SRVR:BLUPR0701MB1652; BCL:0; PCL:0; RULEID:; SRVR:BLUPR0701MB1652; X-Forefront-PRVS: 07880C4932 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39850400004)(396003)(376002)(366004)(346002)(136003)(189003)(199004)(81156014)(81166006)(44832011)(8936002)(2351001)(486006)(106356001)(2361001)(105586002)(446003)(2906002)(50226002)(476003)(11346002)(956004)(2616005)(305945005)(7736002)(16586007)(316002)(54906003)(16526019)(66066001)(26005)(7696005)(52116002)(8676002)(51416003)(76176011)(186003)(386003)(68736007)(478600001)(6666003)(6916009)(6486002)(5660300001)(53936002)(47776003)(4326008)(25786009)(86362001)(48376002)(50466002)(575784001)(72206003)(6116002)(97736004)(36756003)(3846002); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR0701MB1652; H:ubuntubox.rdc.aquantia.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: aquantia.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR0701MB1652; 23:q0UNFa5qKDKGy+aBdt3aZoEBp11StvUbqw19hrE?= =?us-ascii?Q?i0VRTKdJz9Q0zEaOJ8PKtXaLYWFNiHbO5TTrE6+lnf3syj7Q+FliOJi8GFcP?= =?us-ascii?Q?1crmuLkUw5YfUqvAJv1Bww/8SID0ZV2MjqKH07/cYkvynGtxdJpt30VlOLt9?= =?us-ascii?Q?o8rwwtaWZsg6Koyi7JP/CIsjJLoIbuUlD7sBhBGxP8iCTnxEtx5X/APBClKj?= =?us-ascii?Q?04phwrjjfa98bqrABydevPq+0a1JFVz1kKncPLmpfl9U/Q3aMKi3pG/+JtDS?= =?us-ascii?Q?9tdHFq7ZgSQOteAN7eEoiciTc8O+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sbdTilMS9be1LryEAur0yaQdpKDbu7Tyri1EQ/zclwAvmAbgfDpoospWOEYJnc18Jyzsvdp2cZb4DJqY1wg8MPW++ylDWAICC31hU/W5VdV6rXLq39JWqhELuRF2Ef9KMSt0=; 7:tkBvekLdLZw2ZnEpdPAYWlfmy9Gt5PChpMCywpQo1gyrGdpcfsiXihoLCuNuvRu/iDifzZp/ItOM3cnPyFNCmL1ZMY8ENuJ0O/yk6Op7icbw2fXyNtdNeGMGAR5hWDUFkHY6sU90TyU7yTpk2rYrfMIryZ5HNjwQM6sAZ1HvfLOD2STn9zE3sFmKeTc+Uf3VqEO2vHYlQt2rGOdqhe2xRMqh0E4RbSRFVf/tAIp+m1tBuNNtA3f4OeTOBAyZnLnz SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: aquantia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Sep 2018 15:23:05.8345 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: afdb006d-837f-4c68-8ee8-08d614d5d01e X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 83e2e134-991c-4ede-8ced-34d47e38e6b1 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0701MB1652 Subject: [dpdk-dev] [PATCH 03/21] net/atlantic: logging macroes and some typedefs X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Sep 2018 15:23:18 -0000 Signed-off-by: Igor Russkikh --- drivers/net/atlantic/atl_ethdev.c | 9 +++++++ drivers/net/atlantic/atl_logs.h | 55 +++++++++++++++++++++++++++++++++++++++ drivers/net/atlantic/atl_types.h | 34 ++++++++++++++++++++++++ 3 files changed, 98 insertions(+) create mode 100644 drivers/net/atlantic/atl_logs.h create mode 100644 drivers/net/atlantic/atl_types.h diff --git a/drivers/net/atlantic/atl_ethdev.c b/drivers/net/atlantic/atl_ethdev.c index 16080ef9e..31ff50f18 100644 --- a/drivers/net/atlantic/atl_ethdev.c +++ b/drivers/net/atlantic/atl_ethdev.c @@ -145,6 +145,8 @@ eth_atl_dev_init(struct rte_eth_dev *eth_dev) struct aq_hw_s *hw = ATL_DEV_PRIVATE_TO_HW(eth_dev->data->dev_private); int err = 0; + PMD_INIT_FUNC_TRACE(); + eth_dev->dev_ops = &atl_eth_dev_ops; eth_dev->rx_pkt_burst = &atl_recv_pkts; eth_dev->tx_pkt_burst = &atl_xmit_pkts; @@ -165,6 +167,8 @@ eth_atl_dev_uninit(struct rte_eth_dev *eth_dev) struct rte_intr_handle *intr_handle = &pci_dev->intr_handle; struct aq_hw_s *hw; + PMD_INIT_FUNC_TRACE(); + if (rte_eal_process_type() != RTE_PROC_PRIMARY) return -EPERM; @@ -220,9 +224,12 @@ atl_dev_start(struct rte_eth_dev *dev) dev->data->dev_conf.intr_conf.rxq != 0) { intr_vector = dev->data->nb_rx_queues; if (intr_vector > ATL_MAX_INTR_QUEUE_NUM) { + PMD_INIT_LOG(ERR, "At most %d intr queues supported", + ATL_MAX_INTR_QUEUE_NUM); return -ENOTSUP; } if (rte_intr_efd_enable(intr_handle, intr_vector)) { + PMD_INIT_LOG(ERR, "rte_intr_efd_enable failed"); return -1; } } @@ -231,6 +238,8 @@ atl_dev_start(struct rte_eth_dev *dev) intr_handle->intr_vec = rte_zmalloc("intr_vec", dev->data->nb_rx_queues * sizeof(int), 0); if (intr_handle->intr_vec == NULL) { + PMD_INIT_LOG(ERR, "Failed to allocate %d rx_queues" + " intr_vec", dev->data->nb_rx_queues); return -ENOMEM; } } diff --git a/drivers/net/atlantic/atl_logs.h b/drivers/net/atlantic/atl_logs.h new file mode 100644 index 000000000..c5020c3e4 --- /dev/null +++ b/drivers/net/atlantic/atl_logs.h @@ -0,0 +1,55 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2018 Aquantia Corporation + */ +#ifndef ATL_LOGS_H +#define ATL_LOGS_H + +#include + +extern int atl_logtype_init; + +#ifndef RTE_LIBRTE_ATLANTIC_DEBUG +#define RTE_LIBRTE_ATLANTIC_DEBUG 0 +#endif + + +#if RTE_LIBRTE_ATLANTIC_DEBUG +#define PMD_INIT_LOG(level, fmt, args...) \ + rte_log(RTE_LOG_ ## level, atl_logtype_init, \ + "%s(): " fmt "\n", __func__, ##args) +#else +#define PMD_INIT_LOG(level, fmt, args...) do { } while(0) +#endif + +#define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>") + +#if RTE_LIBRTE_ATLANTIC_DEBUG_RX +#define PMD_RX_LOG(level, fmt, args...) \ + RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args) +#else +#define PMD_RX_LOG(level, fmt, args...) do { } while(0) +#endif + +#if RTE_LIBRTE_ATLANTIC_DEBUG_TX +#define PMD_TX_LOG(level, fmt, args...) \ + RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args) +#else +#define PMD_TX_LOG(level, fmt, args...) do { } while(0) +#endif + +#if RTE_LIBRTE_ATLANTIC_DEBUG_TX_FREE +#define PMD_TX_FREE_LOG(level, fmt, args...) \ + RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args) +#else +#define PMD_TX_FREE_LOG(level, fmt, args...) do { } while(0) +#endif + +extern int atl_logtype_driver; +#define PMD_DRV_LOG_RAW(level, fmt, args...) \ + rte_log(RTE_LOG_ ## level, atl_logtype_driver, "%s(): " fmt, \ + __func__, ## args) + +#define PMD_DRV_LOG(level, fmt, args...) \ + PMD_DRV_LOG_RAW(level, fmt "\n", ## args) + +#endif diff --git a/drivers/net/atlantic/atl_types.h b/drivers/net/atlantic/atl_types.h new file mode 100644 index 000000000..f1558b0a5 --- /dev/null +++ b/drivers/net/atlantic/atl_types.h @@ -0,0 +1,34 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2018 Aquantia Corporation + */ +#ifndef ATL_TYPES_H +#define ATL_TYPES_H + +#include +#include +#include +#include +#include + +typedef uint8_t u8; +typedef int8_t s8; +typedef uint16_t u16; +typedef int16_t s16; +typedef uint32_t u32; +typedef int32_t s32; +typedef uint64_t u64; +#ifndef __cplusplus +typedef int bool; +#endif + +#define FALSE 0 +#define TRUE 1 + +#define false 0 +#define true 1 +#define min(a,b) RTE_MIN(a,b) +#define max(a,b) RTE_MAX(a,b) + +#define wmb() rte_wmb() + +#endif -- 2.13.3.windows.1