修改packet_io API的函数命名
This commit is contained in:
@@ -81,7 +81,7 @@ static void *worker_thread_cycle(void *arg)
|
||||
snprintf(thread_name, sizeof(thread_name), "sce:worker-%d", thread_index);
|
||||
prctl(PR_SET_NAME, (unsigned long long)thread_name, NULL, NULL, NULL);
|
||||
|
||||
if (packet_io_thread_init(handle, thread_ctx) != 0)
|
||||
if (packet_io_init(handle, thread_ctx) != 0)
|
||||
{
|
||||
goto error_out;
|
||||
}
|
||||
@@ -90,9 +90,9 @@ static void *worker_thread_cycle(void *arg)
|
||||
|
||||
while (!ATOMIC_READ(&is_need_stop))
|
||||
{
|
||||
n_packet_recved = packet_io_thread_polling_nf(handle, thread_ctx);
|
||||
n_packet_recved += packet_io_thread_polling_endpoint_l3(handle, thread_ctx);
|
||||
n_packet_recved += packet_io_thread_polling_endpoint_l2(handle, thread_ctx);
|
||||
n_packet_recved = packet_io_polling_nf(handle, thread_ctx);
|
||||
n_packet_recved += packet_io_polling_endpoint_l3(handle, thread_ctx);
|
||||
n_packet_recved += packet_io_polling_endpoint_l2(handle, thread_ctx);
|
||||
if (n_packet_recved == 0)
|
||||
{
|
||||
timeout_ms = sf_metrics_last_send_ts + sf_metrics_send_interval - timestamp_get_msec(ts);
|
||||
@@ -101,7 +101,7 @@ static void *worker_thread_cycle(void *arg)
|
||||
timeout_ms = 0;
|
||||
}
|
||||
|
||||
packet_io_thread_wait(handle, thread_ctx, timeout_ms);
|
||||
packet_io_wait(handle, thread_ctx, timeout_ms);
|
||||
}
|
||||
|
||||
global_metrics_update(global_metrics, thread_metrics, thread_index);
|
||||
|
||||
@@ -1461,7 +1461,7 @@ void packet_io_destory(struct packet_io *handle)
|
||||
}
|
||||
}
|
||||
|
||||
int packet_io_thread_init(struct packet_io *handle, struct thread_ctx *thread_ctx)
|
||||
int packet_io_init(struct packet_io *handle, struct thread_ctx *thread_ctx)
|
||||
{
|
||||
if (marsio_thread_init(handle->instance) != 0)
|
||||
{
|
||||
@@ -1472,7 +1472,7 @@ int packet_io_thread_init(struct packet_io *handle, struct thread_ctx *thread_ct
|
||||
return 0;
|
||||
}
|
||||
|
||||
void packet_io_thread_wait(struct packet_io *handle, struct thread_ctx *thread_ctx, int timeout_ms)
|
||||
void packet_io_wait(struct packet_io *handle, struct thread_ctx *thread_ctx, int timeout_ms)
|
||||
{
|
||||
struct mr_vdev *vdevs[3] = {
|
||||
handle->dev_nf.mr_dev,
|
||||
@@ -1491,7 +1491,7 @@ void packet_io_thread_wait(struct packet_io *handle, struct thread_ctx *thread_c
|
||||
}
|
||||
}
|
||||
|
||||
int packet_io_thread_polling_nf(struct packet_io *handle, struct thread_ctx *thread_ctx)
|
||||
int packet_io_polling_nf(struct packet_io *handle, struct thread_ctx *thread_ctx)
|
||||
{
|
||||
struct thread_metrics *thread_metrics = &thread_ctx->thread_metrics;
|
||||
int thread_index = thread_ctx->thread_index;
|
||||
@@ -1554,7 +1554,7 @@ int packet_io_thread_polling_nf(struct packet_io *handle, struct thread_ctx *thr
|
||||
return nr_recv;
|
||||
}
|
||||
|
||||
int packet_io_thread_polling_endpoint_l3(struct packet_io *handle, struct thread_ctx *thread_ctx)
|
||||
int packet_io_polling_endpoint_l3(struct packet_io *handle, struct thread_ctx *thread_ctx)
|
||||
{
|
||||
struct thread_metrics *thread_metrics = &thread_ctx->thread_metrics;
|
||||
int thread_index = thread_ctx->thread_index;
|
||||
@@ -1590,7 +1590,7 @@ int packet_io_thread_polling_endpoint_l3(struct packet_io *handle, struct thread
|
||||
return nr_recv;
|
||||
}
|
||||
|
||||
int packet_io_thread_polling_endpoint_l2(struct packet_io *handle, struct thread_ctx *thread_ctx)
|
||||
int packet_io_polling_endpoint_l2(struct packet_io *handle, struct thread_ctx *thread_ctx)
|
||||
{
|
||||
struct thread_metrics *thread_metrics = &thread_ctx->thread_metrics;
|
||||
int thread_index = thread_ctx->thread_index;
|
||||
|
||||
Reference in New Issue
Block a user