summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQiuwen Lu <[email protected]>2017-07-12 14:43:13 +0800
committerQiuwen Lu <[email protected]>2017-07-12 14:43:13 +0800
commit5a830d0b4ba805a70f72160e8bd01e516d37492c (patch)
tree47fc1ab84096384f865703405985429142174fee
parentd7eeb5574c2669479b562c43dcb36e6697775ae7 (diff)
修正ctrlzone复制时死循环的问题,修正vdevsendpath中修改L2的问题等。v4.2.3-20170712
-rw-r--r--app/src/mrb.c4
-rw-r--r--app/src/rawio.c15
-rw-r--r--app/src/sendpath.c1
-rw-r--r--include/external/marsio.h4
4 files changed, 21 insertions, 3 deletions
diff --git a/app/src/mrb.c b/app/src/mrb.c
index 21352e6..1b0463e 100644
--- a/app/src/mrb.c
+++ b/app/src/mrb.c
@@ -245,6 +245,10 @@ static void __buff_clone_ctrlzone(marsio_buff_t * mc, marsio_buff_t * md)
/* 拆除控制域中的next指针?*/
__mc_priv_zone->next = NULL;
+
+ /* 下一个链表项 */
+ __mc = __mc->next;
+ __md = __md->next;
}
/* 断言,__mc和__mi同时到达链表的终点,否则说明链表克隆时出现了问题。 */
diff --git a/app/src/rawio.c b/app/src/rawio.c
index 0c55c73..a434238 100644
--- a/app/src/rawio.c
+++ b/app/src/rawio.c
@@ -87,6 +87,10 @@ static int __send_burst_packet_construct(struct mr_sendpath * sendpath, queue_id
{
struct rte_mbuf ** __mbufs = (struct rte_mbuf **)mbufs;
+ if (sendpath->fn_prebuild_hook != NULL && sendpath->fn_prebuild_hook(sendpath, __mbufs, nr_mbufs,
+ sendpath->prebuild_hook_args) < 0)
+ goto err;
+
/* 查询这个SendPath是否可用 */
if (!sendpath->can_use && sendpath->fn_requery(sendpath) < 0)
goto err;
@@ -99,6 +103,10 @@ static int __send_burst_packet_construct(struct mr_sendpath * sendpath, queue_id
if (sendpath->fn_l2_construct != NULL && sendpath->fn_l2_construct(sendpath, __mbufs, nr_mbufs) < 0)
goto err;
+ if (sendpath->fn_postbuild_hook != NULL && sendpath->fn_postbuild_hook(sendpath, __mbufs, nr_mbufs,
+ sendpath->postbuild_hook_args) < 0)
+ goto err;
+
return RT_SUCCESS;
err:
@@ -156,7 +164,7 @@ int marsio_send_burst_with_options(struct mr_sendpath * sendpath, queue_id_t sid
if (options & MARSIO_SEND_OPT_REHASH)
{
- distributer_caculate(sendpath->instance->dist_object, (struct rte_mbuf **)mbufs, nr_mbufs);
+ distributer_caculate(sendpath->instance->dist_object, __mbufs, nr_mbufs);
}
if (options & MARSIO_SEND_OPT_NO_FREE)
@@ -164,6 +172,11 @@ int marsio_send_burst_with_options(struct mr_sendpath * sendpath, queue_id_t sid
for (int i = 0; i < nr_mbufs; i++) rte_pktmbuf_refcnt_update(__mbufs[i], 1);
}
+ if (options & MARSIO_SEND_OPT_CTRL)
+ {
+ for (int i = 0; i < nr_mbufs; i++) __mbufs[i]->ol_flags |= CTRL_MBUF_FLAG;
+ }
+
hash_t hash[MR_BURST_MAX];
for (int i = 0; i < nr_mbufs; i++) hash[i] = __mbufs[i]->hash.usr;
diff --git a/app/src/sendpath.c b/app/src/sendpath.c
index 0fc6a38..d7991a5 100644
--- a/app/src/sendpath.c
+++ b/app/src/sendpath.c
@@ -90,7 +90,6 @@ static struct mr_sendpath * sendpath_vdev_create(struct mr_instance * instance,
/* Callback Functions */
_sendpath->_father.fn_destory = sendpath_vdev_destory;
- _sendpath->_father.fn_l2_construct = sendpath_vdev_l2_construct;
_sendpath->_father.fn_option_set = sendpath_vdev_option_set;
_sendpath->_father.fn_option_get = sendpath_vdev_option_get;
diff --git a/include/external/marsio.h b/include/external/marsio.h
index 2ff1d5d..3b8aae1 100644
--- a/include/external/marsio.h
+++ b/include/external/marsio.h
@@ -35,7 +35,9 @@ typedef enum
/* 快速报文路径 */
MARSIO_SEND_OPT_FAST = 1 << 2,
/* 报文追踪标记 */
- MARSIO_SEND_OPT_TRACE = 1 << 3
+ MARSIO_SEND_OPT_TRACE = 1 << 3,
+ /* 控制报文标记 */
+ MARSIO_SEND_OPT_CTRL = 1 << 4
} marsio_opt_send_t;