summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorluqiuwen <[email protected]>2018-12-28 19:13:14 +0600
committerluqiuwen <[email protected]>2018-12-28 19:13:14 +0600
commit29c231d822d486da942cb502b506870acbdbe0ee (patch)
tree72e40dd445619ff996738f28247e47503ae2bafc
parentda5478eeb4cbe64b8ac0fb71013aa7fb72f78506 (diff)
Close #6 增加用户自定义分流哈希值接口及对应实现
-rw-r--r--app/src/mrb.c11
-rw-r--r--app/src/version.map1
-rw-r--r--include/external/marsio.h4
3 files changed, 15 insertions, 1 deletions
diff --git a/app/src/mrb.c b/app/src/mrb.c
index 4a1c64d..141b18c 100644
--- a/app/src/mrb.c
+++ b/app/src/mrb.c
@@ -594,6 +594,17 @@ int marsio_buff_get_timestamp_ex(marsio_buff_t * m, enum mr_timestamp_type ts_ty
return RT_SUCCESS;
}
+void marsio_buff_set_rehash_index(marsio_buff_t *m, uint32_t hash)
+{
+ struct rte_mbuf * __m = (struct rte_mbuf *)m;
+ __m->hash.usr = hash;
+}
+
+uint32_t marsio_buff_get_rehash_index(marsio_buff_t * m)
+{
+ struct rte_mbuf * __m = (struct rte_mbuf *)m;
+ return __m->hash.usr;
+}
void * marsio_shared_mem_alloc(struct mr_instance * instance, size_t len)
{
diff --git a/app/src/version.map b/app/src/version.map
index 7b4e91d..1e5f639 100644
--- a/app/src/version.map
+++ b/app/src/version.map
@@ -69,6 +69,7 @@ global:
marsio_shared_mem_free;
marsio_buff_get_timestamp_ex;
+ marsio_buff_set_rehash_index;
local: *;
}; \ No newline at end of file
diff --git a/include/external/marsio.h b/include/external/marsio.h
index f18e416..1d34a97 100644
--- a/include/external/marsio.h
+++ b/include/external/marsio.h
@@ -244,9 +244,11 @@ void marsio_buff_set_ctrlbuf(marsio_buff_t *m);
uint64_t marsio_buff_get_timestamp(marsio_buff_t *m);
void marsio_buff_set_timestamp(marsio_buff_t *m, uint64_t timestamp);
-
int marsio_buff_get_timestamp_ex(marsio_buff_t * m, enum mr_timestamp_type ts_type, struct timespec * ts);
+void marsio_buff_set_rehash_index(marsio_buff_t *m, uint32_t hash);
+uint32_t marsio_buff_get_rehash_index(marsio_buff_t * m);
+
void * marsio_shared_mem_alloc(struct mr_instance * instance, size_t len);
void marsio_shared_mem_free(struct mr_instance * instance, void * mem);