diff options
| author | Lu Qiuwen <[email protected]> | 2023-10-08 19:59:31 +0800 |
|---|---|---|
| committer | Lu Qiuwen <[email protected]> | 2023-10-08 19:59:31 +0800 |
| commit | e9579ab2dff210ca3ff5fa5c5e10a9ec110ad70a (patch) | |
| tree | 603ee5234fa946d99996e28dc8437a9586034637 /app | |
| parent | fd24d58b74cdabfe5ea299bc9e5494a3e531d736 (diff) | |
修正rxbits统计有可能为负的问题;增加MP_CACHE的配置;去除不必要的mbuf reset。
Diffstat (limited to 'app')
| -rw-r--r-- | app/include/mrapp.h | 1 | ||||
| -rw-r--r-- | app/src/marsio.c | 8 | ||||
| -rw-r--r-- | app/src/mrb.c | 1 |
3 files changed, 7 insertions, 3 deletions
diff --git a/app/include/mrapp.h b/app/include/mrapp.h index c0a8877..9e1a53a 100644 --- a/app/include/mrapp.h +++ b/app/include/mrapp.h @@ -175,6 +175,7 @@ struct mr_instance /* mempool cache map */ struct mp_cache_map * mp_cache_map[MR_MEMPOOL_COUNT_MAX]; unsigned int nr_mp_cache_map; + unsigned int sz_mp_cache; /* vdev buffer size */ unsigned int sz_vdev_buffer; diff --git a/app/src/marsio.c b/app/src/marsio.c index 72b48cf..2bb64f8 100644 --- a/app/src/marsio.c +++ b/app/src/marsio.c @@ -59,6 +59,7 @@ struct mr_instance * _current_instance = NULL; #endif #define MR_VDEV_BUFFER_SIZE 512 +#define MR_MP_CACHE_SIZE 256 /* 写入Command参数 */ static void __write_arg(char * eal_argv[], unsigned int * eal_argc, unsigned int max_argc, const char * value) @@ -144,9 +145,12 @@ static void mrapp_rx_notify_init(struct mr_instance * instance) MESA_load_profile_uint_def(instance->g_cfgfile_path, "service", "poll_wait_throttle_notify_threshold", &instance->zero_recv_notify_threshold, 256); - MESA_load_profile_uint_def(instance->g_cfgfile_path, "service", "poll_wait_enable", &instance->en_notify, 1); + MESA_load_profile_uint_def(instance->g_cfgfile_path, "service", "poll_wait_enable", &instance->en_notify, + 1); MESA_load_profile_uint_def(instance->g_cfgfile_path, "service", "vdev_buffer_size", &instance->sz_vdev_buffer, MR_VDEV_BUFFER_SIZE); + MESA_load_profile_uint_def(instance->g_cfgfile_path, "service", "mp_cache_size", &instance->sz_mp_cache, + MR_MP_CACHE_SIZE); } /* EAL环境初始化 */ @@ -553,7 +557,7 @@ static void mp_cache_init_for_each_mp(struct rte_mempool * mp, void * arg) cpu_id_t cpu_id = cpu_set_location(&instance->cpu_set, i); socket_id_t socket_id = (socket_id_t)rte_lcore_to_socket_id(cpu_id); - struct rte_mempool_cache * mp_cache = rte_mempool_cache_create(512, socket_id); + struct rte_mempool_cache * mp_cache = rte_mempool_cache_create(instance->sz_mp_cache, socket_id); if (unlikely(mp_cache == NULL)) { MR_ERROR("failed at create local mp cache, thread_id=%d, mp=%s", i, mp->name); diff --git a/app/src/mrb.c b/app/src/mrb.c index 48c3313..29d141d 100644 --- a/app/src/mrb.c +++ b/app/src/mrb.c @@ -142,7 +142,6 @@ int marsio_buff_alloc_v2(struct mr_instance * instance, marsio_buff_t * buff[], for (int i = 0; i < nr_buffs; i++) { - marsio_buff_reset(buff[i]); struct rte_mbuf * m = (struct rte_mbuf *)buff[i]; struct mrb_metadata * mrb_metadata = mrbuf_cz_data(m, MR_NODE_CTRLZONE_ID); mrb_metadata->packet_create_from_nf = 1; |
