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
virtio: suport multiple MAC addresses
[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
1031baa
..
31431bb
100644
(file)
--- a/
app/test/test_distributor_perf.c
+++ b/
app/test/test_distributor_perf.c
@@
-33,7
+33,6
@@
#include "test.h"
#include "test.h"
-#ifdef RTE_LIBRTE_DISTRIBUTOR
#include <unistd.h>
#include <string.h>
#include <rte_cycles.h>
#include <unistd.h>
#include <string.h>
#include <rte_cycles.h>
@@
-74,7
+73,7
@@
static void
time_cache_line_switch(void)
{
/* allocate a full cache line for data, we use only first byte of it */
time_cache_line_switch(void)
{
/* allocate a full cache line for data, we use only first byte of it */
- uint64_t data[CACHE_LINE_SIZE*3 / sizeof(uint64_t)];
+ uint64_t data[
RTE_
CACHE_LINE_SIZE*3 / sizeof(uint64_t)];
unsigned i, slaveid = rte_get_next_lcore(rte_lcore_id(), 0, 0);
volatile uint64_t *pdata = &data[0];
unsigned i, slaveid = rte_get_next_lcore(rte_lcore_id(), 0, 0);
volatile uint64_t *pdata = &data[0];
@@
-160,7
+159,7
@@
perf_test(struct rte_distributor *d, struct rte_mempool *p)
}
/* ensure we have different hash value for each pkt */
for (i = 0; i < BURST; i++)
}
/* ensure we have different hash value for each pkt */
for (i = 0; i < BURST; i++)
- bufs[i]->
pkt.hash.rss
= i;
+ bufs[i]->
hash.usr
= i;
start = rte_rdtsc();
for (i = 0; i < (1<<ITER_POWER); i++)
start = rte_rdtsc();
for (i = 0; i < (1<<ITER_POWER); i++)
@@
-199,7
+198,7
@@
quit_workers(struct rte_distributor *d, struct rte_mempool *p)
quit = 1;
for (i = 0; i < num_workers; i++)
quit = 1;
for (i = 0; i < num_workers; i++)
- bufs[i]->
pkt.hash.rss
= i << 1;
+ bufs[i]->
hash.usr
= i << 1;
rte_distributor_process(d, bufs, num_workers);
rte_mempool_put_bulk(p, (void *)bufs, num_workers);
rte_distributor_process(d, bufs, num_workers);
rte_mempool_put_bulk(p, (void *)bufs, num_workers);
@@
-212,7
+211,7
@@
quit_workers(struct rte_distributor *d, struct rte_mempool *p)
#define MBUF_SIZE (2048 + sizeof(struct rte_mbuf) + RTE_PKTMBUF_HEADROOM)
#define MBUF_SIZE (2048 + sizeof(struct rte_mbuf) + RTE_PKTMBUF_HEADROOM)
-int
+
static
int
test_distributor_perf(void)
{
static struct rte_distributor *d;
test_distributor_perf(void)
{
static struct rte_distributor *d;
@@
-261,15
+260,8
@@
test_distributor_perf(void)
return 0;
}
return 0;
}
-#else
-
-#include <stdio.h>
-
-int
-test_distributor_perf(void)
-{
- printf("Distributor is not enabled in configuration\n");
- return 0;
-}
-
-#endif
+static struct test_command distributor_perf_cmd = {
+ .command = "distributor_perf_autotest",
+ .callback = test_distributor_perf,
+};
+REGISTER_TEST_COMMAND(distributor_perf_cmd);