-
Notifications
You must be signed in to change notification settings - Fork 728
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Performance issue caused by invoking 'rte_malloc' frequently. #595
base: devel
Are you sure you want to change the base?
Conversation
flyinskyabc
commented
Jun 24, 2020
- Deprecate 'rte_malloc', use 'rte_mempool_get' for inserting UOA instead.
- Remove unnecessary reference counting for 'struct inet_device'.
1. Deprecate 'rte_malloc', use 'rte_mempool_get' for inserting UOA instead. 2. Remove unnecessary reference counting for 'struct inet_device'.
0, NULL, NULL, NULL, NULL, i, 0); | ||
|
||
if (unlikely(!g_uoa_cache[i])) { | ||
return EDPVS_NOMEM; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
free previous uoa_cache memory before return
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codes are OK now. But mempool of the same size with dp_vs_conn
may not memory friendly enough.
Actually, we are planning to fix rte_malloc problem in all critical packet pathes using dpvs's mempool, which supports variable length mempool and provides a balance between rte_malloc and dpdk mempool.You could help us with the plan if you are interested with it.
@@ -177,8 +181,8 @@ static int udp_conn_sched(struct dp_vs_proto *proto, | |||
if ((*conn)->dest->fwdmode == DPVS_FWD_MODE_FNAT && g_uoa_max_trail > 0) { | |||
struct conn_uoa *uoa; | |||
|
|||
(*conn)->prot_data = rte_zmalloc(NULL, sizeof(struct conn_uoa), 0); | |||
if (!(*conn)->prot_data) { | |||
err = rte_mempool_get(this_uoa_cache, (void **)&((*conn)->prot_data)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for now, struct conn_uoa has 6 bytes only, maybe use prot_data directly
uoa = (void*)&(*conn)->prot_data