* **CONFIG_RTE_LIBRTE_ARK_PAD_TX** (default y): When enabled TX
packets are padded to 60 bytes to support downstream MACS.
- * **CONFIG_RTE_LIBRTE_ARK_DEBUG_RX** (default n): Enables or disables debug
- logging and internal checking of RX ingress logic within the ARK PMD driver.
-
- * **CONFIG_RTE_LIBRTE_ARK_DEBUG_TX** (default n): Enables or disables debug
- logging and internal checking of TX egress logic within the ARK PMD driver.
-
- * **CONFIG_RTE_LIBRTE_ARK_DEBUG_STATS** (default n): Enables or disables debug
- logging of detailed packet and performance statistics gathered in
- the PMD and FPGA.
-
- * **CONFIG_RTE_LIBRTE_ARK_DEBUG_TRACE** (default n): Enables or disables debug
- logging of detailed PMD events and status.
-
Building DPDK
-------------
{
uint32_t hw_const;
if (sizeof(struct ark_ddm_t) != ARK_DDM_EXPECTED_SIZE) {
- PMD_DRV_LOG(ERR, "ARK: DDM structure looks incorrect %d vs %zd\n",
+ ARK_PMD_LOG(ERR, "DDM structure looks incorrect %d vs %zd\n",
ARK_DDM_EXPECTED_SIZE, sizeof(struct ark_ddm_t));
return -1;
}
hw_const = ddm->cfg.const0;
if (hw_const == ARK_DDM_CONST1) {
- PMD_DRV_LOG(ERR,
+ ARK_PMD_LOG(ERR,
"ARK: DDM module is version 1, "
"PMD expects version 2\n");
return -1;
} else if (hw_const != ARK_DDM_CONST2) {
- PMD_DRV_LOG(ERR,
+ ARK_PMD_LOG(ERR,
"ARK: DDM module not found as expected 0x%08x\n",
ddm->cfg.const0);
return -1;
status = ark_ddm_stop(ddm, 1);
if (status != 0) {
- PMD_DEBUG_LOG(INFO, "%s stop failed doing forced reset\n",
+ ARK_PMD_LOG(NOTICE, "%s stop failed doing forced reset\n",
__func__);
ddm->cfg.command = 4;
usleep(10);
void
ark_ddm_dump(struct ark_ddm_t *ddm, const char *msg)
{
- PMD_FUNC_LOG(DEBUG, "%s Stopped: %d\n", msg,
+ ARK_PMD_LOG(DEBUG, "%s Stopped: %d\n", msg,
ark_ddm_is_stopped(ddm)
);
}
{
struct ark_ddm_stats_t *stats = &ddm->stats;
- PMD_STATS_LOG(INFO, "DDM Stats: %s"
+ ARK_PMD_LOG(INFO, "DDM Stats: %s"
ARK_SU64 ARK_SU64 ARK_SU64
"\n", msg,
"Bytes:", stats->tx_byte_count,
const char *dllpath = getenv("ARK_EXT_PATH");
if (dllpath == NULL) {
- PMD_DEBUG_LOG(DEBUG, "ARK EXT NO dll path specified\n");
+ ARK_PMD_LOG(DEBUG, "EXT NO dll path specified\n");
return 0;
}
- PMD_DRV_LOG(INFO, "ARK EXT found dll path at %s\n", dllpath);
+ ARK_PMD_LOG(NOTICE, "EXT found dll path at %s\n", dllpath);
/* Open and load the .so */
ark->d_handle = dlopen(dllpath, RTLD_LOCAL | RTLD_LAZY);
if (ark->d_handle == NULL) {
- PMD_DRV_LOG(ERR, "Could not load user extension %s\n",
+ ARK_PMD_LOG(ERR, "Could not load user extension %s\n",
dllpath);
return -1;
}
- PMD_DRV_LOG(INFO, "SUCCESS: loaded user extension %s\n",
+ ARK_PMD_LOG(DEBUG, "SUCCESS: loaded user extension %s\n",
dllpath);
/* Get the entry points */
ark->user_ext.dev_init =
(void *(*)(struct rte_eth_dev *, void *, int))
dlsym(ark->d_handle, "dev_init");
- PMD_DEBUG_LOG(DEBUG, "device ext init pointer = %p\n",
+ ARK_PMD_LOG(DEBUG, "device ext init pointer = %p\n",
ark->user_ext.dev_init);
ark->user_ext.dev_get_port_count =
(int (*)(struct rte_eth_dev *, void *))
ark->eth_dev = dev;
- PMD_FUNC_LOG(DEBUG, "\n");
+ ARK_PMD_LOG(DEBUG, "\n");
/* Check to see if there is an extension that we need to load */
ret = check_for_ext(ark);
(struct ark_rqpace_t *)(ark->bar0 + ARK_RCPACING_BASE);
ark->started = 0;
- PMD_DEBUG_LOG(INFO, "Sys Ctrl Const = 0x%x HW Commit_ID: %08x\n",
+ ARK_PMD_LOG(INFO, "Sys Ctrl Const = 0x%x HW Commit_ID: %08x\n",
ark->sysctrl.t32[4],
rte_be_to_cpu_32(ark->sysctrl.t32[0x20 / 4]));
- PMD_DRV_LOG(INFO, "Arkville HW Commit_ID: %08x\n",
+ ARK_PMD_LOG(NOTICE, "Arkville HW Commit_ID: %08x\n",
rte_be_to_cpu_32(ark->sysctrl.t32[0x20 / 4]));
/* If HW sanity test fails, return an error */
if (ark->sysctrl.t32[4] != 0xcafef00d) {
- PMD_DRV_LOG(ERR,
+ ARK_PMD_LOG(ERR,
"HW Sanity test has failed, expected constant"
" 0x%x, read 0x%x (%s)\n",
0xcafef00d,
}
if (ark->sysctrl.t32[3] != 0) {
if (ark_rqp_lasped(ark->rqpacing)) {
- PMD_DRV_LOG(ERR, "Arkville Evaluation System - "
+ ARK_PMD_LOG(ERR, "Arkville Evaluation System - "
"Timer has Expired\n");
return -1;
}
- PMD_DRV_LOG(WARNING, "Arkville Evaluation System - "
+ ARK_PMD_LOG(WARNING, "Arkville Evaluation System - "
"Timer is Running\n");
}
- PMD_DRV_LOG(INFO,
+ ARK_PMD_LOG(DEBUG,
"HW Sanity test has PASSED, expected constant"
" 0x%x, read 0x%x (%s)\n",
0xcafef00d, ark->sysctrl.t32[4], __func__);
dev->data->mac_addrs = rte_zmalloc("ark", RTE_ETHER_ADDR_LEN, 0);
if (!dev->data->mac_addrs) {
- PMD_DRV_LOG(ERR,
+ ARK_PMD_LOG(ERR,
"Failed to allocated memory for storing mac address"
);
}
ark->user_data[dev->data->port_id] =
ark->user_ext.dev_init(dev, ark->a_bar, 0);
if (!ark->user_data[dev->data->port_id]) {
- PMD_DRV_LOG(INFO,
+ ARK_PMD_LOG(WARNING,
"Failed to initialize PMD extension!"
" continuing without it\n");
memset(&ark->user_ext, 0, sizeof(struct ark_user_ext));
if (pci_dev->device.devargs)
ret = eth_ark_check_args(ark, pci_dev->device.devargs->args);
else
- PMD_DRV_LOG(INFO, "No Device args found\n");
+ ARK_PMD_LOG(INFO, "No Device args found\n");
if (ret)
goto error;
/* reserve an ethdev entry */
eth_dev = rte_eth_dev_allocate(name);
if (!eth_dev) {
- PMD_DRV_LOG(ERR,
+ ARK_PMD_LOG(ERR,
"Could not allocate eth_dev for port %d\n",
p);
goto error;
eth_dev->data->mac_addrs = rte_zmalloc(name,
RTE_ETHER_ADDR_LEN, 0);
if (!eth_dev->data->mac_addrs) {
- PMD_DRV_LOG(ERR,
+ ARK_PMD_LOG(ERR,
"Memory allocation for MAC failed!"
" Exiting.\n");
goto error;
/* UDM */
if (ark_udm_reset(ark->udm.v)) {
- PMD_DRV_LOG(ERR, "Unable to stop and reset UDM\n");
+ ARK_PMD_LOG(ERR, "Unable to stop and reset UDM\n");
return -1;
}
/* Keep in reset until the MPU are cleared */
/* TX -- DDM */
if (ark_ddm_stop(ark->ddm.v, 1))
- PMD_DRV_LOG(ERR, "Unable to stop DDM\n");
+ ARK_PMD_LOG(ERR, "Unable to stop DDM\n");
mpu = ark->mputx.v;
num_q = ark_api_num_queues(mpu);
static int
eth_ark_dev_configure(struct rte_eth_dev *dev)
{
- PMD_FUNC_LOG(DEBUG, "\n");
struct ark_adapter *ark = dev->data->dev_private;
eth_ark_dev_set_link_up(dev);
struct ark_adapter *ark = dev->data->dev_private;
int i;
- PMD_FUNC_LOG(DEBUG, "\n");
-
/* RX Side */
/* start UDM */
ark_udm_start(ark->udm.v);
* This is only used for sanity checking with internal generator
*/
if (pthread_create(&thread, NULL, delay_pg_start, ark)) {
- PMD_DRV_LOG(ERR, "Could not create pktgen "
+ ARK_PMD_LOG(ERR, "Could not create pktgen "
"starter thread\n");
return -1;
}
struct ark_adapter *ark = dev->data->dev_private;
struct ark_mpu_t *mpu;
- PMD_FUNC_LOG(DEBUG, "\n");
-
if (ark->started == 0)
return;
ark->started = 0;
status = eth_ark_tx_queue_stop(dev, i);
if (status != 0) {
uint16_t port = dev->data->port_id;
- PMD_DRV_LOG(ERR,
+ ARK_PMD_LOG(ERR,
"tx_queue stop anomaly"
" port %u, queue %u\n",
port, i);
break;
}
if (status || i != 0) {
- PMD_DRV_LOG(ERR, "DDM stop anomaly. status:"
+ ARK_PMD_LOG(ERR, "DDM stop anomaly. status:"
" %d iter: %u. (%s)\n",
status,
i,
break;
}
if (status || i != 0) {
- PMD_DRV_LOG(ERR, "UDM stop anomaly. status %d iter: %u. (%s)\n",
+ ARK_PMD_LOG(ERR, "UDM stop anomaly. status %d iter: %u. (%s)\n",
status, i, __func__);
ark_udm_dump(ark->udm.v, "Stop anomaly");
static int
eth_ark_dev_link_update(struct rte_eth_dev *dev, int wait_to_complete)
{
- PMD_DEBUG_LOG(DEBUG, "link status = %d\n",
+ ARK_PMD_LOG(DEBUG, "link status = %d\n",
dev->data->dev_link.link_status);
struct ark_adapter *ark = dev->data->dev_private;
process_pktdir_arg(const char *key, const char *value,
void *extra_args)
{
- PMD_FUNC_LOG(DEBUG, "key = %s, value = %s\n",
+ ARK_PMD_LOG(DEBUG, "key = %s, value = %s\n",
key, value);
struct ark_adapter *ark =
(struct ark_adapter *)extra_args;
ark->pkt_dir_v = strtol(value, NULL, 16);
- PMD_FUNC_LOG(DEBUG, "pkt_dir_v = 0x%x\n", ark->pkt_dir_v);
+ ARK_PMD_LOG(DEBUG, "pkt_dir_v = 0x%x\n", ark->pkt_dir_v);
return 0;
}
static inline int
process_file_args(const char *key, const char *value, void *extra_args)
{
- PMD_FUNC_LOG(DEBUG, "key = %s, value = %s\n",
+ ARK_PMD_LOG(DEBUG, "key = %s, value = %s\n",
key, value);
char *args = (char *)extra_args;
int first = 1;
if (file == NULL) {
- PMD_DRV_LOG(ERR, "Unable to open "
+ ARK_PMD_LOG(ERR, "Unable to open "
"config file %s\n", value);
return -1;
}
while (fgets(line, sizeof(line), file)) {
size += strlen(line);
if (size >= ARK_MAX_ARG_LEN) {
- PMD_DRV_LOG(ERR, "Unable to parse file %s args, "
+ ARK_PMD_LOG(ERR, "Unable to parse file %s args, "
"parameter list is too long\n", value);
fclose(file);
return -1;
strncat(args, line, ARK_MAX_ARG_LEN);
}
}
- PMD_FUNC_LOG(DEBUG, "file = %s\n", args);
+ ARK_PMD_LOG(DEBUG, "file = %s\n", args);
fclose(file);
return 0;
}
for (k_idx = 0; k_idx < kvlist->count; k_idx++) {
pair = &kvlist->pairs[k_idx];
- PMD_FUNC_LOG(DEBUG, "**** Arg passed to PMD = %s:%s\n",
+ ARK_PMD_LOG(DEBUG, "**** Arg passed to PMD = %s:%s\n",
pair->key,
pair->value);
}
ARK_PKTDIR_ARG,
&process_pktdir_arg,
ark) != 0) {
- PMD_DRV_LOG(ERR, "Unable to parse arg %s\n", ARK_PKTDIR_ARG);
+ ARK_PMD_LOG(ERR, "Unable to parse arg %s\n", ARK_PKTDIR_ARG);
goto free_kvlist;
}
ARK_PKTGEN_ARG,
&process_file_args,
ark->pkt_gen_args) != 0) {
- PMD_DRV_LOG(ERR, "Unable to parse arg %s\n", ARK_PKTGEN_ARG);
+ ARK_PMD_LOG(ERR, "Unable to parse arg %s\n", ARK_PKTGEN_ARG);
goto free_kvlist;
}
ARK_PKTCHKR_ARG,
&process_file_args,
ark->pkt_chkr_args) != 0) {
- PMD_DRV_LOG(ERR, "Unable to parse arg %s\n", ARK_PKTCHKR_ARG);
+ ARK_PMD_LOG(ERR, "Unable to parse arg %s\n", ARK_PKTCHKR_ARG);
goto free_kvlist;
}
- PMD_DRV_LOG(INFO, "packet director set to 0x%x\n", ark->pkt_dir_v);
+ ARK_PMD_LOG(INFO, "packet director set to 0x%x\n", ark->pkt_dir_v);
/* Setup the packet director */
ark_pktdir_setup(ark->pd, ark->pkt_dir_v);
/* Setup the packet generator */
if (ark->pkt_gen_args[0]) {
- PMD_DRV_LOG(INFO, "Setting up the packet generator\n");
+ ARK_PMD_LOG(DEBUG, "Setting up the packet generator\n");
ark_pktgen_parse(ark->pkt_gen_args);
ark_pktgen_reset(ark->pg);
ark_pktgen_setup(ark->pg);
/* Verify HW */
if (ark_mpu_verify(queue->mpu, sizeof(rte_iova_t))) {
- PMD_DRV_LOG(ERR, "Illegal configuration rx queue\n");
+ ARK_PMD_LOG(ERR, "Illegal configuration rx queue\n");
return -1;
}
if (rx_conf != NULL && warning1 == 0) {
warning1 = 1;
- PMD_DRV_LOG(INFO,
+ ARK_PMD_LOG(NOTICE,
"Arkville ignores rte_eth_rxconf argument.\n");
}
if (RTE_PKTMBUF_HEADROOM < ARK_RX_META_SIZE) {
- PMD_DRV_LOG(ERR,
+ ARK_PMD_LOG(ERR,
"Error: DPDK Arkville requires head room > %d bytes (%s)\n",
ARK_RX_META_SIZE, __func__);
return -1; /* ERROR CODE */
}
if (!rte_is_power_of_2(nb_desc)) {
- PMD_DRV_LOG(ERR,
+ ARK_PMD_LOG(ERR,
"DPDK Arkville configuration queue size must be power of two %u (%s)\n",
nb_desc, __func__);
return -1; /* ERROR CODE */
64,
socket_id);
if (queue == 0) {
- PMD_DRV_LOG(ERR, "Failed to allocate memory in %s\n", __func__);
+ ARK_PMD_LOG(ERR, "Failed to allocate memory in %s\n", __func__);
return -ENOMEM;
}
socket_id);
if (queue->reserve_q == 0 || queue->paddress_q == 0) {
- PMD_DRV_LOG(ERR,
+ ARK_PMD_LOG(ERR,
"Failed to allocate queue memory in %s\n",
__func__);
rte_free(queue->reserve_q);
status = eth_ark_rx_seed_mbufs(queue);
if (queue->seed_index != nb_desc) {
- PMD_DRV_LOG(ERR, "ARK: Failed to allocate %u mbufs for RX queue %d\n",
+ ARK_PMD_LOG(ERR, "Failed to allocate %u mbufs for RX queue %d\n",
nb_desc, qidx);
status = -1;
}
if (unlikely(status != 0)) {
struct rte_mbuf **mbuf;
- PMD_DRV_LOG(ERR, "Failed to initialize RX queue %d %s\n",
+ ARK_PMD_LOG(ERR, "Failed to initialize RX queue %d %s\n",
qidx,
__func__);
/* Free the mbufs allocated */
mbuf->timestamp = meta->timestamp;
mbuf->udata64 = meta->user_data;
- if (ARK_RX_DEBUG) { /* debug sanity checks */
+ if (ARK_DEBUG_CORE) { /* debug sanity checks */
if ((meta->pkt_len > (1024 * 16)) ||
(meta->pkt_len == 0)) {
- PMD_RX_LOG(DEBUG, "RX: Bad Meta Q: %u"
+ ARK_PMD_LOG(DEBUG, "RX: Bad Meta Q: %u"
" cons: %" PRIU32
" prod: %" PRIU32
" seed_index %" PRIU32
queue->seed_index);
- PMD_RX_LOG(DEBUG, " : UDM"
+ ARK_PMD_LOG(DEBUG, " : UDM"
" prod: %" PRIU32
" len: %u\n",
queue->udm->rt_cfg.prod_idx,
mbuf_prev = mbuf;
mbuf->data_len = data_len;
mbuf->data_off = 0;
- if (ARK_RX_DEBUG)
+ if (ARK_DEBUG_CORE)
mbuf->seqn = cons_index; /* for debug only */
cons_index += 1;
}
}
- if (ARK_RX_DEBUG) { /* DEBUG */
+ if (ARK_DEBUG_CORE) { /* DEBUG */
while (count != nb) {
struct rte_mbuf *mbuf_init =
queue->reserve_q[seed_m + count];
*pnb = 64U;
status = rte_pktmbuf_alloc_bulk(queue->mb_pool, mbufs, *pnb);
if (status != 0) {
- PMD_DRV_LOG(ERR,
+ ARK_PMD_LOG(NOTICE,
"ARK: Could not allocate %u mbufs from pool for RX queue %u;"
" %u free buffers remaining in queue\n",
*pnb, queue->queue_index,
if (!ark_udm_is_flushed(ark->udm.v)) {
/* restart the MPUs */
- PMD_DRV_LOG(ERR, "ARK: %s UDM not flushed\n", __func__);
+ ARK_PMD_LOG(NOTICE, "UDM not flushed -- forcing flush\n");
for (i = 0; i < dev->data->nb_rx_queues; i++) {
queue = (struct ark_rx_queue *)dev->data->rx_queues[i];
if (queue == 0)
/* Wait to allow data to pass */
usleep(100);
- PMD_DEBUG_LOG(DEBUG, "UDM forced flush attempt, stopped = %d\n",
+ ARK_PMD_LOG(DEBUG, "UDM forced flush attempt, stopped = %d\n",
ark_udm_is_flushed(ark->udm.v));
}
ark_udm_reset(ark->udm.v);
{
if (queue == NULL)
return;
- PMD_DEBUG_LOG(DEBUG, "RX QUEUE %d -- %s", queue->phys_qid, name);
- PMD_DEBUG_LOG(DEBUG, ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32 "\n",
+ ARK_PMD_LOG(DEBUG, "RX QUEUE %d -- %s", queue->phys_qid, name);
+ ARK_PMD_LOG(DEBUG, ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32 "\n",
"queue_size", queue->queue_size,
"seed_index", queue->seed_index,
"prod_index", queue->prod_index,
{
uint16_t i, j;
- PMD_DRV_LOG(INFO, " MBUF: %p len %d, off: %d, seq: %" PRIU32 "\n", mbuf,
- mbuf->pkt_len, mbuf->data_off, mbuf->seqn);
+ ARK_PMD_LOG(DEBUG, " MBUF: %p len %d, off: %d, seq: %" PRIU32 "\n",
+ mbuf, mbuf->pkt_len, mbuf->data_off, mbuf->seqn);
for (i = lo; i < hi; i += 16) {
uint8_t *dp = RTE_PTR_ADD(mbuf->buf_addr, i);
- PMD_DRV_LOG(INFO, " %6d: ", i);
+ ARK_PMD_LOG(DEBUG, " %6d: ", i);
for (j = 0; j < 16; j++)
- PMD_DRV_LOG(INFO, " %02x", dp[j]);
+ ARK_PMD_LOG(DEBUG, " %02x", dp[j]);
- PMD_DRV_LOG(INFO, "\n");
+ ARK_PMD_LOG(DEBUG, "\n");
}
}
}
}
- if (ARK_TX_DEBUG && (nb != nb_pkts)) {
- PMD_TX_LOG(DEBUG, "TX: Failure to send:"
+ if (ARK_DEBUG_CORE && nb != nb_pkts) {
+ ARK_PMD_LOG(DEBUG, "TX: Failure to send:"
" req: %" PRIU32
" sent: %" PRIU32
" prod: %" PRIU32
int qidx = queue_idx;
if (!rte_is_power_of_2(nb_desc)) {
- PMD_DRV_LOG(ERR,
+ ARK_PMD_LOG(ERR,
"DPDK Arkville configuration queue size"
" must be power of two %u (%s)\n",
nb_desc, __func__);
64,
socket_id);
if (queue == 0) {
- PMD_DRV_LOG(ERR, "Failed to allocate tx "
+ ARK_PMD_LOG(ERR, "Failed to allocate tx "
"queue memory in %s\n",
__func__);
return -ENOMEM;
socket_id);
if (queue->meta_q == 0 || queue->bufs == 0) {
- PMD_DRV_LOG(ERR, "Failed to allocate "
+ ARK_PMD_LOG(ERR, "Failed to allocate "
"queue memory in %s\n", __func__);
rte_free(queue->meta_q);
rte_free(queue->bufs);
extern int ark_logtype;
-#define PMD_DRV_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ##level, ark_logtype, fmt, ## args)
+#define ARK_PMD_LOG(level, fmt, args...) \
+ rte_log(RTE_LOG_ ##level, ark_logtype, "ARK: " fmt, ## args)
-/* Conditional trace definitions */
-#define ARK_TRACE_ON(level, fmt, args...) \
- PMD_DRV_LOG(level, fmt, ## args)
-/* This pattern allows compiler check arguments even if disabled */
-#define ARK_TRACE_OFF(level, fmt, args...) \
- do { \
- if (0) \
- PMD_DRV_LOG(level, fmt, ## args); \
- } while (0)
-
-/* tracing including the function name */
-#define ARK_FUNC_ON(level, fmt, args...) \
- PMD_DRV_LOG(level, "%s(): " fmt, __func__, ## args)
-
-/* tracing including the function name */
-#define ARK_FUNC_OFF(level, fmt, args...) \
- do { \
- if (0) \
- PMD_DRV_LOG(level, "%s(): " fmt, __func__, ## args); \
- } while (0)
-
-
-/* Debug macro for tracing full behavior, function tracing and messages*/
-#ifdef RTE_LIBRTE_ARK_DEBUG_TRACE
-#define PMD_FUNC_LOG(level, fmt, ...) ARK_FUNC_ON(level, fmt, ##__VA_ARGS__)
-#define PMD_DEBUG_LOG(level, fmt, ...) ARK_TRACE_ON(level, fmt, ##__VA_ARGS__)
-#else
-#define PMD_FUNC_LOG(level, fmt, ...) ARK_FUNC_OFF(level, fmt, ##__VA_ARGS__)
-#define PMD_DEBUG_LOG(level, fmt, ...) ARK_TRACE_OFF(level, fmt, ##__VA_ARGS__)
-#endif
-
-
-/* Debug macro for reporting FPGA statistics */
-#ifdef RTE_LIBRTE_ARK_DEBUG_STATS
-#define PMD_STATS_LOG(level, fmt, ...) ARK_TRACE_ON(level, fmt, ##__VA_ARGS__)
-#else
-#define PMD_STATS_LOG(level, fmt, ...) ARK_TRACE_OFF(level, fmt, ##__VA_ARGS__)
-#endif
-
-
-/* Debug macro for RX path */
-#ifdef RTE_LIBRTE_ARK_DEBUG_RX
-#define ARK_RX_DEBUG 1
-#define PMD_RX_LOG(level, fmt, ...) ARK_TRACE_ON(level, fmt, ##__VA_ARGS__)
-#else
-#define ARK_RX_DEBUG 0
-#define PMD_RX_LOG(level, fmt, ...) ARK_TRACE_OFF(level, fmt, ##__VA_ARGS__)
-#endif
-
-/* Debug macro for TX path */
-#ifdef RTE_LIBRTE_ARK_DEBUG_TX
-#define ARK_TX_DEBUG 1
-#define PMD_TX_LOG(level, fmt, ...) ARK_TRACE_ON(level, fmt, ##__VA_ARGS__)
+/* Debug macro to enable core debug code */
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#define ARK_DEBUG_CORE 1
#else
-#define ARK_TX_DEBUG 0
-#define PMD_TX_LOG(level, fmt, ...) ARK_TRACE_OFF(level, fmt, ##__VA_ARGS__)
+#define ARK_DEBUG_CORE 0
#endif
#endif
if ((mpu->id.idnum != 0x2055504d) ||
(mpu->hw.obj_size != obj_size) ||
(version != 0x00003100)) {
- PMD_DRV_LOG(ERR,
+ ARK_PMD_LOG(ERR,
" MPU module not found as expected %08x"
" \"%c%c%c%c %c%c%c%c\"\n",
mpu->id.idnum,
mpu->id.id[2], mpu->id.id[3],
mpu->id.ver[0], mpu->id.ver[1],
mpu->id.ver[2], mpu->id.ver[3]);
- PMD_DRV_LOG(ERR,
+ ARK_PMD_LOG(ERR,
" MPU HW num_queues: %u hw_depth %u,"
" obj_size: %u, obj_per_mrr: %u"
" Expected size %u\n",
ark_mpu_reset(mpu);
if (!rte_is_power_of_2(ring_size)) {
- PMD_DRV_LOG(ERR, "ARK: Invalid ring size for MPU %d\n",
+ ARK_PMD_LOG(ERR, "Invalid ring size for MPU %d\n",
ring_size);
return -1;
}
ark_mpu_dump(struct ark_mpu_t *mpu, const char *code, uint16_t qid)
{
/* DUMP to see that we have started */
- PMD_DEBUG_LOG(DEBUG, "MPU: %s Q: %3u sw_prod %u, hw_cons: %u\n",
+ ARK_PMD_LOG(DEBUG, "MPU: %s Q: %3u sw_prod %u, hw_cons: %u\n",
code, qid,
mpu->cfg.sw_prod_index, mpu->cfg.hw_cons_index);
- PMD_DEBUG_LOG(DEBUG, "MPU: %s state: %d count %d, reserved %d"
- " data 0x%08x_%08x 0x%08x_%08x\n",
+ ARK_PMD_LOG(DEBUG, "MPU: %s state: %d count %d, reserved %d"
+ "\n",
code,
mpu->debug.state, mpu->debug.count,
- mpu->debug.reserved,
- mpu->debug.peek[1],
- mpu->debug.peek[0],
- mpu->debug.peek[3],
- mpu->debug.peek[2]
- );
- PMD_STATS_LOG(INFO, "MPU: %s Q: %3u"
- ARK_SU64 ARK_SU64 ARK_SU64 ARK_SU64
- ARK_SU64 ARK_SU64 ARK_SU64 "\n",
- code, qid,
- "PCI Request:", mpu->stats.pci_request,
- "Queue_empty", mpu->stats.q_empty,
- "Queue_q1", mpu->stats.q_q1,
- "Queue_q2", mpu->stats.q_q2,
- "Queue_q3", mpu->stats.q_q3,
- "Queue_q4", mpu->stats.q_q4,
- "Queue_full", mpu->stats.q_full
+ mpu->debug.reserved
);
}
void
ark_mpu_dump_setup(struct ark_mpu_t *mpu, uint16_t q_id)
{
- PMD_DEBUG_LOG(DEBUG, "MPU Setup Q: %u"
+ ARK_PMD_LOG(DEBUG, "MPU Setup Q: %u"
ARK_SU64X "\n",
q_id,
"ring_base", mpu->cfg.ring_base
rte_malloc("ark_pkt_chkr_inst",
sizeof(struct ark_pkt_chkr_inst), 0);
if (inst == NULL) {
- PMD_DRV_LOG(ERR, "Failed to malloc ark_pkt_chkr_inst.\n");
+ ARK_PMD_LOG(ERR, "Failed to malloc ark_pkt_chkr_inst.\n");
return inst;
}
inst->sregs = (struct ark_pkt_chkr_stat_regs *)addr;
while (!ark_pktchkr_stopped(handle) && (wait_cycle > 0)) {
usleep(1000);
wait_cycle--;
- PMD_DEBUG_LOG(DEBUG, "Waiting for pktchk %d to stop...\n",
+ ARK_PMD_LOG(DEBUG, "Waiting for pktchk %d to stop...\n",
inst->ordinal);
}
- PMD_DEBUG_LOG(DEBUG, "Pktchk %d stopped.\n", inst->ordinal);
+ ARK_PMD_LOG(DEBUG, "Pktchk %d stopped.\n", inst->ordinal);
}
int
struct ark_pkt_chkr_inst *inst = (struct ark_pkt_chkr_inst *)handle;
if (ark_pktchkr_is_gen_forever(handle)) {
- PMD_DEBUG_LOG(ERR, "Pktchk wait_done will not terminate"
+ ARK_PMD_LOG(NOTICE, "Pktchk wait_done will not terminate"
" because gen_forever=1\n");
return -1;
}
while (!ark_pktchkr_stopped(handle) && (wait_cycle > 0)) {
usleep(1000);
wait_cycle--;
- PMD_DEBUG_LOG(DEBUG, "Waiting for packet checker %d's"
+ ARK_PMD_LOG(DEBUG, "Waiting for packet checker %d's"
" internal pktgen to finish sending...\n",
inst->ordinal);
- PMD_DEBUG_LOG(DEBUG, "Pktchk %d's pktgen done.\n",
+ ARK_PMD_LOG(DEBUG, "Pktchk %d's pktgen done.\n",
inst->ordinal);
}
return 0;
{
struct ark_pkt_chkr_inst *inst = (struct ark_pkt_chkr_inst *)handle;
- PMD_STATS_LOG(INFO, "pkts_rcvd = (%'u)\n",
+ ARK_PMD_LOG(INFO, "pkts_rcvd = (%'u)\n",
inst->sregs->pkts_rcvd);
- PMD_STATS_LOG(INFO, "bytes_rcvd = (%'" PRIU64 ")\n",
+ ARK_PMD_LOG(INFO, "bytes_rcvd = (%'" PRIU64 ")\n",
inst->sregs->bytes_rcvd);
- PMD_STATS_LOG(INFO, "pkts_ok = (%'u)\n",
+ ARK_PMD_LOG(INFO, "pkts_ok = (%'u)\n",
inst->sregs->pkts_ok);
- PMD_STATS_LOG(INFO, "pkts_mismatch = (%'u)\n",
+ ARK_PMD_LOG(INFO, "pkts_mismatch = (%'u)\n",
inst->sregs->pkts_mismatch);
- PMD_STATS_LOG(INFO, "pkts_err = (%'u)\n",
+ ARK_PMD_LOG(INFO, "pkts_err = (%'u)\n",
inst->sregs->pkts_err);
- PMD_STATS_LOG(INFO, "first_mismatch = (%'u)\n",
+ ARK_PMD_LOG(INFO, "first_mismatch = (%'u)\n",
inst->sregs->first_mismatch);
- PMD_STATS_LOG(INFO, "resync_events = (%'u)\n",
+ ARK_PMD_LOG(INFO, "resync_events = (%'u)\n",
inst->sregs->resync_events);
- PMD_STATS_LOG(INFO, "pkts_missing = (%'u)\n",
+ ARK_PMD_LOG(INFO, "pkts_missing = (%'u)\n",
inst->sregs->pkts_missing);
- PMD_STATS_LOG(INFO, "min_latency = (%'u)\n",
+ ARK_PMD_LOG(INFO, "min_latency = (%'u)\n",
inst->sregs->min_latency);
- PMD_STATS_LOG(INFO, "max_latency = (%'u)\n",
+ ARK_PMD_LOG(INFO, "max_latency = (%'u)\n",
inst->sregs->max_latency);
}
if (strcmp(id, toptions[i].opt) == 0)
return &toptions[i];
}
- PMD_DRV_LOG(ERR,
+ ARK_PMD_LOG(ERR,
"pktchkr: Could not find requested option!, option = %s\n",
id);
return NULL;
ark_pktchkr_stop(handle);
if (options("run")->v.BOOL) {
- PMD_DEBUG_LOG(DEBUG, "Starting packet checker on port %d\n",
+ ARK_PMD_LOG(DEBUG, "Starting packet checker on port %d\n",
options("port")->v.INT);
ark_pktchkr_run(handle);
}
sizeof(struct ark_pkt_dir_inst),
0);
if (inst == NULL) {
- PMD_DRV_LOG(ERR, "Failed to malloc ark_pkt_dir_inst.\n");
+ ARK_PMD_LOG(ERR, "Failed to malloc ark_pkt_dir_inst.\n");
return inst;
}
inst->regs = (struct ark_pkt_dir_regs *)base;
rte_malloc("ark_pkt_gen_inst_pmd",
sizeof(struct ark_pkt_gen_inst), 0);
if (inst == NULL) {
- PMD_DRV_LOG(ERR, "Failed to malloc ark_pkt_gen_inst.\n");
+ ARK_PMD_LOG(ERR, "Failed to malloc ark_pkt_gen_inst.\n");
return inst;
}
inst->regs = (struct ark_pkt_gen_regs *)adr;
while (!ark_pktgen_paused(handle)) {
usleep(1000);
if (cnt++ > 100) {
- PMD_DRV_LOG(ERR, "Pktgen %d failed to pause.\n",
+ ARK_PMD_LOG(NOTICE, "Pktgen %d failed to pause.\n",
inst->ordinal);
break;
}
}
- PMD_DEBUG_LOG(DEBUG, "Pktgen %d paused.\n", inst->ordinal);
+ ARK_PMD_LOG(DEBUG, "Pktgen %d paused.\n", inst->ordinal);
}
void
if (!ark_pktgen_is_running(handle) &&
!ark_pktgen_paused(handle)) {
- PMD_DEBUG_LOG(DEBUG, "Pktgen %d is not running"
+ ARK_PMD_LOG(DEBUG, "Pktgen %d is not running"
" and is not paused. No need to reset.\n",
inst->ordinal);
return;
if (ark_pktgen_is_running(handle) &&
!ark_pktgen_paused(handle)) {
- PMD_DEBUG_LOG(DEBUG,
+ ARK_PMD_LOG(DEBUG,
"Pktgen %d is not paused. Pausing first.\n",
inst->ordinal);
ark_pktgen_pause(handle);
}
- PMD_DEBUG_LOG(DEBUG, "Resetting pktgen %d.\n", inst->ordinal);
+ ARK_PMD_LOG(DEBUG, "Resetting pktgen %d.\n", inst->ordinal);
inst->regs->pkt_start_stop = (1 << 8);
}
int wait_cycle = 10;
if (ark_pktgen_is_gen_forever(handle))
- PMD_DRV_LOG(ERR, "Pktgen wait_done will not terminate"
+ ARK_PMD_LOG(NOTICE, "Pktgen wait_done will not terminate"
" because gen_forever=1\n");
while (!ark_pktgen_tx_done(handle) && (wait_cycle > 0)) {
usleep(1000);
wait_cycle--;
- PMD_DEBUG_LOG(DEBUG,
+ ARK_PMD_LOG(DEBUG,
"Waiting for pktgen %d to finish sending...\n",
inst->ordinal);
}
- PMD_DEBUG_LOG(DEBUG, "Pktgen %d done.\n", inst->ordinal);
+ ARK_PMD_LOG(DEBUG, "Pktgen %d done.\n", inst->ordinal);
}
uint32_t
return &toptions[i];
}
- PMD_DRV_LOG(ERR,
+ ARK_PMD_LOG(ERR,
"Pktgen: Could not find requested option!, "
"option = %s\n",
id
if (options("reset")->v.BOOL)
ark_pktgen_reset(handle);
if (options("run")->v.BOOL) {
- PMD_DEBUG_LOG(DEBUG, "Starting packet generator on port %d\n",
+ ARK_PMD_LOG(DEBUG, "Starting packet generator on port %d\n",
options("port")->v.INT);
ark_pktgen_run(handle);
}
ark_rqp_dump(struct ark_rqpace_t *rqp)
{
if (rqp->err_count_other != 0)
- PMD_DRV_LOG(ERR,
+ ARK_PMD_LOG(ERR,
"RQP Errors noted: ctrl: %d cplh_hmax %d cpld_max %d"
ARK_SU32
ARK_SU32 "\n",
"Error Count", rqp->err_cnt,
"Error General", rqp->err_count_other);
- PMD_STATS_LOG(INFO, "RQP Dump: ctrl: %d cplh_hmax %d cpld_max %d"
+ ARK_PMD_LOG(INFO, "RQP Dump: ctrl: %d cplh_hmax %d cpld_max %d"
ARK_SU32
ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32
ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32
ark_udm_verify(struct ark_udm_t *udm)
{
if (sizeof(struct ark_udm_t) != ARK_UDM_EXPECT_SIZE) {
- PMD_DRV_LOG(ERR,
+ ARK_PMD_LOG(ERR,
"ARK: UDM structure looks incorrect %d vs %zd\n",
ARK_UDM_EXPECT_SIZE, sizeof(struct ark_udm_t));
return -1;
}
if (udm->setup.const0 != ARK_UDM_CONST) {
- PMD_DRV_LOG(ERR,
+ ARK_PMD_LOG(ERR,
"ARK: UDM module not found as expected 0x%08x\n",
udm->setup.const0);
return -1;
status = ark_udm_stop(udm, 1);
if (status != 0) {
- PMD_DEBUG_LOG(INFO, "%s stop failed doing forced reset\n",
+ ARK_PMD_LOG(NOTICE, "%s stop failed doing forced reset\n",
__func__);
udm->cfg.command = 4;
usleep(10);
udm->cfg.command = 3;
status = ark_udm_stop(udm, 0);
- PMD_DEBUG_LOG(INFO, "%s stop status %d post failure"
+ ARK_PMD_LOG(INFO, "%s stop status %d post failure"
" and forced reset\n",
__func__, status);
} else {
void
ark_udm_dump_stats(struct ark_udm_t *udm, const char *msg)
{
- PMD_STATS_LOG(INFO, "UDM Stats: %s"
+ ARK_PMD_LOG(INFO, "UDM Stats: %s"
ARK_SU64 ARK_SU64 ARK_SU64 ARK_SU64 ARK_SU64 "\n",
msg,
"Pkts Received", udm->stats.rx_packet_count,
void
ark_udm_dump_queue_stats(struct ark_udm_t *udm, const char *msg, uint16_t qid)
{
- PMD_STATS_LOG(INFO, "UDM Queue %3u Stats: %s"
+ ARK_PMD_LOG(INFO, "UDM Queue %3u Stats: %s"
ARK_SU64 ARK_SU64
ARK_SU64 ARK_SU64
ARK_SU64 "\n",
void
ark_udm_dump(struct ark_udm_t *udm, const char *msg)
{
- PMD_DEBUG_LOG(DEBUG, "UDM Dump: %s Stopped: %d\n", msg,
+ ARK_PMD_LOG(DEBUG, "UDM Dump: %s Stopped: %d\n", msg,
udm->cfg.stop_flushed);
}
void
ark_udm_dump_setup(struct ark_udm_t *udm, uint16_t q_id)
{
- PMD_DEBUG_LOG(DEBUG, "UDM Setup Q: %u"
+ ARK_PMD_LOG(DEBUG, "UDM Setup Q: %u"
ARK_SU64X ARK_SU32 "\n",
q_id,
"hw_prod_addr", udm->rt_cfg.hw_prod_addr,
{
struct ark_udm_pcibp_t *bp = &udm->pcibp;
- PMD_STATS_LOG(INFO, "UDM Performance %s"
+ ARK_PMD_LOG(INFO, "UDM Performance %s"
ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32
"\n",
msg,