summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorQiuwen Lu <[email protected]>2017-12-05 10:43:03 +0800
committerQiuwen Lu <[email protected]>2017-12-05 10:43:03 +0800
commit807ec9b870a9e1b28f4176d92fcdd8dfe052148f (patch)
treebb96dd5903d27ae61a66f1abdae11c50501c42e1 /include
parent8817d1203b309a8ca9ffcd8e3223b207c16a2f6c (diff)
增加申请/释放共享内存的接口,增加新的时间戳接口。v4.2.35-20171205
- 增加申请/释放共享内存的接口,该共享内存基于DPDK的大页内存,可以跨进程共享通信。 - 增加新的时间戳接口,获取128位时间戳,报文复制时该时间戳也随之复制。
Diffstat (limited to 'include')
-rw-r--r--include/external/marsio.h10
-rw-r--r--include/internal/mrb_define.h9
2 files changed, 19 insertions, 0 deletions
diff --git a/include/external/marsio.h b/include/external/marsio.h
index 457903e..f18e416 100644
--- a/include/external/marsio.h
+++ b/include/external/marsio.h
@@ -89,6 +89,12 @@ enum mr_thread_affinity_mode
MR_THREAD_AFFINITY_USER = 255
};
+enum mr_timestamp_type
+{
+ /* 从网卡收取时或报文缓冲区申请时的时间戳 */
+ MR_TIMESTAMP_RX_OR_ALLOC = 0,
+};
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -239,6 +245,10 @@ 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_shared_mem_alloc(struct mr_instance * instance, size_t len);
+void marsio_shared_mem_free(struct mr_instance * instance, void * mem);
#ifdef __cplusplus
}
diff --git a/include/internal/mrb_define.h b/include/internal/mrb_define.h
index c0f1df9..6d49776 100644
--- a/include/internal/mrb_define.h
+++ b/include/internal/mrb_define.h
@@ -12,9 +12,18 @@ struct mrb_zone_idx
uint8_t size;
};
+/* Private Zone for DEBUG */
+struct mrb_zone_ts
+{
+ struct timespec ts_srv_rx_or_alloc;
+ struct timespec ts_app_rx_or_alloc;
+};
+
struct mrb_priv_zone
{
struct rte_mbuf * next;
+ struct mrb_zone_ts ts;
+
uint8_t cz_num;
struct mrb_zone_idx idx[MRB_MAX_CTRLZONE_NUM];
}__rte_packed;