From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0075.outbound.protection.outlook.com [104.47.32.75]) by dpdk.org (Postfix) with ESMTP id BF1AF5F12 for ; Thu, 13 Sep 2018 13:35:50 +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=V4CUwflH9oDK/JRDRPfvHq/KZOiI/bnu88TkTZMWloM=; b=dwLcmVTs2LxCyGulS7WFwy21FDm0a4pFlrh8NZ7/u7qlAg0WR2E2+4StEv8DraPLmXjgADAMA2G69LzOFNrWvMN0VVfF2VpGzChdwPlGgrVILJuiNeyGJGDer10e8Kkxm62QiTei2BCA08abuUL8gfkeEETpLFJfPP63QHGpRXw= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Igor.Russkikh@aquantia.com; Received: from ubuntubox.rdc.aquantia.com (95.79.108.179) by BLUPR0701MB1650.namprd07.prod.outlook.com (2a01:111:e400:58c6::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.15; Thu, 13 Sep 2018 11:35:48 +0000 From: Igor Russkikh To: dev@dpdk.org Cc: pavel.belous@aquantia.com, igor.russkikh@aquantia.com Date: Thu, 13 Sep 2018 14:35:10 +0300 Message-Id: <1536838528-11800-3-git-send-email-igor.russkikh@aquantia.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1536838528-11800-1-git-send-email-igor.russkikh@aquantia.com> References: <1536838528-11800-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: VI1PR0202CA0026.eurprd02.prod.outlook.com (2603:10a6:803:14::39) To BLUPR0701MB1650.namprd07.prod.outlook.com (2a01:111:e400:58c6::20) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4a2de538-d549-49a8-6829-08d6196d0dce X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:BLUPR0701MB1650; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1650; 3:qU+2mhzzAaeQGiRXyjzw8qx/+BvNAmfhCosSVZP5KT212/BNi2k3MkOsJXxa0c90YEl0ZLF1QgwZhoPozpQ1+8UUHJ3w9VkSOGKzLbMxeA53m6ft+yNL7ElaphkjcgzRfZLMvLf5y/+LijEGp7q/vdFjSEGLwKlro9qS3nZ00QVanKzCRIoHJHwpLSqduf3sKo2jzJ698q2lkhelwODZ+5P++pPVyidC3CDmmV2qzxw4vHQhbdzsmalGLXSK8gad; 25:VaKMBPKZm/9twHAxpQ0gxa3OTMKMG0FtzNWYIjCB/z3NZumKRI5WzzE+izVSBayuDTgKnwX43CbYuii0cm8x/GbjIN/TnRJKhGmNuZQxvtMNrSkSi6g0IpCNFM9Lu0YvA1zPiekTCuSAPBe47nLp0+lJAk0NO0tN2bB0G69ssnSm9jYX6+/eyuneDyILK73UOy24VhpG0I7Voefx+2dFuYiqi2v9Ulm72XCVUwbm12NMfjJ0hCPUbEm1U7FJ1jWgCe4LhKB5ILI+3FwMGOZ3UvRO6p+KY9+HFuTx1M/C6Yy3SEnJg3aA/Nn1a3c1eNncm9EE3Nw3oUBBHzFnnyeg5w==; 31:LSHoIU+7EjVaciK7cI6W0zwihSWybKDJNGmbhy9ahIhi7qdc0FptsyWVsLHJWT5F+i517FVlfItpk3rmyZgjeIGR8vP1H58kZGs2yFHRqqtSNqU22jePhvdCzfIVaE7sDOsi2qZqazT0Al9y7m6PVnHtZbLOA/g0J3wOEnCq3+xM3m/OYdShBx/baNcd+XqosZqr+xjb9DLaoe5hiNI9szKW5MZ45Yzm4uPMk0L3zpw= X-MS-TrafficTypeDiagnostic: BLUPR0701MB1650: X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1650; 20:MhrsFsKCePBBFlmo9Ajt5kMAHo9pOGkHlAUeEazV76d4mGn4sc/uTQ7X+v+5dxSoz3QOuqTmCszzmmEsqv8UK/UUMyjMcsBF27qVCDbzfXRTg+bbbtX4HMK7dIq1kNkbXqgwl0R5B/rg50XacozlBK//XybfDoSWZMx4kczJNym1ctxUy9DDFsz9/qzb+Ks9D5VQx5jVp4/gRZz0PgzRsR4qChD4cKbq0jU7N1A56Wrlj13E1r5JebSTwuANiRKXU75oVqxtDvJlEDs/2XzH+rqbf8futf2EqVwYcBpIlCbKcdWo5ozsCPcgXQFsTR79Td9UEqz5Iba7qQkmnm8PqKtiwayn8Ox3AwVOWhXrtlneMyJFOjnubuo6q+BfBw3ycS5/4V5b7f8JYZkMbjeqOKYoO0nd3hrJnBs6UMhRrYtU2/o5YIZd++jeE86PahC5SKp9ygd9KCMrn1O2+Ag1fF3gOZfwOasgLx8t7cCO/y1bumlfGoEkJkJ/5/EY8IiR; 4:t4GNA7HNhGvGov4GDngMixDyspfoSsyp1NNoBJT0lRtBbEfN/DP8bEnb2tIYaaL4Qpq2R/zRxEcGUMzU4lDeaP4ghpj2rTAqm5/pf7AolkaNQtV0+LRlA27W8dbF+NE9o08dxAbD8WTXEnMdV2MAJGd1dylK9zk/mKzf1uCMVNtUx3I8MPpUcyWqDgZ8hqlEIR1Bj8sSOZ9BQQu0FUpzn3+0A4t/KlVICBKUOSuLApMWOkEIwd3LIvZ8n9wT+kFJKRGKYFcbriBeC4BwxmkorA== 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)(8121501046)(5005006)(93006095)(93001095)(3231311)(944501410)(52105095)(10201501046)(3002001)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(201708071742011)(7699050); SRVR:BLUPR0701MB1650; BCL:0; PCL:0; RULEID:; SRVR:BLUPR0701MB1650; X-Forefront-PRVS: 07943272E1 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39840400004)(366004)(396003)(376002)(136003)(346002)(199004)(189003)(6666003)(6916009)(97736004)(8936002)(68736007)(25786009)(50226002)(81166006)(81156014)(4326008)(107886003)(6486002)(51416003)(2906002)(53936002)(5660300001)(36756003)(86362001)(575784001)(316002)(52116002)(8676002)(16586007)(7736002)(305945005)(11346002)(446003)(476003)(956004)(47776003)(72206003)(66066001)(44832011)(478600001)(486006)(186003)(26005)(16526019)(386003)(48376002)(2351001)(106356001)(2361001)(2616005)(3846002)(105586002)(50466002)(7696005)(6116002)(76176011); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR0701MB1650; H:ubuntubox.rdc.aquantia.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: aquantia.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR0701MB1650; 23:vTl0EcvP8NDnjHSIAvyGyhGDdPg1/LwxoZxaXlw?= =?us-ascii?Q?tudQ51JCMo7wyRO/jcUnan3HbcJ5oBg9wbWKFVMLJzzdFeVxgcqOtj8ixjdh?= =?us-ascii?Q?xYCtXJ+jp2N9Nz/GOsFH+jC//XyIFTlZDhupmu2M+uVZEpCrgy1mZOIwLRVi?= =?us-ascii?Q?ZKC5tvKDSt3qzzf339jkqufBI+pEGgL9khiakcfiTb1R1GTAZuFEnRwttbQR?= =?us-ascii?Q?zRdRVfANUcQybCEtU25d7GUAPOTsbAITGEkdQNc7kvxTF3yy6kSjHhDmW5EY?= =?us-ascii?Q?TbMfDXPyhRp/7THWhIKMWlybNoeTjcUYBpydFZFDmXL5MNhAtsVDzwRRy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OwsBbTzANqM6+FAhR+728l4ppmEvbHXjXhTwkhRd7mZ1yvf0VHjURfj6B6MYWkqI2kddA8zTfMQULVU=; 7:bmxD6GD9hPzhnr3lTf4sqxnWnu1SmUM49ag909rfgpJQasx4AHfXnJ5wsPZy8pE1CVIvQaD1R+gzQppoM786C37HNyTpL1W5dKRSFXneKEdIJmnPmFWk5TqVQj4w4Fpecv3MRrSbue783vwc3qXxtiveD9YIt3R0KVPHxqWqadprji/3VcP0W/PfOMTvjdXQLUKdNt7kxZUnW3HTBn8kYETuxeQrH2aSj06yM79c1g2BpSfiGyCdJLHJs1LF3RnR SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: aquantia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Sep 2018 11:35:48.4356 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4a2de538-d549-49a8-6829-08d6196d0dce X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 83e2e134-991c-4ede-8ced-34d47e38e6b1 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0701MB1650 Subject: [dpdk-dev] [PATCH v2 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: Thu, 13 Sep 2018 11:35:51 -0000 Signed-off-by: Igor Russkikh --- drivers/net/atlantic/atl_ethdev.c | 18 +++++++++-- drivers/net/atlantic/atl_logs.h | 68 +++++++++++++++++++++++++++++++++++++++ drivers/net/atlantic/atl_types.h | 35 ++++++++++++++++++++ 3 files changed, 118 insertions(+), 3 deletions(-) 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 a1b1002ec..951e0f386 100644 --- a/drivers/net/atlantic/atl_ethdev.c +++ b/drivers/net/atlantic/atl_ethdev.c @@ -146,6 +146,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,17 +224,25 @@ atl_dev_start(struct rte_eth_dev *dev) !RTE_ETH_DEV_SRIOV(dev).active) && dev->data->dev_conf.intr_conf.rxq != 0) { intr_vector = dev->data->nb_rx_queues; - if (intr_vector > ATL_MAX_INTR_QUEUE_NUM) + 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)) + } + if (rte_intr_efd_enable(intr_handle, intr_vector)) { + PMD_INIT_LOG(ERR, "rte_intr_efd_enable failed"); return -1; + } } if (rte_intr_dp_is_en(intr_handle) && !intr_handle->intr_vec) { intr_handle->intr_vec = rte_zmalloc("intr_vec", dev->data->nb_rx_queues * sizeof(int), 0); - if (intr_handle->intr_vec == NULL) + 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; + } } return 0; diff --git a/drivers/net/atlantic/atl_logs.h b/drivers/net/atlantic/atl_logs.h new file mode 100644 index 000000000..b6e566190 --- /dev/null +++ b/drivers/net/atlantic/atl_logs.h @@ -0,0 +1,68 @@ +/* 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 + +#ifndef RTE_LIBRTE_ATLANTIC_DEBUG_RX +#define RTE_LIBRTE_ATLANTIC_DEBUG_RX 0 +#endif + +#ifndef RTE_LIBRTE_ATLANTIC_DEBUG_TX +#define RTE_LIBRTE_ATLANTIC_DEBUG_TX 0 +#endif + +#ifndef RTE_LIBRTE_ATLANTIC_DEBUG_TX_FREE +#define RTE_LIBRTE_ATLANTIC_DEBUG_TX_FREE 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..1684c8cd8 --- /dev/null +++ b/drivers/net/atlantic/atl_types.h @@ -0,0 +1,35 @@ +/* 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) + +/* Memory barrier */ +#define wmb() rte_wmb() + +#endif -- 2.13.3.windows.1