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/sfc: rename array of SW stats descriptions
[dpdk.git]
/
app
/
test
/
test_distributor_perf.c
diff --git
a/app/test/test_distributor_perf.c
b/app/test/test_distributor_perf.c
index
edf1998
..
fdbeae6
100644
(file)
--- a/
app/test/test_distributor_perf.c
+++ b/
app/test/test_distributor_perf.c
@@
-25,7
+25,7
@@
static volatile unsigned worker_idx;
struct worker_stats {
volatile unsigned handled_packets;
} __rte_cache_aligned;
struct worker_stats {
volatile unsigned handled_packets;
} __rte_cache_aligned;
-struct worker_stats worker_stats[RTE_MAX_LCORE];
+st
atic st
ruct worker_stats worker_stats[RTE_MAX_LCORE];
/*
* worker thread used for testing the time to do a round-trip of a cache
/*
* worker thread used for testing the time to do a round-trip of a cache
@@
-54,10
+54,10
@@
time_cache_line_switch(void)
/* allocate a full cache line for data, we use only first byte of it */
uint64_t data[RTE_CACHE_LINE_SIZE*3 / sizeof(uint64_t)];
/* allocate a full cache line for data, we use only first byte of it */
uint64_t data[RTE_CACHE_LINE_SIZE*3 / sizeof(uint64_t)];
- unsigned i
, slave
id = rte_get_next_lcore(rte_lcore_id(), 0, 0);
+ unsigned i
nt i, worker
id = rte_get_next_lcore(rte_lcore_id(), 0, 0);
volatile uint64_t *pdata = &data[0];
*pdata = 1;
volatile uint64_t *pdata = &data[0];
*pdata = 1;
- rte_eal_remote_launch((lcore_function_t *)flip_bit, &data[0],
slave
id);
+ rte_eal_remote_launch((lcore_function_t *)flip_bit, &data[0],
worker
id);
while (*pdata)
rte_pause();
while (*pdata)
rte_pause();
@@
-72,7
+72,7
@@
time_cache_line_switch(void)
while (*pdata)
rte_pause();
*pdata = 2;
while (*pdata)
rte_pause();
*pdata = 2;
- rte_eal_wait_lcore(
slave
id);
+ rte_eal_wait_lcore(
worker
id);
printf("==== Cache line switch test ===\n");
printf("Time for %u iterations = %"PRIu64" ticks\n", (1<<ITER_POWER_CL),
end_time-start_time);
printf("==== Cache line switch test ===\n");
printf("Time for %u iterations = %"PRIu64" ticks\n", (1<<ITER_POWER_CL),
end_time-start_time);
@@
-111,7
+111,7
@@
handle_work(void *arg)
unsigned int count = 0;
unsigned int num = 0;
int i;
unsigned int count = 0;
unsigned int num = 0;
int i;
- unsigned int id = __
sync_fetch_and_add(&worker_idx, 1
);
+ unsigned int id = __
atomic_fetch_add(&worker_idx, 1, __ATOMIC_RELAXED
);
struct rte_mbuf *buf[8] __rte_cache_aligned;
for (i = 0; i < 8; i++)
struct rte_mbuf *buf[8] __rte_cache_aligned;
for (i = 0; i < 8; i++)
@@
-188,13
+188,15
@@
quit_workers(struct rte_distributor *d, struct rte_mempool *p)
rte_mempool_get_bulk(p, (void *)bufs, num_workers);
quit = 1;
rte_mempool_get_bulk(p, (void *)bufs, num_workers);
quit = 1;
- for (i = 0; i < num_workers; i++)
+ for (i = 0; i < num_workers; i++)
{
bufs[i]->hash.usr = i << 1;
bufs[i]->hash.usr = i << 1;
- rte_distributor_process(d, bufs, num_workers);
+ rte_distributor_process(d, &bufs[i], 1);
+ }
rte_mempool_put_bulk(p, (void *)bufs, num_workers);
rte_distributor_process(d, NULL, 0);
rte_mempool_put_bulk(p, (void *)bufs, num_workers);
rte_distributor_process(d, NULL, 0);
+ rte_distributor_flush(d);
rte_eal_mp_wait_lcore();
quit = 0;
worker_idx = 0;
rte_eal_mp_wait_lcore();
quit = 0;
worker_idx = 0;
@@
-208,8
+210,8
@@
test_distributor_perf(void)
static struct rte_mempool *p;
if (rte_lcore_count() < 2) {
static struct rte_mempool *p;
if (rte_lcore_count() < 2) {
- printf("
ERROR: not enough cores to test distributor
\n");
- return
-1
;
+ printf("
Not enough cores for distributor_perf_autotest, expecting at least 2
\n");
+ return
TEST_SKIPPED
;
}
/* first time how long it takes to round-trip a cache line */
}
/* first time how long it takes to round-trip a cache line */
@@
-251,13
+253,13
@@
test_distributor_perf(void)
}
printf("=== Performance test of distributor (single mode) ===\n");
}
printf("=== Performance test of distributor (single mode) ===\n");
- rte_eal_mp_remote_launch(handle_work, ds, SKIP_MA
STER
);
+ rte_eal_mp_remote_launch(handle_work, ds, SKIP_MA
IN
);
if (perf_test(ds, p) < 0)
return -1;
quit_workers(ds, p);
printf("=== Performance test of distributor (burst mode) ===\n");
if (perf_test(ds, p) < 0)
return -1;
quit_workers(ds, p);
printf("=== Performance test of distributor (burst mode) ===\n");
- rte_eal_mp_remote_launch(handle_work, db, SKIP_MA
STER
);
+ rte_eal_mp_remote_launch(handle_work, db, SKIP_MA
IN
);
if (perf_test(db, p) < 0)
return -1;
quit_workers(db, p);
if (perf_test(db, p) < 0)
return -1;
quit_workers(db, p);