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
net/txgbe: support VF promiscuous and allmulticast
[dpdk.git]
/
drivers
/
net
/
ark
/
ark_pktgen.c
diff --git
a/drivers/net/ark/ark_pktgen.c
b/drivers/net/ark/ark_pktgen.c
index
2a2b428
..
ac4322a
100644
(file)
--- a/
drivers/net/ark/ark_pktgen.c
+++ b/
drivers/net/ark/ark_pktgen.c
@@
-7,9
+7,10
@@
#include <locale.h>
#include <unistd.h>
#include <locale.h>
#include <unistd.h>
+#include <rte_string_fns.h>
#include <rte_eal.h>
#include <rte_eal.h>
-#include <
rte_
ethdev_driver.h>
+#include <ethdev_driver.h>
#include <rte_malloc.h>
#include "ark_pktgen.h"
#include <rte_malloc.h>
#include "ark_pktgen.h"
@@
-82,7
+83,7
@@
ark_pktgen_init(void *adr, int ord, int l2_mode)
rte_malloc("ark_pkt_gen_inst_pmd",
sizeof(struct ark_pkt_gen_inst), 0);
if (inst == NULL) {
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;
return inst;
}
inst->regs = (struct ark_pkt_gen_regs *)adr;
@@
-125,12
+126,12
@@
ark_pktgen_pause(ark_pkt_gen_t handle)
while (!ark_pktgen_paused(handle)) {
usleep(1000);
if (cnt++ > 100) {
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;
}
}
inst->ordinal);
break;
}
}
-
PMD_DEBUG
_LOG(DEBUG, "Pktgen %d paused.\n", inst->ordinal);
+
ARK_PMD
_LOG(DEBUG, "Pktgen %d paused.\n", inst->ordinal);
}
void
}
void
@@
-140,7
+141,7
@@
ark_pktgen_reset(ark_pkt_gen_t handle)
if (!ark_pktgen_is_running(handle) &&
!ark_pktgen_paused(handle)) {
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;
" and is not paused. No need to reset.\n",
inst->ordinal);
return;
@@
-148,13
+149,13
@@
ark_pktgen_reset(ark_pkt_gen_t handle)
if (ark_pktgen_is_running(handle) &&
!ark_pktgen_paused(handle)) {
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);
}
"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);
}
inst->regs->pkt_start_stop = (1 << 8);
}
@@
-192,17
+193,17
@@
ark_pktgen_wait_done(ark_pkt_gen_t handle)
int wait_cycle = 10;
if (ark_pktgen_is_gen_forever(handle))
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--;
" 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);
}
"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
}
uint32_t
@@
-305,7
+306,7
@@
options(const char *id)
return &toptions[i];
}
return &toptions[i];
}
-
PMD_DRV
_LOG(ERR,
+
ARK_PMD
_LOG(ERR,
"Pktgen: Could not find requested option!, "
"option = %s\n",
id
"Pktgen: Could not find requested option!, "
"option = %s\n",
id
@@
-329,7
+330,7
@@
pmd_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;
@@
-464,7
+465,7
@@
ark_pktgen_setup(ark_pkt_gen_t handle)
if (options("reset")->v.BOOL)
ark_pktgen_reset(handle);
if (options("run")->v.BOOL) {
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);
}
options("port")->v.INT);
ark_pktgen_run(handle);
}