From: Igor Russkikh <igor.russkikh@aquantia.com>
To: dev@dpdk.org
Cc: pavel.belous@aquantia.com, Nadezhda.Krupnina@aquantia.com,
igor.russkikh@aquantia.com, Simon.Edelhaus@aquantia.com,
Corey Melton <comelton@cisco.com>,
Ashish Kumar <ashishk2@cisco.com>
Subject: [dpdk-dev] [PATCH 03/21] net/atlantic: logging macroes and some typedefs
Date: Fri, 7 Sep 2018 18:21:41 +0300 [thread overview]
Message-ID: <1536333719-32155-4-git-send-email-igor.russkikh@aquantia.com> (raw)
In-Reply-To: <1536333719-32155-1-git-send-email-igor.russkikh@aquantia.com>
Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
---
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 <rte_log.h>
+
+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 <stdint.h>
+#include <stddef.h>
+#include <inttypes.h>
+#include <string.h>
+#include <netinet/in.h>
+
+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
next prev parent reply other threads:[~2018-09-07 15:23 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-07 15:21 [dpdk-dev] [PATCH 00/21] net/atlantic: Aquantia aQtion 10G NIC Family DPDK PMD driver Igor Russkikh
2018-09-07 15:21 ` [dpdk-dev] [PATCH 01/21] net/atlantic: atlantic PMD driver skeleton Igor Russkikh
2018-09-11 17:02 ` Stephen Hemminger
2018-09-12 11:49 ` Igor Russkikh
2018-09-07 15:21 ` [dpdk-dev] [PATCH 02/21] net/atlantic: documentation and rel notes Igor Russkikh
2018-09-07 15:21 ` Igor Russkikh [this message]
2018-09-07 15:21 ` [dpdk-dev] [PATCH 04/21] net/atlantic: hw_atl register declarations Igor Russkikh
2018-09-11 17:04 ` Stephen Hemminger
2018-09-07 15:21 ` [dpdk-dev] [PATCH 05/21] net/atlantic: b0 hardware layer main logic Igor Russkikh
2018-09-11 17:04 ` Stephen Hemminger
2018-09-11 17:05 ` Stephen Hemminger
2018-09-07 15:21 ` [dpdk-dev] [PATCH 06/21] net/atlantic: firmware operations layer Igor Russkikh
2018-09-07 15:21 ` [dpdk-dev] [PATCH 07/21] net/atlantic: hardware register access routines Igor Russkikh
2018-09-24 6:29 ` Hemant
2018-09-24 9:00 ` Igor Russkikh
2018-09-07 15:21 ` [dpdk-dev] [PATCH 08/21] net/atlantic: rte device start, stop, initial configuration Igor Russkikh
2018-09-07 15:21 ` [dpdk-dev] [PATCH 09/21] net/atlantic: link status and interrupt management Igor Russkikh
2018-09-07 15:21 ` [dpdk-dev] [PATCH 10/21] net/atlantic: add hw adapter structures and defines Igor Russkikh
2018-09-07 15:21 ` [dpdk-dev] [PATCH 11/21] net/atlantic: RSS and RETA manipulation API Igor Russkikh
2018-09-07 15:21 ` [dpdk-dev] [PATCH 12/21] net/atlantic: flow control configuration Igor Russkikh
2018-09-07 15:21 ` [dpdk-dev] [PATCH 13/21] net/atlantic: MAC address manipulations Igor Russkikh
2018-09-07 15:21 ` [dpdk-dev] [PATCH 14/21] net/atlantic: eeprom and register manipulation routines Igor Russkikh
2018-09-07 15:21 ` [dpdk-dev] [PATCH 15/21] net/atlantic: LED control DPDK and private APIs Igor Russkikh
2018-09-07 15:21 ` [dpdk-dev] [PATCH 16/21] net/atlantic: promisc and allmulti configuration Igor Russkikh
2018-09-07 15:21 ` [dpdk-dev] [PATCH 17/21] net/atlantic: device statistics, xstats Igor Russkikh
2018-09-11 17:06 ` Stephen Hemminger
2018-09-07 15:21 ` [dpdk-dev] [PATCH 18/21] net/atlantic: VLAN filters and offloads Igor Russkikh
2018-09-07 15:21 ` [dpdk-dev] [PATCH 19/21] net/atlantic: device MTU and statuses Igor Russkikh
2018-09-07 15:21 ` [dpdk-dev] [PATCH 20/21] net/atlantic: RX side structures and implementation Igor Russkikh
2018-09-07 15:21 ` [dpdk-dev] [PATCH 21/21] net/atlantic: TX " Igor Russkikh
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1536333719-32155-4-git-send-email-igor.russkikh@aquantia.com \
--to=igor.russkikh@aquantia.com \
--cc=Nadezhda.Krupnina@aquantia.com \
--cc=Simon.Edelhaus@aquantia.com \
--cc=ashishk2@cisco.com \
--cc=comelton@cisco.com \
--cc=dev@dpdk.org \
--cc=pavel.belous@aquantia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).