summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorluwenpeng <[email protected]>2023-10-15 21:05:06 +0800
committerluwenpeng <[email protected]>2023-10-15 21:47:22 +0800
commitc9b9b9bd8d50ec6b45f5e817dc86a7def3ff814f (patch)
tree76a54555c61caae6c598e23787d96e259986d453
parent968ba1374680c7130f585c6905513b23a01b63a5 (diff)
bugfix: send packet enable rehashv1.0.19-20231015dev-23.07-LTS
-rw-r--r--platform/src/packet_io.cpp2
-rw-r--r--test/marsio.cpp5
-rw-r--r--test/marsio.h16
3 files changed, 22 insertions, 1 deletions
diff --git a/platform/src/packet_io.cpp b/platform/src/packet_io.cpp
index f44150e..554934d 100644
--- a/platform/src/packet_io.cpp
+++ b/platform/src/packet_io.cpp
@@ -449,7 +449,7 @@ static int send_packet_to_sf(marsio_buff_t *rx_buff, struct metadata *meta, stru
}
int nsend = marsio_buff_datalen(rx_buff);
- marsio_send_burst(packet_io->dev_endpoint.mr_path, thread_index, &rx_buff, 1);
+ marsio_send_burst_with_options(packet_io->dev_endpoint.mr_path, thread_index, &rx_buff, 1, MARSIO_SEND_OPT_REHASH);
return nsend;
}
diff --git a/test/marsio.cpp b/test/marsio.cpp
index bda26b9..c58e61e 100644
--- a/test/marsio.cpp
+++ b/test/marsio.cpp
@@ -387,6 +387,11 @@ int marsio_send_burst(struct mr_sendpath *sendpath, queue_id_t qid, marsio_buff_
return marsio_buff_datalen(mbufs[0]);
}
+int marsio_send_burst_with_options(struct mr_sendpath *sendpath, queue_id_t sid, marsio_buff_t *mbufs[], int nr_mbufs, uint16_t options)
+{
+ return marsio_send_burst(sendpath, sid, mbufs, nr_mbufs);
+}
+
// new add, only for gtest
void marsio_set_recv_mbuff(struct mr_instance *instance, marsio_buff_t *mbuff)
{
diff --git a/test/marsio.h b/test/marsio.h
index 516c824..9c522f6 100644
--- a/test/marsio.h
+++ b/test/marsio.h
@@ -42,6 +42,21 @@ enum mr_buff_metadata_type
MR_BUFF_USER_0 = 254,
};
+typedef enum
+{
+ /* 发送后不释放数据包,由应用自行释放数据包 */
+ MARSIO_SEND_OPT_NO_FREE = 1 << 0,
+ /* 发送时计算发包哈希值,用于分流 */
+ MARSIO_SEND_OPT_REHASH = 1 << 1,
+ /* 快速报文路径 */
+ MARSIO_SEND_OPT_FAST = 1 << 2,
+ /* 报文追踪标记 */
+ MARSIO_SEND_OPT_TRACE = 1 << 3,
+ /* 控制报文标记 */
+ MARSIO_SEND_OPT_CTRL = 1 << 4
+
+} marsio_opt_send_t;
+
struct mr_instance *marsio_create();
int marsio_destory(struct mr_instance *instance);
@@ -81,6 +96,7 @@ void marsio_buff_set_ctrlbuf(marsio_buff_t *m);
int marsio_recv_burst(struct mr_vdev *vdev, queue_id_t qid, marsio_buff_t *mbufs[], int nr_mbufs);
int marsio_send_burst(struct mr_sendpath *sendpath, queue_id_t qid, marsio_buff_t *mbufs[], int nr_mbufs);
+int marsio_send_burst_with_options(struct mr_sendpath * sendpath, queue_id_t sid, marsio_buff_t * mbufs[], int nr_mbufs, uint16_t options);
// new add, only for gtest
void marsio_set_recv_mbuff(struct mr_instance *instance, marsio_buff_t *mbuff);