numam-dpdk/drivers/net/ark/ark_pktdir.c
Ed Czeck 1502d443d8 net/ark: replace compile time log config with runtime
Use ARK_PMD_LOG in place of PMD_DRV_LOG, PMD_DEBUG_LOG, PMD_FUNC_LOG,
PMD_STATS_LOG, PMD_RX_LOG, and PMD_TX_LOG.
Review and adjust log levels and messages as needed.

Signed-off-by: Ed Czeck <ed.czeck@atomicrules.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-09-18 18:55:08 +02:00

57 lines
1.1 KiB
C

/* SPDX-License-Identifier: BSD-3-Clause
* Copyright (c) 2015-2018 Atomic Rules LLC
*/
#include <stdint.h>
#include <inttypes.h>
#include "ark_pktdir.h"
#include "ark_global.h"
#include "ark_logs.h"
ark_pkt_dir_t
ark_pktdir_init(void *base)
{
struct ark_pkt_dir_inst *inst =
rte_malloc("ark_pkt_dir_inst",
sizeof(struct ark_pkt_dir_inst),
0);
if (inst == NULL) {
ARK_PMD_LOG(ERR, "Failed to malloc ark_pkt_dir_inst.\n");
return inst;
}
inst->regs = (struct ark_pkt_dir_regs *)base;
inst->regs->ctrl = 0x00110110; /* POR state */
return inst;
}
void
ark_pktdir_uninit(ark_pkt_dir_t handle)
{
struct ark_pkt_dir_inst *inst = (struct ark_pkt_dir_inst *)handle;
rte_free(inst);
}
void
ark_pktdir_setup(ark_pkt_dir_t handle, uint32_t v)
{
struct ark_pkt_dir_inst *inst = (struct ark_pkt_dir_inst *)handle;
inst->regs->ctrl = v;
}
uint32_t
ark_pktdir_status(ark_pkt_dir_t handle)
{
struct ark_pkt_dir_inst *inst = (struct ark_pkt_dir_inst *)handle;
return inst->regs->ctrl;
}
uint32_t
ark_pktdir_stall_cnt(ark_pkt_dir_t handle)
{
struct ark_pkt_dir_inst *inst = (struct ark_pkt_dir_inst *)handle;
return inst->regs->stall_cnt;
}