diff options
| author | lijia <[email protected]> | 2020-09-04 21:44:08 +0800 |
|---|---|---|
| committer | lijia <[email protected]> | 2020-09-04 21:44:08 +0800 |
| commit | a06e2531fe3e7d38457395ebfbffa0bea5501a3e (patch) | |
| tree | 343a253fedea4147168323dc01712701136cbdd5 /src/inner_plug | |
| parent | 3565515b06deee3fb4b702c0ec676cee4ac4759f (diff) | |
修复使用marsio模式编译, 但无法在旧型号CPU运行pcap模式的问题, 会在marsio.so的rte_cpu_get_flag_enabled()函数崩溃.
改为marsio.so全部使用dlopen模式加载.
Diffstat (limited to 'src/inner_plug')
| -rw-r--r-- | src/inner_plug/g_device_plug.c | 7 | ||||
| -rw-r--r-- | src/inner_plug/sapp_assistant.cpp | 4 |
2 files changed, 6 insertions, 5 deletions
diff --git a/src/inner_plug/g_device_plug.c b/src/inner_plug/g_device_plug.c index b353202..757b334 100644 --- a/src/inner_plug/g_device_plug.c +++ b/src/inner_plug/g_device_plug.c @@ -21,7 +21,8 @@ extern "C" { #if IOMODE_MARSIO static struct mr_instance * gdev_plug_extern_marsio4_instance; /* dlopen dynamic link sapp->marsio4 instance */ extern int marsio_send_burst_with_options_for_tcpdumpmesa(struct mr_sendpath * sendpath, queue_id_t sid, marsio_buff_t * mbufs[], int nr_mbufs, uint16_t options); - +extern int (*ptr_marsio_buff_malloc_global)(struct mr_instance * instance, marsio_buff_t *marsio_buff[], unsigned int nr_mbufs, int socket_id, int thread_id); +extern char * (*ptr_marsio_buff_append)(marsio_buff_t *m, uint16_t len); #endif #ifdef GIT_VERSION @@ -298,14 +299,14 @@ static int gdev_keepalive_plug(const raw_pkt_t *raw_pkt, int thread_id, unsigned marsio_buff_t *send_mbuf[1]; char *real_buf; - ret = marsio_buff_malloc_global(gdev_plug_extern_marsio4_instance, send_mbuf, 1, MARSIO_SOCKET_ID_ANY, thread_id); + ret = ptr_marsio_buff_malloc_global(gdev_plug_extern_marsio4_instance, send_mbuf, 1, MARSIO_SOCKET_ID_ANY, thread_id); if(ret < 0){ goto err; } //g_SysInputInfo[thread_id][PKT_MARSIO_MALLOC]++; /* �˴�ʹ��append������mtod, append�ڲ�ʵ�ʰ�����set datalen�IJ��� */ - real_buf = marsio_buff_append(send_mbuf[0], send_len + 14); + real_buf = ptr_marsio_buff_append(send_mbuf[0], send_len + 14); memcpy(real_buf, snd_handle->send_buf, send_len + 14); /* send_lenû����mac��ַ */ diff --git a/src/inner_plug/sapp_assistant.cpp b/src/inner_plug/sapp_assistant.cpp index b88aedd..27cf376 100644 --- a/src/inner_plug/sapp_assistant.cpp +++ b/src/inner_plug/sapp_assistant.cpp @@ -31,7 +31,7 @@ extern int MESA_get_dev_ipv4(const char *device, int *ip_add); extern int MESA_get_dev_mac(const char *device, unsigned char mac[6]); void * (*dl_marsio_buff_ctrlzone)(void *m, uint8_t id); - +extern void * (*ptr_marsio_buff_ctrlzone)(marsio_buff_t *m, uint8_t id); static int sapp_identify_broad_multicast_init(void) { @@ -53,7 +53,7 @@ static int sapp_identify_broad_multicast_init(void) /* �˴���Ҫ��dlclose(), ��Ϊ������Ҫ��dlopen��packet_io_marsio.so, */ #else - dl_marsio_buff_ctrlzone = (void * (*)(void *m, uint8_t id))marsio_buff_ctrlzone; + dl_marsio_buff_ctrlzone = (void * (*)(void *m, uint8_t id))ptr_marsio_buff_ctrlzone; #endif } #endif |
