git.droids-corp.org
/
dpdk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
eal: rename lcore master and slave
[dpdk.git]
/
drivers
/
net
/
ark
/
ark_pktchkr.c
diff --git
a/drivers/net/ark/ark_pktchkr.c
b/drivers/net/ark/ark_pktchkr.c
index
c21003a
..
b8fb694
100644
(file)
--- a/
drivers/net/ark/ark_pktchkr.c
+++ b/
drivers/net/ark/ark_pktchkr.c
@@
-7,6
+7,7
@@
#include <locale.h>
#include <unistd.h>
#include <locale.h>
#include <unistd.h>
+#include <rte_string_fns.h>
#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
@@
-84,7
+85,7
@@
ark_pktchkr_init(void *addr, int ord, int l2_mode)
rte_malloc("ark_pkt_chkr_inst",
sizeof(struct ark_pkt_chkr_inst), 0);
if (inst == NULL) {
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;
return inst;
}
inst->sregs = (struct ark_pkt_chkr_stat_regs *)addr;
@@
-129,10
+130,10
@@
ark_pktchkr_stop(ark_pkt_chkr_t handle)
while (!ark_pktchkr_stopped(handle) && (wait_cycle > 0)) {
usleep(1000);
wait_cycle--;
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);
}
inst->ordinal);
}
-
PMD_DEBUG
_LOG(DEBUG, "Pktchk %d stopped.\n", inst->ordinal);
+
ARK_PMD
_LOG(DEBUG, "Pktchk %d stopped.\n", inst->ordinal);
}
int
}
int
@@
-188,7
+189,7
@@
ark_pktchkr_wait_done(ark_pkt_chkr_t handle)
struct ark_pkt_chkr_inst *inst = (struct ark_pkt_chkr_inst *)handle;
if (ark_pktchkr_is_gen_forever(handle)) {
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;
}
" because gen_forever=1\n");
return -1;
}
@@
-197,10
+198,10
@@
ark_pktchkr_wait_done(ark_pkt_chkr_t handle)
while (!ark_pktchkr_stopped(handle) && (wait_cycle > 0)) {
usleep(1000);
wait_cycle--;
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);
" 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;
inst->ordinal);
}
return 0;
@@
-295,25
+296,25
@@
ark_pktchkr_dump_stats(ark_pkt_chkr_t handle)
{
struct ark_pkt_chkr_inst *inst = (struct ark_pkt_chkr_inst *)handle;
{
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);
inst->sregs->pkts_rcvd);
-
PMD_STATS
_LOG(INFO, "bytes_rcvd = (%'" PRIU64 ")\n",
+
ARK_PMD
_LOG(INFO, "bytes_rcvd = (%'" PRIU64 ")\n",
inst->sregs->bytes_rcvd);
inst->sregs->bytes_rcvd);
-
PMD_STATS
_LOG(INFO, "pkts_ok = (%'u)\n",
+
ARK_PMD
_LOG(INFO, "pkts_ok = (%'u)\n",
inst->sregs->pkts_ok);
inst->sregs->pkts_ok);
-
PMD_STATS
_LOG(INFO, "pkts_mismatch = (%'u)\n",
+
ARK_PMD
_LOG(INFO, "pkts_mismatch = (%'u)\n",
inst->sregs->pkts_mismatch);
inst->sregs->pkts_mismatch);
-
PMD_STATS
_LOG(INFO, "pkts_err = (%'u)\n",
+
ARK_PMD
_LOG(INFO, "pkts_err = (%'u)\n",
inst->sregs->pkts_err);
inst->sregs->pkts_err);
-
PMD_STATS
_LOG(INFO, "first_mismatch = (%'u)\n",
+
ARK_PMD
_LOG(INFO, "first_mismatch = (%'u)\n",
inst->sregs->first_mismatch);
inst->sregs->first_mismatch);
-
PMD_STATS
_LOG(INFO, "resync_events = (%'u)\n",
+
ARK_PMD
_LOG(INFO, "resync_events = (%'u)\n",
inst->sregs->resync_events);
inst->sregs->resync_events);
-
PMD_STATS
_LOG(INFO, "pkts_missing = (%'u)\n",
+
ARK_PMD
_LOG(INFO, "pkts_missing = (%'u)\n",
inst->sregs->pkts_missing);
inst->sregs->pkts_missing);
-
PMD_STATS
_LOG(INFO, "min_latency = (%'u)\n",
+
ARK_PMD
_LOG(INFO, "min_latency = (%'u)\n",
inst->sregs->min_latency);
inst->sregs->min_latency);
-
PMD_STATS
_LOG(INFO, "max_latency = (%'u)\n",
+
ARK_PMD
_LOG(INFO, "max_latency = (%'u)\n",
inst->sregs->max_latency);
}
inst->sregs->max_latency);
}
@@
-326,7
+327,7
@@
options(const char *id)
if (strcmp(id, toptions[i].opt) == 0)
return &toptions[i];
}
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;
"pktchkr: Could not find requested option!, option = %s\n",
id);
return NULL;
@@
-347,7
+348,7
@@
set_arg(char *arg, char *val)
o->v.INT = atoll(val);
break;
case OTSTRING:
o->v.INT = atoll(val);
break;
case OTSTRING:
- s
nprintf(o->v.STR, ARK_MAX_STR_LEN, "%s", val
);
+ s
trlcpy(o->v.STR, val, ARK_MAX_STR_LEN
);
break;
}
return 1;
break;
}
return 1;
@@
-442,7
+443,7
@@
ark_pktchkr_setup(ark_pkt_chkr_t handle)
ark_pktchkr_stop(handle);
if (options("run")->v.BOOL) {
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);
}
options("port")->v.INT);
ark_pktchkr_run(handle);
}