From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM05-CO1-obe.outbound.protection.outlook.com (mail-eopbgr720056.outbound.protection.outlook.com [40.107.72.56]) by dpdk.org (Postfix) with ESMTP id 5A8F71B502 for ; Fri, 12 Oct 2018 13:09:08 +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=QWnvlqlfJ4IsoKUorapPPmPi4/lyrxMRcI3tPH4qxoU=; b=n+9qURg8f0nyjE5N4/f3GqHfVlmRfia47969TQJXzT0K6mXWtKh0zHPoTnYgiYTmUOSADRuJGQHOKTkkZWe6ZlyZgOZmjuUnLgDoTjWKF5V7I8+ip45BYPpCazetfxP7hm6IPqWf6Nz9JNVIkU7x9nc7ifl6YZ/RgZsWbL5wUWE= Received: from BY1PR0701MB1660.namprd07.prod.outlook.com (10.162.110.22) by BY1PR0701MB1879.namprd07.prod.outlook.com (10.162.143.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1207.26; Fri, 12 Oct 2018 11:09:06 +0000 Received: from BY1PR0701MB1660.namprd07.prod.outlook.com ([fe80::346d:e756:e70e:17]) by BY1PR0701MB1660.namprd07.prod.outlook.com ([fe80::346d:e756:e70e:17%3]) with mapi id 15.20.1228.020; Fri, 12 Oct 2018 11:09:06 +0000 From: Igor Russkikh To: "dev@dpdk.org" CC: Pavel Belous , Igor Russkikh , "ferruh.yigit@intel.com" Thread-Topic: [PATCH v6 02/22] net/atlantic: add logging structure Thread-Index: AQHUYhv9FGg2yK0mkke26HAgVbX44Q== Date: Fri, 12 Oct 2018 11:09:06 +0000 Message-ID: <1244aa0d2a52522e382b38c4792b7401f2fa4c87.1539338074.git.igor.russkikh@aquantia.com> References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM5PR0701CA0008.eurprd07.prod.outlook.com (2603:10a6:203:51::18) To BY1PR0701MB1660.namprd07.prod.outlook.com (2a01:111:e400:522a::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Igor.Russkikh@aquantia.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [95.79.108.179] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; BY1PR0701MB1879; 6:25aGtHIF1ggQnRal1P+CrCdu62LonB+3PYmcN/hdg2pFg3wdS5uuYExXbnULd/z0u96+oIksXIaBV+MbT2oimlMpQWEIrmxBkuC3FcxIVL+MoXNen5xDtRQ4RE/GTUpUnJwbIELZcGIAQOGx3MWdycO979tYHuZWA2mWhAhWELl8CN/31c8RJiexI+8D9JVDixv99ZogEXpfZ10czHWRXtRF+y20BAezrPavYdAq1jeI8Xsnk0AdrvtofxAQxuMytLKpNu74WkTDzls0/5iaPWhTx/mPxUwJsx9GJmW+54GkwUn/x5PPz6ASqXkxk2BATNhUn+hRZnnZwXwO/fnHCQDktKtQZdvDOp3Wxw1LEANwjqqnTICBRtl29x8q4YgH0y31yDQZOMhD6G/9Dj6BtIatusZckcfHRr1k8RqrqXRXtftc4Ni+nMfbnQnlOpr010vdgGfggYEueatTz3HUsvdPYv3DgH4zlm1/TWPN6uA=; 5:BKPkH7XP9SKi5DoUxhIetMAirXGy/Ob8X/8YdxThhFpVcb5HySSXjLEQvG9caiYfqqb3vwi8f9c4tOq/sG3P4InUcWtv0IC2tXOG/GNg9avE9R6H00slTfLyGvNDKMmgIU9ZjKiwXB3Tjof5uOZp350tQ1HXSvPkraEGrJLpUXk=; 7:K+dI/Zp1veUWc/XUzhfOZDSQ4L9FWm/RnMd2vs2aOC4gCoCzMTEzxHeLD/O4HNAnAz8AqviwMC3qZ2w12Brf3nmhdwZsUd/m2YaG/PbA9owjX3t7L1kcpyIQDYElzJO+WKQW6OsLaatjDKsH7H0V0bKT5IZhPeCrBBqghVLZIauqXdzv7VIQsFyLCFtIzDcJgTW/7D0b+bErWKD/e+BLe0NsEyIWeVqlAm47UeXlbrMac7esleFWDmGh44Ry1BTE x-ms-office365-filtering-correlation-id: f50aee4f-dec0-422a-f03e-08d630332011 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:BY1PR0701MB1879; x-ms-traffictypediagnostic: BY1PR0701MB1879: 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)(10201501046)(3002001)(3231355)(944501410)(52105095)(149066)(150057)(6041310)(20161123558120)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123560045)(201708071742011)(7699051)(76991067); SRVR:BY1PR0701MB1879; BCL:0; PCL:0; RULEID:; SRVR:BY1PR0701MB1879; x-forefront-prvs: 0823A5777B x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(376002)(366004)(136003)(39850400004)(396003)(189003)(199004)(6436002)(5640700003)(3846002)(68736007)(2900100001)(478600001)(6486002)(14454004)(2906002)(72206003)(71190400001)(71200400001)(26005)(2616005)(44832011)(102836004)(446003)(486006)(256004)(118296001)(186003)(105586002)(2351001)(6116002)(106356001)(6512007)(97736004)(6916009)(5660300001)(54906003)(6506007)(386003)(11346002)(476003)(14444005)(53936002)(5250100002)(2501003)(25786009)(8936002)(8676002)(4326008)(86362001)(305945005)(7736002)(99286004)(81166006)(1730700003)(81156014)(66066001)(52116002)(36756003)(316002)(76176011); DIR:OUT; SFP:1101; SCL:1; SRVR:BY1PR0701MB1879; H:BY1PR0701MB1660.namprd07.prod.outlook.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-antispam-message-info: vZIKBnj3jHuVfSrrQGuDouEIBDb2cbNQFXtM++hFBplnq4Xxt3uPGILNBZTMHVyaDEum9O2iDZV0jEDQPq+KsHCBHVLhkeXAhk9soX544igawhmKrl2bwWk0GOULF7IiWKL9I6xz/xoBLCMZfdvajh6Z1u4+zpkY6BL/0U2+Hq1+RgR3GO6BZwayjYAcv1ShuUH3nTnVxvuHJs/QWShzNsaB/+VR/2UjWslkkte2CbW45odNd/KaspQiNcHa1Br6RxfCZB3rAtNbWnVSZ1J4aQdatb7INc6OkNfxCKTwwcbnul8RdKcLwJHExvOnc0oDbakiVHEmLXloOG9bJIGpXNImZuxHEqD21cBZ+KNFMmk= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: aquantia.com X-MS-Exchange-CrossTenant-Network-Message-Id: f50aee4f-dec0-422a-f03e-08d630332011 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2018 11:09:06.4920 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 83e2e134-991c-4ede-8ced-34d47e38e6b1 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0701MB1879 Subject: [dpdk-dev] [PATCH v6 02/22] net/atlantic: add logging structure 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, 12 Oct 2018 11:09:09 -0000 Implement logging macroses for debug purposes. Signed-off-by: Igor Russkikh Signed-off-by: Pavel Belous --- drivers/net/atlantic/atl_ethdev.c | 14 ++++++++++++++ drivers/net/atlantic/atl_logs.h | 31 +++++++++++++++++++++++++++++++ drivers/net/atlantic/atl_types.h | 25 +++++++++++++++++++++++++ 3 files changed, 70 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_e= thdev.c index a9d7a5a49398..5b05ca180bc7 100644 --- a/drivers/net/atlantic/atl_ethdev.c +++ b/drivers/net/atlantic/atl_ethdev.c @@ -23,6 +23,9 @@ static int eth_atl_pci_remove(struct rte_pci_device *pci_= dev); static void atl_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info); =20 +int atl_logtype_init; +int atl_logtype_driver; + /* * The set of PCI devices this driver supports */ @@ -168,3 +171,14 @@ atl_dev_info_get(struct rte_eth_dev *dev, struct rte_e= th_dev_info *dev_info) RTE_PMD_REGISTER_PCI(net_atlantic, rte_atl_pmd); RTE_PMD_REGISTER_PCI_TABLE(net_atlantic, pci_id_atl_map); RTE_PMD_REGISTER_KMOD_DEP(net_atlantic, "* igb_uio | uio_pci_generic"); + +RTE_INIT(atl_init_log) +{ + atl_logtype_init =3D rte_log_register("pmd.net.atlantic.init"); + if (atl_logtype_init >=3D 0) + rte_log_set_level(atl_logtype_init, RTE_LOG_NOTICE); + atl_logtype_driver =3D rte_log_register("pmd.net.atlantic.driver"); + if (atl_logtype_driver >=3D 0) + rte_log_set_level(atl_logtype_driver, RTE_LOG_NOTICE); +} + diff --git a/drivers/net/atlantic/atl_logs.h b/drivers/net/atlantic/atl_log= s.h new file mode 100644 index 000000000000..e3dba334fe92 --- /dev/null +++ b/drivers/net/atlantic/atl_logs.h @@ -0,0 +1,31 @@ +/* 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; + +#define PMD_INIT_LOG(level, fmt, args...) \ + rte_log(RTE_LOG_ ## level, atl_logtype_init, \ + "%s(): " fmt "\n", __func__, ##args) + +#define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>") + +#define PMD_RX_LOG(level, fmt, args...) \ + RTE_LOG_DP(level, PMD, "%s(): " fmt "\n", __func__, ## args) + +#define PMD_TX_LOG(level, fmt, args...) \ + RTE_LOG_DP(level, PMD, "%s(): " fmt "\n", __func__, ## args) + +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_ty= pes.h new file mode 100644 index 000000000000..d8c2560807d3 --- /dev/null +++ b/drivers/net/atlantic/atl_types.h @@ -0,0 +1,25 @@ +/* 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; + +#define min(a, b) RTE_MIN(a, b) +#define max(a, b) RTE_MAX(a, b) + +#endif --=20 2.7.4