From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0068.outbound.protection.outlook.com [104.47.42.68]) by dpdk.org (Postfix) with ESMTP id 2ACDB1B13D for ; Tue, 9 Oct 2018 11:31:33 +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=GB2+Eah14NSoBNEGA/XgQLGAxsoUw2Pl5AOB42NpISA=; b=XllPnWZSsMsFI1OVoF+tl4ZU/rK+0jXn8RSaCEOEqsTmVQBsVgO8mdXRfk7KX8cP+dprsJmA91geYRze9U12VE+symgDW/g1litBb7n+JlO6UOrfLjbj8iZcAjJq8ZDvOzPL+tIvQ3HenyplDbhe+QQHZZL12lktu8KZb0+jEg0= Received: from BLUPR0701MB1651.namprd07.prod.outlook.com (10.163.84.21) by BLUPR0701MB2100.namprd07.prod.outlook.com (10.163.122.158) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1207.27; Tue, 9 Oct 2018 09:31:31 +0000 Received: from BLUPR0701MB1651.namprd07.prod.outlook.com ([fe80::7c97:1527:4c0:8b46]) by BLUPR0701MB1651.namprd07.prod.outlook.com ([fe80::7c97:1527:4c0:8b46%3]) with mapi id 15.20.1207.024; Tue, 9 Oct 2018 09:31:31 +0000 From: Igor Russkikh To: "dev@dpdk.org" CC: Pavel Belous , Igor Russkikh , "ferruh.yigit@intel.com" , Pavel Belous Thread-Topic: [PATCH v4 02/22] net/atlantic: logging macroes and some typedefs Thread-Index: AQHUX7LcgyziyvpgFki6zqBcJJ9Eng== Date: Tue, 9 Oct 2018 09:31:30 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM0PR01CA0028.eurprd01.prod.exchangelabs.com (2603:10a6:208:69::41) To BLUPR0701MB1651.namprd07.prod.outlook.com (2a01:111:e400:58c6::21) 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; BLUPR0701MB2100; 6:GsSnfnljFNOANe21snV1D+qg3zaVwWrAMAZmZ3O8IUCopXcFXfPpQEmdKRLOtj0zq3TnYqMz0dgWQg8BEUa1432vRzorLH/ALgbZBRyl6VxbBtwFKShEwl1/FP7iqiwGyp+4SC6noaHGqiMVpzamFCrpL1e/zPTXstgW+R7C17zsZe/6xQ+xyWhZTW1PmPnpv3gvN2ey+n6SLFUbyZJl3sqAMyIFmMZ1IJBFJNV9UKa74t9cYrL16q/uKiAZBTXUGY98/RiC5U+pNf5G8E1jFZtEJaCtvt4IKtff+coc7t5QRis4LT6CfgK8TpZOWlsXpFE+e6+c36p1vRO03lYOWYYm68zaNtiUFRiaQt57XD3Xh/N5vnywV9jMSTK/GUyxsK3c6DBjbxYJum6EcuQPtHDOHWNaqw4mv5152vnCwpicRz7mvmz1HR7sdQ4wLPGbJTq9VantI04UGF8ZYVbPMg==; 5:/eRxglZSamBM+UWpwhasqYKc2IK6ThIVyKW76wgZX/V/RVO2NNQu8N0FpgZTiSVRpYMizEm+1O3gPEXOE/XLfSjvDDSwRyO/UNbJT4ZejmKzhridzjNK9RNP2YC1atSxa7F5iZxgJxhmFu2DNvMxRkiMdpJtr5qjBhKdbH3phtI=; 7:c+2lRWv7JICz087B9t1WvGGyPpXcavTmo/hqyePHnPFDYJzhXQNow9MirMWYytdkfq2WqP1vE1AbC6dNedM/7d6D6cOVp0W00B26bRqDKMk6VKFbcRnqrpDmPcDd4+QZTNsybNkYao8JQV049+BgJGSiObPC7XAYv2q4LXDipapC0kQ8mbqe2XakjcgEs7jytR1xEwH80Udi4y9NGXsCoPGaOiHNawrVVL+5V8FInGv3MrsepKdVU73YliddOcPP x-ms-office365-filtering-correlation-id: af7054ff-b5b5-46fb-956b-08d62dc9fe9c x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:BLUPR0701MB2100; x-ms-traffictypediagnostic: BLUPR0701MB2100: 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)(3231355)(944501410)(52105095)(3002001)(93006095)(93001095)(10201501046)(149066)(150057)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(201708071742011)(7699051); SRVR:BLUPR0701MB2100; BCL:0; PCL:0; RULEID:; SRVR:BLUPR0701MB2100; x-forefront-prvs: 08200063E9 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(366004)(376002)(346002)(39850400004)(396003)(189003)(199004)(305945005)(36756003)(25786009)(5250100002)(476003)(86362001)(72206003)(2351001)(5660300001)(6916009)(446003)(478600001)(44832011)(11346002)(2906002)(106356001)(7736002)(486006)(4326008)(3846002)(6116002)(105586002)(97736004)(2616005)(256004)(26005)(186003)(66066001)(2501003)(6512007)(316002)(53936002)(102836004)(76176011)(14454004)(5640700003)(107886003)(118296001)(71190400001)(52116002)(68736007)(71200400001)(8936002)(2900100001)(8676002)(1730700003)(81156014)(81166006)(99286004)(54906003)(6436002)(6506007)(386003)(6486002); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR0701MB2100; H:BLUPR0701MB1651.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: Q/u4HXo2zZwTpCPu01a6AE2mHKF0prYEsjdfw/aX9AckOLLcMIgEqdDxO+mxFTfUzpSnr7zst5WZb2qlNprMVTobFQYARwSTM23HWwfcytkXSCn+VpKHYIlGnlBTN3fafmMiPwt3FCjzqgfhjm6+BDvRxJBV5gtxMCIHGr7eGVSEbo3Y/xhO5Vuqr6pCW7+RYn/xle4gVqrrh9p0ullmddS6TGsqu2gIzOjBao3OtEGJZRkMsoqGN6sV6jUncEXhhTsxyY6IgTViQh2/JyI3zv6tn5XpaSfEkPAL8Vq5sWgLGtJwGEMDZNVN8bUlYGrMtspD4t8gale4BW57EZTu3yhriDAz2LD77IYXtRe1o5s= 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: af7054ff-b5b5-46fb-956b-08d62dc9fe9c X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Oct 2018 09:31:30.6988 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 83e2e134-991c-4ede-8ced-34d47e38e6b1 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0701MB2100 Subject: [dpdk-dev] [PATCH v4 02/22] 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: Tue, 09 Oct 2018 09:31:33 -0000 Signed-off-by: Igor Russkikh Signed-off-by: Pavel Belous --- drivers/net/atlantic/atl_ethdev.c | 16 ++++++++++++++++ drivers/net/atlantic/atl_logs.h | 31 +++++++++++++++++++++++++++++++ drivers/net/atlantic/atl_types.h | 25 +++++++++++++++++++++++++ 3 files changed, 72 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..2e0331d987c3 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,16 @@ 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); +static void +atl_init_log(void) +{ + atl_logtype_init =3D rte_log_register("pmd.atlantic.init"); + if (atl_logtype_init >=3D 0) + rte_log_set_level(atl_logtype_init, RTE_LOG_DEBUG); + atl_logtype_driver =3D rte_log_register("pmd.atlantic.driver"); + if (atl_logtype_driver >=3D 0) + rte_log_set_level(atl_logtype_driver, RTE_LOG_DEBUG); +} + 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