Skip to content

Commit

Permalink
DPDK: update to 18.11.5.
Browse files Browse the repository at this point in the history
  • Loading branch information
jfb8856606 committed Nov 23, 2019
1 parent 7b0de5a commit 4b05018
Show file tree
Hide file tree
Showing 384 changed files with 4,027 additions and 2,613 deletions.
3 changes: 0 additions & 3 deletions dpdk/app/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ lib_execinfo = cc.find_library('execinfo', required: false)

default_cflags = machine_args

# specify -D_GNU_SOURCE unconditionally
default_cflags += '-D_GNU_SOURCE'

foreach app:apps
build = true
name = app
Expand Down
5 changes: 2 additions & 3 deletions dpdk/app/test-crypto-perf/cperf_test_latency.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ cperf_latency_test_runner(void *arg)
uint8_t burst_size_idx = 0;
uint32_t imix_idx = 0;

static int only_once;
static rte_atomic16_t display_once = RTE_ATOMIC16_INIT(0);

if (ctx == NULL)
return 0;
Expand Down Expand Up @@ -310,7 +310,7 @@ cperf_latency_test_runner(void *arg)
time_min = tunit*(double)(tsc_min) / tsc_hz;

if (ctx->options->csv) {
if (!only_once)
if (rte_atomic16_test_and_set(&display_once))
printf("\n# lcore, Buffer Size, Burst Size, Pakt Seq #, "
"Packet Size, cycles, time (us)");

Expand All @@ -325,7 +325,6 @@ cperf_latency_test_runner(void *arg)
/ tsc_hz);

}
only_once = 1;
} else {
printf("\n# Device %d on lcore %u\n", ctx->dev_id,
ctx->lcore_id);
Expand Down
10 changes: 4 additions & 6 deletions dpdk/app/test-crypto-perf/cperf_test_pmd_cyclecount.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#define PRETTY_HDR_FMT "%12s%12s%12s%12s%12s%12s%12s%12s%12s%12s\n\n"
#define PRETTY_LINE_FMT "%12u%12u%12u%12u%12u%12u%12u%12.0f%12.0f%12.0f\n"
#define CSV_HDR_FMT "%s,%s,%s,%s,%s,%s,%s,%s,%s,%s\n"
#define CSV_LINE_FMT "%10u;%10u;%u;%u;%u;%u;%u;%.f3;%.f3;%.f3\n"
#define CSV_LINE_FMT "%10u;%10u;%u;%u;%u;%u;%u;%.3f;%.3f;%.3f\n"

struct cperf_pmd_cyclecount_ctx {
uint8_t dev_id;
Expand Down Expand Up @@ -390,7 +390,7 @@ cperf_pmd_cyclecount_test_runner(void *test_ctx)
state.lcore = rte_lcore_id();
state.linearize = 0;

static int only_once;
static rte_atomic16_t display_once = RTE_ATOMIC16_INIT(0);
static bool warmup = true;

/*
Expand Down Expand Up @@ -436,13 +436,12 @@ cperf_pmd_cyclecount_test_runner(void *test_ctx)
}

if (!opts->csv) {
if (!only_once)
if (rte_atomic16_test_and_set(&display_once))
printf(PRETTY_HDR_FMT, "lcore id", "Buf Size",
"Burst Size", "Enqueued",
"Dequeued", "Enq Retries",
"Deq Retries", "Cycles/Op",
"Cycles/Enq", "Cycles/Deq");
only_once = 1;

printf(PRETTY_LINE_FMT, state.ctx->lcore_id,
opts->test_buffer_size, test_burst_size,
Expand All @@ -453,13 +452,12 @@ cperf_pmd_cyclecount_test_runner(void *test_ctx)
state.cycles_per_enq,
state.cycles_per_deq);
} else {
if (!only_once)
if (rte_atomic16_test_and_set(&display_once))
printf(CSV_HDR_FMT, "# lcore id", "Buf Size",
"Burst Size", "Enqueued",
"Dequeued", "Enq Retries",
"Deq Retries", "Cycles/Op",
"Cycles/Enq", "Cycles/Deq");
only_once = 1;

printf(CSV_LINE_FMT, state.ctx->lcore_id,
opts->test_buffer_size, test_burst_size,
Expand Down
8 changes: 3 additions & 5 deletions dpdk/app/test-crypto-perf/cperf_test_throughput.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ cperf_throughput_test_runner(void *test_ctx)
uint8_t burst_size_idx = 0;
uint32_t imix_idx = 0;

static int only_once;
static rte_atomic16_t display_once = RTE_ATOMIC16_INIT(0);

struct rte_crypto_op *ops[ctx->options->max_burst_size];
struct rte_crypto_op *ops_processed[ctx->options->max_burst_size];
Expand Down Expand Up @@ -261,13 +261,12 @@ cperf_throughput_test_runner(void *test_ctx)
ctx->options->total_ops);

if (!ctx->options->csv) {
if (!only_once)
if (rte_atomic16_test_and_set(&display_once))
printf("%12s%12s%12s%12s%12s%12s%12s%12s%12s%12s\n\n",
"lcore id", "Buf Size", "Burst Size",
"Enqueued", "Dequeued", "Failed Enq",
"Failed Deq", "MOps", "Gbps",
"Cycles/Buf");
only_once = 1;

printf("%12u%12u%12u%12"PRIu64"%12"PRIu64"%12"PRIu64
"%12"PRIu64"%12.4f%12.4f%12.2f\n",
Expand All @@ -282,12 +281,11 @@ cperf_throughput_test_runner(void *test_ctx)
throughput_gbps,
cycles_per_packet);
} else {
if (!only_once)
if (rte_atomic16_test_and_set(&display_once))
printf("#lcore id,Buffer Size(B),"
"Burst Size,Enqueued,Dequeued,Failed Enq,"
"Failed Deq,Ops(Millions),Throughput(Gbps),"
"Cycles/Buf\n\n");
only_once = 1;

printf("%u;%u;%u;%"PRIu64";%"PRIu64";%"PRIu64";%"PRIu64";"
"%.3f;%.3f;%.3f\n",
Expand Down
8 changes: 3 additions & 5 deletions dpdk/app/test-crypto-perf/cperf_test_verify.c
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ cperf_verify_test_runner(void *test_ctx)
uint64_t ops_deqd = 0, ops_deqd_total = 0, ops_deqd_failed = 0;
uint64_t ops_failed = 0;

static int only_once;
static rte_atomic16_t display_once = RTE_ATOMIC16_INIT(0);

uint64_t i;
uint16_t ops_unused = 0;
Expand Down Expand Up @@ -375,12 +375,11 @@ cperf_verify_test_runner(void *test_ctx)
}

if (!ctx->options->csv) {
if (!only_once)
if (rte_atomic16_test_and_set(&display_once))
printf("%12s%12s%12s%12s%12s%12s%12s%12s\n\n",
"lcore id", "Buf Size", "Burst size",
"Enqueued", "Dequeued", "Failed Enq",
"Failed Deq", "Failed Ops");
only_once = 1;

printf("%12u%12u%12u%12"PRIu64"%12"PRIu64"%12"PRIu64
"%12"PRIu64"%12"PRIu64"\n",
Expand All @@ -393,11 +392,10 @@ cperf_verify_test_runner(void *test_ctx)
ops_deqd_failed,
ops_failed);
} else {
if (!only_once)
if (rte_atomic16_test_and_set(&display_once))
printf("\n# lcore id, Buffer Size(B), "
"Burst Size,Enqueued,Dequeued,Failed Enq,"
"Failed Deq,Failed Ops\n");
only_once = 1;

printf("%10u;%10u;%u;%"PRIu64";%"PRIu64";%"PRIu64";%"PRIu64";"
"%"PRIu64"\n",
Expand Down
10 changes: 8 additions & 2 deletions dpdk/app/test-crypto-perf/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -627,9 +627,12 @@ main(int argc, char **argv)

if (i == total_nb_qps)
break;
rte_eal_wait_lcore(lcore_id);
ret |= rte_eal_wait_lcore(lcore_id);
i++;
}

if (ret != EXIT_SUCCESS)
goto err;
} else {

/* Get next size from range or list */
Expand All @@ -654,10 +657,13 @@ main(int argc, char **argv)

if (i == total_nb_qps)
break;
rte_eal_wait_lcore(lcore_id);
ret |= rte_eal_wait_lcore(lcore_id);
i++;
}

if (ret != EXIT_SUCCESS)
goto err;

/* Get next size from range or list */
if (opts.inc_buffer_size != 0)
opts.test_buffer_size += opts.inc_buffer_size;
Expand Down
32 changes: 21 additions & 11 deletions dpdk/app/test-eventdev/test_order_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ order_producer(void *arg)
int
order_opt_check(struct evt_options *opt)
{
if (opt->prod_type != EVT_PROD_TYPE_SYNT) {
evt_err("Invalid producer type");
return -EINVAL;
}

/* 1 producer + N workers + 1 master */
if (rte_lcore_count() < 3) {
evt_err("test need minimum 3 lcores");
Expand Down Expand Up @@ -298,12 +303,23 @@ order_event_dev_port_setup(struct evt_test *test, struct evt_options *opt,
int ret;
uint8_t port;
struct test_order *t = evt_test_priv(test);
struct rte_event_dev_info dev_info;

memset(&dev_info, 0, sizeof(struct rte_event_dev_info));
ret = rte_event_dev_info_get(opt->dev_id, &dev_info);
if (ret) {
evt_err("failed to get eventdev info %d", opt->dev_id);
return ret;
}

if (opt->wkr_deq_dep > dev_info.max_event_port_dequeue_depth)
opt->wkr_deq_dep = dev_info.max_event_port_dequeue_depth;

/* port configuration */
const struct rte_event_port_conf wkr_p_conf = {
const struct rte_event_port_conf p_conf = {
.dequeue_depth = opt->wkr_deq_dep,
.enqueue_depth = 64,
.new_event_threshold = 4096,
.enqueue_depth = dev_info.max_event_port_dequeue_depth,
.new_event_threshold = dev_info.max_num_events,
};

/* setup one port per worker, linking to all queues */
Expand All @@ -314,7 +330,7 @@ order_event_dev_port_setup(struct evt_test *test, struct evt_options *opt,
w->port_id = port;
w->t = t;

ret = rte_event_port_setup(opt->dev_id, port, &wkr_p_conf);
ret = rte_event_port_setup(opt->dev_id, port, &p_conf);
if (ret) {
evt_err("failed to setup port %d", port);
return ret;
Expand All @@ -326,20 +342,14 @@ order_event_dev_port_setup(struct evt_test *test, struct evt_options *opt,
return -EINVAL;
}
}
/* port for producer, no links */
const struct rte_event_port_conf prod_conf = {
.dequeue_depth = 8,
.enqueue_depth = 32,
.new_event_threshold = 1200,
};
struct prod_data *p = &t->prod;

p->dev_id = opt->dev_id;
p->port_id = port; /* last port */
p->queue_id = 0;
p->t = t;

ret = rte_event_port_setup(opt->dev_id, port, &prod_conf);
ret = rte_event_port_setup(opt->dev_id, port, &p_conf);
if (ret) {
evt_err("failed to setup producer port %d", port);
return ret;
Expand Down
3 changes: 2 additions & 1 deletion dpdk/app/test-eventdev/test_perf_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,8 @@ perf_opt_check(struct evt_options *opt, uint64_t nb_queues)
return -1;
}

if (opt->prod_type == EVT_PROD_TYPE_SYNT) {
if (opt->prod_type == EVT_PROD_TYPE_SYNT ||
opt->prod_type == EVT_PROD_TYPE_EVENT_TIMER_ADPTR) {
/* Validate producer lcores */
if (evt_lcores_has_overlap(opt->plcores,
rte_get_master_lcore())) {
Expand Down
33 changes: 26 additions & 7 deletions dpdk/app/test-pmd/cmdline.c
Original file line number Diff line number Diff line change
Expand Up @@ -2042,6 +2042,7 @@ cmd_config_rx_mode_flag_parsed(void *parsed_result,
{
struct cmd_config_rx_mode_flag *res = parsed_result;
portid_t pid;
int k;

if (!all_ports_stopped()) {
printf("Please stop all ports first\n");
Expand Down Expand Up @@ -2142,6 +2143,10 @@ cmd_config_rx_mode_flag_parsed(void *parsed_result,
return;
}
port->dev_conf.rxmode.offloads = rx_offloads;
/* Apply Rx offloads configuration */
for (k = 0; k < port->dev_info.max_rx_queues; k++)
port->rx_conf[k].offloads =
port->dev_conf.rxmode.offloads;
}

init_port_config();
Expand Down Expand Up @@ -4354,6 +4359,17 @@ csum_show(int port_id)
}
}

static void
cmd_config_queue_tx_offloads(struct rte_port *port)
{
int k;

/* Apply queue tx offloads configuration */
for (k = 0; k < port->dev_info.max_rx_queues; k++)
port->tx_conf[k].offloads =
port->dev_conf.txmode.offloads;
}

static void
cmd_csum_parsed(void *parsed_result,
__attribute__((unused)) struct cmdline *cl,
Expand Down Expand Up @@ -4438,6 +4454,7 @@ cmd_csum_parsed(void *parsed_result,
ports[res->port_id].dev_conf.txmode.offloads &=
(~csum_offloads);
}
cmd_config_queue_tx_offloads(&ports[res->port_id]);
}
csum_show(res->port_id);

Expand Down Expand Up @@ -4589,6 +4606,7 @@ cmd_tso_set_parsed(void *parsed_result,
printf("TSO segment size for non-tunneled packets is %d\n",
ports[res->port_id].tso_segsz);
}
cmd_config_queue_tx_offloads(&ports[res->port_id]);

/* display warnings if configuration is not supported by the NIC */
rte_eth_dev_info_get(res->port_id, &dev_info);
Expand Down Expand Up @@ -4744,6 +4762,7 @@ cmd_tunnel_tso_set_parsed(void *parsed_result,
"if outer L3 is IPv4; not necessary for IPv6\n");
}

cmd_config_queue_tx_offloads(&ports[res->port_id]);
cmd_reconfig_device_queue(res->port_id, 1, 1);
}

Expand Down Expand Up @@ -8348,32 +8367,32 @@ cmd_set_vf_rxmode_parsed(void *parsed_result,
__attribute__((unused)) void *data)
{
int ret = -ENOTSUP;
uint16_t rx_mode = 0;
uint16_t vf_rxmode = 0;
struct cmd_set_vf_rxmode *res = parsed_result;

int is_on = (strcmp(res->on, "on") == 0) ? 1 : 0;
if (!strcmp(res->what,"rxmode")) {
if (!strcmp(res->mode, "AUPE"))
rx_mode |= ETH_VMDQ_ACCEPT_UNTAG;
vf_rxmode |= ETH_VMDQ_ACCEPT_UNTAG;
else if (!strcmp(res->mode, "ROPE"))
rx_mode |= ETH_VMDQ_ACCEPT_HASH_UC;
vf_rxmode |= ETH_VMDQ_ACCEPT_HASH_UC;
else if (!strcmp(res->mode, "BAM"))
rx_mode |= ETH_VMDQ_ACCEPT_BROADCAST;
vf_rxmode |= ETH_VMDQ_ACCEPT_BROADCAST;
else if (!strncmp(res->mode, "MPE",3))
rx_mode |= ETH_VMDQ_ACCEPT_MULTICAST;
vf_rxmode |= ETH_VMDQ_ACCEPT_MULTICAST;
}

RTE_SET_USED(is_on);

#ifdef RTE_LIBRTE_IXGBE_PMD
if (ret == -ENOTSUP)
ret = rte_pmd_ixgbe_set_vf_rxmode(res->port_id, res->vf_id,
rx_mode, (uint8_t)is_on);
vf_rxmode, (uint8_t)is_on);
#endif
#ifdef RTE_LIBRTE_BNXT_PMD
if (ret == -ENOTSUP)
ret = rte_pmd_bnxt_set_vf_rxmode(res->port_id, res->vf_id,
rx_mode, (uint8_t)is_on);
vf_rxmode, (uint8_t)is_on);
#endif
if (ret < 0)
printf("bad VF receive mode parameter, return code = %d \n",
Expand Down
Loading

0 comments on commit 4b05018

Please sign in to comment.