summaryrefslogtreecommitdiff
path: root/app/include
diff options
context:
space:
mode:
authorQiuwen Lu <[email protected]>2017-03-20 15:45:32 +0800
committerQiuwen Lu <[email protected]>2017-03-20 15:45:32 +0800
commit12b59f3f18db45ff85e27d90fba44156dceec059 (patch)
tree0e4070687dfcde68d611bd9eacf08de7e7fdcfa2 /app/include
parentd92ba3bf81a931a77ca175a50f8990f8b91233d2 (diff)
调整MARSIOv4的接口,接口加入了instance参数。
Diffstat (limited to 'app/include')
-rw-r--r--app/include/arp.h5
-rw-r--r--app/include/mrapp.h47
2 files changed, 34 insertions, 18 deletions
diff --git a/app/include/arp.h b/app/include/arp.h
index 3e3c11c..0a668de 100644
--- a/app/include/arp.h
+++ b/app/include/arp.h
@@ -1,5 +1,8 @@
#pragma once
#include <mrapp.h>
-int arp_entry(struct vdev_instance* vdi, queue_id_t qid, struct rte_mbuf* mbufs_in[], int nr_mbufs_in);
+
+int arp_entry(struct mr_instance * instance, struct vdev_instance* vdi, queue_id_t qid,
+ struct rte_mbuf* mbufs_in[], int nr_mbufs_in);
+
int arp_request_send(struct vdev_instance* vdi, queue_id_t qid, struct in_addr in_addr); \ No newline at end of file
diff --git a/app/include/mrapp.h b/app/include/mrapp.h
index b6859c0..d765627 100644
--- a/app/include/mrapp.h
+++ b/app/include/mrapp.h
@@ -6,15 +6,7 @@
#include <neigh.h>
#include <marsio.h>
-struct mrapp_vdev
-{
- char devsym[MR_SYMBOL_MAX];
- unsigned int nr_rxstream;
- unsigned int nr_txstream;
- struct vdev_instance * vdi;
- unsigned int en_arp;
- unsigned int en_icmp;
-};
+struct mr_instance;
struct mrapp_stat
{
@@ -26,8 +18,22 @@ struct mrapp_stat
uint64_t t_arp_answer_drop;
};
-struct mrapp_instance
+/* 用户设备描述符 */
+struct mr_vdev
{
+ char devsym[MR_SYMBOL_MAX];
+ struct mr_instance * instance;
+ struct vdev_instance * vdi;
+ unsigned int nr_rxstream;
+ unsigned int nr_txstream;
+ unsigned int en_arp;
+ unsigned int en_icmp;
+};
+
+struct mr_instance
+{
+ /* ==== 运行句柄 ==== */
+
/* 应用名称 */
char appsym[MR_SYMBOL_MAX];
/* 状态监测输出路径 */
@@ -37,7 +43,7 @@ struct mrapp_instance
/* 消息框架句柄 */
struct ctrlmsg_handler * ctrlmsg_handler;
/* 虚设备实例列表 */
- struct mrapp_vdev vdevs[MR_VDEV_MAX];
+ struct mr_vdev vdevs[MR_VDEV_MAX];
/* 虚设备实例数量 */
unsigned int nr_vdevs;
/* 异步转同步,等待控制回复 */
@@ -48,15 +54,22 @@ struct mrapp_instance
struct neighbour_manager * neigh;
/* 统计 */
struct mrapp_stat stat[MR_SID_MAX];
+
+ /* ===== 运行选项 ===== */
+
+ /* 遇到错误,是否自动退出 */
+ unsigned int is_exit_when_err_raise;
+ /* 线程数 */
+ unsigned int nr_dataplane_thread;
+ /* 核心掩码 */
+ cpu_mask_t cpu_mask;
};
-/* 标志位,是否已经进行了初始化*/
-extern int mrapp_inited;
-/* 标志位,本线程是否已经进行了初始化 */
-extern int __thread mrapp_thread_inited;
-extern struct mrapp_instance * instance;
+/* EAL环境是否初始化 */
+extern unsigned int g_eal_inited;
+
/* 状态监测入口 */
-int mrapp_monit_loop(struct mrapp_instance * instance);
+int mrapp_monit_loop(struct mr_instance * instance);
int mrapp_packet_send_burst(struct vdev_instance * vdi, queue_id_t qid, struct rte_mbuf * mbufs[], int nr_mbufs);