enhance: add configuration items to adjust the scheduling parameters of the main loop

This commit is contained in:
luwenpeng
2024-08-15 19:03:48 +08:00
parent 42f44b53b1
commit b0e08133b7
8 changed files with 239 additions and 26 deletions

View File

@@ -817,8 +817,9 @@ void ip_reassembly_free(struct ip_reassembly *assy)
}
}
void ip_reassembly_expire(struct ip_reassembly *assy, uint64_t now)
void ip_reassembly_expire(struct ip_reassembly *assy, uint64_t max_free, uint64_t now)
{
uint64_t count = 0;
struct ip_flow *flow = NULL;
uint64_t timeout = assy->timeout;
TAILQ_FOREACH(flow, &assy->lru, lru)
@@ -829,6 +830,12 @@ void ip_reassembly_expire(struct ip_reassembly *assy, uint64_t now)
ip_reassembly_del_flow(assy, flow);
ip_reassembly_stat_inc(assy, timeout, &flow->key);
ip_flow_free(flow);
count++;
if (count >= max_free)
{
break;
}
}
else
{