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
mbuf: fix performance with 128-byte cache line
[dpdk.git]
/
app
/
test
/
test_table.h
diff --git
a/app/test/test_table.h
b/app/test/test_table.h
index
afea738
..
84d1845
100644
(file)
--- a/
app/test/test_table.h
+++ b/
app/test/test_table.h
@@
-65,7
+65,7
@@
#define PORT_TX_RING_SIZE 512
#define RING_RX_SIZE 128
#define RING_TX_SIZE 128
#define PORT_TX_RING_SIZE 512
#define RING_RX_SIZE 128
#define RING_TX_SIZE 128
-#define POOL_BUFFER_SIZE
(2048 + sizeof(struct rte_mbuf) + RTE_PKTMBUF_HEADROOM)
+#define POOL_BUFFER_SIZE
RTE_MBUF_DEFAULT_BUF_SIZE
#define POOL_SIZE (32 * 1024)
#define POOL_CACHE_SIZE 256
#define BURST_SIZE 8
#define POOL_SIZE (32 * 1024)
#define POOL_CACHE_SIZE 256
#define BURST_SIZE 8
@@
-73,12
+73,13
@@
#define MAX_DUMMY_PORTS 2
#define MP_NAME "dummy_port_mempool"
#define MBUF_COUNT (8000 * MAX_DUMMY_PORTS)
#define MAX_DUMMY_PORTS 2
#define MP_NAME "dummy_port_mempool"
#define MBUF_COUNT (8000 * MAX_DUMMY_PORTS)
-#define MBUF_SIZE (2048 + sizeof(struct rte_mbuf) + RTE_PKTMBUF_HEADROOM)
#define MP_CACHE_SZ 256
#define MP_SOCKET 0
#define MP_FLAGS 0
/* Macros */
#define MP_CACHE_SZ 256
#define MP_SOCKET 0
#define MP_FLAGS 0
/* Macros */
+#define APP_METADATA_OFFSET(offset) (sizeof(struct rte_mbuf) + (offset))
+
#define RING_ENQUEUE(ring, value) do { \
struct rte_mbuf *m; \
uint32_t *k32, *signature; \
#define RING_ENQUEUE(ring, value) do { \
struct rte_mbuf *m; \
uint32_t *k32, *signature; \
@@
-87,8
+88,10
@@
m = rte_pktmbuf_alloc(pool); \
if (m == NULL) \
return -1; \
m = rte_pktmbuf_alloc(pool); \
if (m == NULL) \
return -1; \
- signature = RTE_MBUF_METADATA_UINT32_PTR(m, 0); \
- key = RTE_MBUF_METADATA_UINT8_PTR(m, 32); \
+ signature = RTE_MBUF_METADATA_UINT32_PTR(m, \
+ APP_METADATA_OFFSET(0)); \
+ key = RTE_MBUF_METADATA_UINT8_PTR(m, \
+ APP_METADATA_OFFSET(32)); \
k32 = (uint32_t *) key; \
k32[0] = (value); \
*signature = pipeline_test_hash(key, 0, 0); \
k32 = (uint32_t *) key; \
k32[0] = (value); \
*signature = pipeline_test_hash(key, 0, 0); \
@@
-126,7
+129,6
@@
} while (0)
/* Function definitions */
} while (0)
/* Function definitions */
-int test_table(void);
uint64_t pipeline_test_hash(
void *key,
__attribute__((unused)) uint32_t key_size,
uint64_t pipeline_test_hash(
void *key,
__attribute__((unused)) uint32_t key_size,
@@
-180,7
+182,7
@@
struct rte_table {
rte_pipeline_table_action_handler_hit f_action;
uint32_t table_next_id;
uint32_t table_next_id_valid;
rte_pipeline_table_action_handler_hit f_action;
uint32_t table_next_id;
uint32_t table_next_id_valid;
- uint8_t actions_lookup_miss[CACHE_LINE_SIZE];
+ uint8_t actions_lookup_miss[
RTE_
CACHE_LINE_SIZE];
uint32_t action_data_size;
void *h_table;
};
uint32_t action_data_size;
void *h_table;
};